diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 5c561f543..e5f3fe1fd 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -55,6 +55,7 @@ using namespace NLMISC; // Allow up to 10 redirects, then give up #define DEFAULT_RYZOM_REDIRECT_LIMIT (10) // +#define FONT_WEIGHT_NORMAL 400 #define FONT_WEIGHT_BOLD 700 namespace NLGUI @@ -1417,14 +1418,24 @@ namespace NLGUI if (present[MY_HTML_INPUT_ALT] && value[MY_HTML_INPUT_ALT]) tooltip = value[MY_HTML_INPUT_ALT]; + // by default not inherited + CStyleParams style; + style.TextColor = TextColor; + style.FontSize = TextFontSize; + style.FontWeight = FONT_WEIGHT_NORMAL; + style.FontOblique = false; + + if (present[MY_HTML_INPUT_STYLE] && value[MY_HTML_INPUT_STYLE]) + getStyleParams(value[MY_HTML_INPUT_STYLE], style); + + _TextColor.push_back(style.TextColor); + _FontSize.push_back(style.FontSize); + _FontWeight.push_back(style.FontWeight); + _FontOblique.push_back(style.FontOblique); + string type = toLower(value[MY_HTML_INPUT_TYPE]); if (type == "image") { - CStyleParams style; - // width, height from inline css - if (present[MY_HTML_INPUT_STYLE] && value[MY_HTML_INPUT_STYLE]) - getStyleParams(value[MY_HTML_INPUT_STYLE], style); - // The submit button string name; string normal; @@ -1632,6 +1643,11 @@ namespace NLGUI _Forms.back().Entries.push_back (entry); } } + + popIfNotEmpty(_FontSize); + popIfNotEmpty(_TextColor); + popIfNotEmpty(_FontWeight); + popIfNotEmpty(_FontOblique); } } break; @@ -1871,6 +1887,21 @@ namespace NLGUI // Got one form ? if (!(_Forms.empty())) { + // not inherited by default + CStyleParams style; + style.TextColor = TextColor; + style.FontWeight = FONT_WEIGHT_NORMAL; + style.FontOblique = false; + style.FontSize = TextFontSize; + + if (present[MY_HTML_TEXTAREA_STYLE] && value[MY_HTML_TEXTAREA_STYLE]) + getStyleParams(value[MY_HTML_TEXTAREA_STYLE], style); + + _TextColor.push_back(style.TextColor); + _FontSize.push_back(style.FontSize); + _FontWeight.push_back(style.FontWeight); + _FontOblique.push_back(style.FontOblique); + // read general property string templateName; @@ -2187,6 +2218,11 @@ namespace NLGUI entry.TextArea = textArea; _Forms.back().Entries.push_back (entry); } + + popIfNotEmpty (_FontSize); + popIfNotEmpty (_FontWeight); + popIfNotEmpty (_FontOblique); + popIfNotEmpty (_TextColor); } } break; @@ -3988,11 +4024,16 @@ namespace NLGUI { // Not added ? std::vector > templateParams; - templateParams.push_back (std::pair ("w", toString (cols*12))); - //templateParams.push_back (std::pair ("h", toString (rows*12))); + templateParams.push_back (std::pair ("w", toString (cols*getFontSize()))); templateParams.push_back (std::pair ("id", name)); templateParams.push_back (std::pair ("prompt", "")); templateParams.push_back (std::pair ("multiline", multiLine?"true":"false")); + templateParams.push_back (std::pair ("fontsize", toString (getFontSize()))); + templateParams.push_back (std::pair ("color", getTextColor().toString())); + if (getFontWeight() >= FONT_WEIGHT_BOLD) + templateParams.push_back (std::pair ("fontweight", "bold")); + if (getFontOblique()) + templateParams.push_back (std::pair ("fontstyle", "oblique")); if (multiLine) templateParams.push_back (std::pair ("multi_min_line", toString(rows))); templateParams.push_back (std::pair ("want_return", multiLine?"true":"false")); diff --git a/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml b/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml index 67145ff4c..9821bd34a 100644 --- a/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml +++ b/code/ryzom/client/data/gamedev/interfaces_v3/login_widgets.xml @@ -111,7 +111,9 @@ entry_type="text" keep="true" max_historic="40" - fontsize="10" + fontsize="10" + fontweight="" + fontstyle="" backup_father_container_pos="false" want_return="false" color="255 255 255 255" @@ -122,7 +124,7 @@ - +