From 69728b9a2eca871c1ce61a8ccc0649be0e2cd9dc Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 12 Jun 2016 12:46:42 +0300 Subject: [PATCH] Changed: CSS inherit value for some properties --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index e5f3fe1fd..bf862e289 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -5588,15 +5588,23 @@ namespace NLGUI { if (it->first == "font-size") { - float tmp; - sint size = 0; - getPercentage (size, tmp, it->second.c_str()); - if (size > 0) - style.FontSize = size; + if (it->second == "inherit") + style.FontSize = getFontSize(); + else + { + float tmp; + sint size = 0; + getPercentage (size, tmp, it->second.c_str()); + if (size > 0) + style.FontSize = size; + } } else if (it->first == "font-style") { + if (it->second == "inherit") + style.FontOblique = getFontOblique(); + else if (it->second == "italic" || it->second == "oblique") style.FontOblique = true; } @@ -5605,6 +5613,9 @@ namespace NLGUI { // https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight uint weight = 400; + if (it->second == "inherit") + weight = getFontWeight(); + else if (it->second == "normal") weight = 400; else @@ -5637,7 +5648,10 @@ namespace NLGUI } else if (it->first == "color") - scanHTMLColor(it->second.c_str(), style.TextColor); + if (it->second == "inherit") + style.TextColor = getTextColor(); + else + scanHTMLColor(it->second.c_str(), style.TextColor); else if (it->first == "text-decoration" || it->first == "text-decoration-line") {