Changed: Treat input 'size' attribute as chars (old was pixels). Add '-ryzom-input-size-px: true;' css property for old behaviour.

--HG--
branch : html-improvements
hg/feature/html-improvements
Nimetu 5 years ago
parent f25771118d
commit 4ec9024077

@ -5969,16 +5969,20 @@ namespace NLGUI
ucstring ucValue; ucstring ucValue;
ucValue.fromUtf8(elm.getAttribute("value")); ucValue.fromUtf8(elm.getAttribute("value"));
uint size = 120; uint size = 20;
uint maxlength = 1024; uint maxlength = 1024;
if (elm.hasNonEmptyAttribute("size")) if (elm.hasNonEmptyAttribute("size"))
fromString(elm.getAttribute("size"), size); fromString(elm.getAttribute("size"), size);
if (elm.hasNonEmptyAttribute("maxlength")) if (elm.hasNonEmptyAttribute("maxlength"))
fromString(elm.getAttribute("maxlength"), maxlength); fromString(elm.getAttribute("maxlength"), maxlength);
// ryzom client used to have 'size' attribute in pixels, (12 == was default font size)
if (_Style.hasStyle("-ryzom-input-size-px") && _Style.getStyle("-ryzom-input-size-px") == "true")
size = size / 12;
string textTemplate(!templateName.empty() ? templateName : DefaultFormTextGroup); string textTemplate(!templateName.empty() ? templateName : DefaultFormTextGroup);
// Add the editbox // Add the editbox
CInterfaceGroup *textArea = addTextArea (textTemplate, name.c_str (), 1, size/12, false, ucValue, maxlength); CInterfaceGroup *textArea = addTextArea (textTemplate, name.c_str (), 1, size, false, ucValue, maxlength);
if (textArea) if (textArea)
{ {
// Add the text area to the form // Add the text area to the form

Loading…
Cancel
Save