From 379a7f0e98450042ddd54e3aee3d5e7702e7b133 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 8 Sep 2019 10:37:08 +0300 Subject: [PATCH] Changed: Ignore UI fontsize coef setting for html content. --HG-- branch : html-improvements --- code/nel/include/nel/gui/group_menu.h | 3 ++- code/nel/src/gui/group_html.cpp | 5 ++--- code/nel/src/gui/group_menu.cpp | 8 +++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/code/nel/include/nel/gui/group_menu.h b/code/nel/include/nel/gui/group_menu.h index cfe91f7f9..2adb11b64 100644 --- a/code/nel/include/nel/gui/group_menu.h +++ b/code/nel/include/nel/gui/group_menu.h @@ -352,7 +352,7 @@ namespace NLGUI void setMinH(sint32 minH); // change fontsize for new menu items - void setFontSize(uint32 fontSize); + void setFontSize(uint32 fontSize, bool coef = true); // Gray a line on the RootMenu void setGrayedLine(uint line, bool g); @@ -392,6 +392,7 @@ namespace NLGUI bool _Formatted; uint8 _Space; sint32 _FontSize; + bool _FontSizeCoef; NLMISC::CRGBA _ColorOver; // Color of the text when the mouse is over it NLMISC::CRGBA _ShadowColorOver; // Color of the shadow when the mouse is over it diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 044ab8b77..ad498651f 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -433,10 +433,9 @@ namespace NLGUI { if (pVT) { - pVT->setFontSize(style.FontSize); pVT->setColor(style.TextColor); pVT->setFontName(style.FontFamily); - pVT->setFontSize(style.FontSize); + pVT->setFontSize(style.FontSize, false); pVT->setEmbolden(style.FontWeight >= FONT_WEIGHT_BOLD); pVT->setOblique(style.FontOblique); pVT->setUnderlined(style.Underlined); @@ -6465,7 +6464,7 @@ namespace NLGUI sb->setMinH(_Style.Current.Height); sb->setMaxVisibleLine(size); - sb->setFontSize(_Style.Current.FontSize); + sb->setFontSize(_Style.Current.FontSize, false); } entry.SelectBox = sb; diff --git a/code/nel/src/gui/group_menu.cpp b/code/nel/src/gui/group_menu.cpp index d8b3452ed..f18e46d05 100644 --- a/code/nel/src/gui/group_menu.cpp +++ b/code/nel/src/gui/group_menu.cpp @@ -1221,7 +1221,7 @@ namespace NLGUI pV->setText (name); } pV->setColor (_GroupMenu->_Color); - pV->setFontSize (_GroupMenu->_FontSize); + pV->setFontSize (_GroupMenu->_FontSize, _GroupMenu->_FontSizeCoef); pV->setShadow (_GroupMenu->_Shadow); pV->setShadowOutline (_GroupMenu->_ShadowOutline); pV->setCheckable(checkable); @@ -1310,7 +1310,7 @@ namespace NLGUI } pV->setColor (_GroupMenu->_Color); - pV->setFontSize (_GroupMenu->_FontSize); + pV->setFontSize (_GroupMenu->_FontSize, _GroupMenu->_FontSizeCoef); pV->setShadow (_GroupMenu->_Shadow); pV->setShadowOutline (_GroupMenu->_ShadowOutline); pV->setCheckable(checkable); @@ -1968,6 +1968,7 @@ namespace NLGUI _ShadowColorGrayed = CRGBA::Black; _HighLightOver.set(128, 0, 0, 255); _FontSize = 12; + _FontSizeCoef = true; _Shadow = false; _ShadowOutline = false; _ResizeFromChildH = _ResizeFromChildW = true; @@ -2562,9 +2563,10 @@ namespace NLGUI } // ------------------------------------------------------------------------------------------------ - void CGroupMenu::setFontSize(uint fontSize) + void CGroupMenu::setFontSize(uint fontSize, bool coef) { _FontSize = fontSize; + _FontSizeCoef = coef; } // ------------------------------------------------------------------------------------------------