diff --git a/indra/llui/llmultisliderctrl.cpp b/indra/llui/llmultisliderctrl.cpp index f4970b792..b8ebb3d6b 100644 --- a/indra/llui/llmultisliderctrl.cpp +++ b/indra/llui/llmultisliderctrl.cpp @@ -543,22 +543,32 @@ LLView* LLMultiSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFa S32 max_sliders = 1; node->getAttributeS32("max_sliders", max_sliders); + S32 value_width = 0; + node->getAttributeS32("val_width", value_width); S32 text_left = 0; if (show_text) { - // calculate the size of the text box (log max_value is number of digits - 1 so plus 1) - if ( max_value ) - text_left = font->getWidth(std::string("0")) * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 ); + if(value_width > 0) + { + //Fixed width. Be wary of precision and sign causing text to take more space than expected! + text_left = value_width; + } + else + { + // calculate the size of the text box (log max_value is number of digits - 1 so plus 1) + if ( max_value ) + text_left = font->getWidth(std::string("0")) * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 ); - if ( increment < 1.0f ) - text_left += font->getWidth(std::string(".")); // (mostly) take account of decimal point in value + if ( increment < 1.0f ) + text_left += font->getWidth(std::string(".")); // (mostly) take account of decimal point in value - if ( min_value < 0.0f || max_value < 0.0f ) - text_left += font->getWidth(std::string("-")); // (mostly) take account of minus sign + if ( min_value < 0.0f || max_value < 0.0f ) + text_left += font->getWidth(std::string("-")); // (mostly) take account of minus sign - // padding to make things look nicer - text_left += 8; + // padding to make things look nicer + text_left += 8; + } } LLUICtrlCallback callback = NULL; diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp index ad6382729..60907fd58 100644 --- a/indra/llui/llsliderctrl.cpp +++ b/indra/llui/llsliderctrl.cpp @@ -455,21 +455,32 @@ LLView* LLSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory U32 precision = 3; node->getAttributeU32("decimal_digits", precision); + S32 value_width = 0; + node->getAttributeS32("val_width", value_width); + S32 text_left = 0; if (show_text) { - // calculate the size of the text box (log max_value is number of digits - 1 so plus 1) - if ( max_value ) - text_left = font->getWidth(std::string("0")) * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 ); + if(value_width > 0) + { + //Fixed width. Be wary of precision and sign causing text to take more space than expected! + text_left = value_width; + } + else + { + // calculate the size of the text box (log max_value is number of digits - 1 so plus 1) + if ( max_value ) + text_left = font->getWidth(std::string("0")) * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 ); - if ( increment < 1.0f ) - text_left += font->getWidth(std::string(".")); // (mostly) take account of decimal point in value + if ( increment < 1.0f ) + text_left += font->getWidth(std::string(".")); // (mostly) take account of decimal point in value - if ( min_value < 0.0f || max_value < 0.0f ) - text_left += font->getWidth(std::string("-")); // (mostly) take account of minus sign + if ( min_value < 0.0f || max_value < 0.0f ) + text_left += font->getWidth(std::string("-")); // (mostly) take account of minus sign - // padding to make things look nicer - text_left += 8; + // padding to make things look nicer + text_left += 8; + } } LLUICtrlCallback callback = NULL; diff --git a/indra/newview/skins/default/xui/en-us/wlfPanel_AdvSettings_expanded.xml b/indra/newview/skins/default/xui/en-us/wlfPanel_AdvSettings_expanded.xml index c3031feb4..f95de14ba 100644 --- a/indra/newview/skins/default/xui/en-us/wlfPanel_AdvSettings_expanded.xml +++ b/indra/newview/skins/default/xui/en-us/wlfPanel_AdvSettings_expanded.xml @@ -6,27 +6,27 @@