From 73d010ca6b21137cc5f76d0e14d3717dd062f605 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sat, 19 Dec 2015 20:39:33 +0200 Subject: [PATCH 1/3] Fixed: Timestamps in chat not visible after switching characters --HG-- branch : develop --- code/ryzom/client/src/interface_v3/chat_text_manager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/ryzom/client/src/interface_v3/chat_text_manager.cpp b/code/ryzom/client/src/interface_v3/chat_text_manager.cpp index 0496f547e..750630a17 100644 --- a/code/ryzom/client/src/interface_v3/chat_text_manager.cpp +++ b/code/ryzom/client/src/interface_v3/chat_text_manager.cpp @@ -232,4 +232,5 @@ void CChatTextManager::reset () _TextFontSize = NULL; _TextMultilineSpace = NULL; _TextShadowed = NULL; + _ShowTimestamps = NULL; } From 5e61995c3c01d074ce8d707129b346d95d25132f Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sat, 19 Dec 2015 20:39:40 +0200 Subject: [PATCH 2/3] Changed: Render p and div as block level elements --HG-- branch : develop --- code/nel/include/nel/gui/group_html.h | 10 +++++++++- code/nel/src/gui/group_html.cpp | 16 ++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index ae21ad9c6..fb2f5b372 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -572,7 +572,15 @@ namespace NLGUI return ""; return _LinkClass.back().c_str(); } - + + std::vector _BlockLevelElement; + inline const bool isBlockLevelElement() const + { + if (_BlockLevelElement.empty()) + return false; + return _BlockLevelElement.back(); + } + // Divs (i.e. interface group) std::vector _Divs; inline CInterfaceGroup *getDiv() const diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 8d43dbc02..8ca74d6a4 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -1145,6 +1145,7 @@ namespace NLGUI case HTML_DIV: { + _BlockLevelElement.push_back(true); registerAnchorName(MY_HTML_DIV); if (present[MY_HTML_DIV_NAME] && value[MY_HTML_DIV_NAME]) @@ -1204,6 +1205,8 @@ namespace NLGUI inst->setPosRef(Hotspot_TL); inst->setParentPosRef(Hotspot_TL); getDiv()->addGroup(inst); + + _BlockLevelElement.back() = false; } else { @@ -1220,6 +1223,11 @@ namespace NLGUI } } } + + if (isBlockLevelElement()) + { + newParagraph(0); + } } break; @@ -2118,12 +2126,20 @@ namespace NLGUI popIfNotEmpty (_GlobalColor); endParagraph(); break; + case HTML_P: + endParagraph(); + break; case HTML_PRE: popIfNotEmpty (_PRE); break; case HTML_DIV: + if (isBlockLevelElement()) + { + endParagraph(); + } _DivName = ""; popIfNotEmpty (_Divs); + popIfNotEmpty (_BlockLevelElement); break; case HTML_TABLE: From e68d6f83fea23222c2f40f526bac597d808cce65 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Fri, 18 Dec 2015 21:23:18 +0200 Subject: [PATCH 3/3] Fixed: Incorrect vertical spacing between block style elements --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 8ca74d6a4..0396051ac 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -4154,9 +4154,7 @@ namespace NLGUI group->setSizeRef(CInterfaceElement::width); // Compute begin space between paragraph and tables - // * If first in group, no begin space - // * If behind a paragraph, take the biggest begin space between the previous paragraph and current one. // Pointer on the current paragraph (can be a table too) CGroupParagraph *p = dynamic_cast(group); @@ -4178,11 +4176,6 @@ namespace NLGUI group->setParentPos(groups.back()); group->setPosRef(Hotspot_TL); group->setParentPosRef(Hotspot_BL); - - // Begin space for previous paragraph - CGroupParagraph *previous = dynamic_cast(groups.back()); - if (previous) - beginSpace = std::max(beginSpace, previous->getTopSpace()); } // Set the begin space