Merge branch 'master' of git://github.com/Shyotl/SingularityViewer

This commit is contained in:
Lirusaito
2012-01-13 15:50:16 -05:00
3 changed files with 44 additions and 23 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -6,27 +6,27 @@
<slider bottom="160" left="5" control_name="RenderFarClip"
decimal_digits="0" enabled="true" follows="left|bottom" height="20"
increment="8" label="Draw Dist.:" can_edit_text="true"
label_width="53" max_val="1024" min_val="24" mouse_opaque="true"
label_width="53" max_val="1024" min_val="24" val_width="36" mouse_opaque="true"
name="DrawDistance" show_text="true" width="189" tool_tip="Change your Draw Distance"/>
<slider bottom_delta="-20" left="5" control_name="ThrottleBandwidthKBPS"
decimal_digits="0" enabled="true" follows="left|bottom" height="20"
increment="50" label="Bandwidth:" can_edit_text="true"
label_width="53" max_val="5000" min_val="50" mouse_opaque="true"
label_width="53" max_val="5000" min_val="50" val_width="36" mouse_opaque="true"
name="max_bandwidth" show_text="true" width="189" tool_tip="Set your Network bandwidth in kbps (kilobits per second)"/>
<slider bottom_delta="-20" left="5" control_name="RenderMaxPartCount"
decimal_digits="0" enabled="true" follows="left|bottom" height="20"
increment="256" label="Particles:" can_edit_text="true"
label_width="53" max_val="8192" min_val="0" mouse_opaque="true"
label_width="53" max_val="8192" min_val="0" val_width="36" mouse_opaque="true"
name="MaxParticleCount" show_text="true" width="189" tool_tip="Amount of particles to render"/>
<slider bottom_delta="-20" left="5" control_name="RenderAvatarMaxVisible"
decimal_digits="0" enabled="true" follows="left|bottom" height="20"
increment="1" label="Max Avs:" can_edit_text="true"
label_width="53" max_val="0050" min_val="1" mouse_opaque="true"
label_width="53" max_val="50" min_val="1" val_width="36" mouse_opaque="true"
name="RenderAvatarMaxVisible" show_text="true" width="189" tool_tip="How many avatars to fully render on screen. Lowering this greatly improves FPS in crowded situations. Requires Avatar Impostors to be on. [Default 35]"/>
<slider bottom_delta="-20" left="5" control_name="RenderMaxNodeSize"
decimal_digits="0" enabled="true" follows="left|bottom" height="20"
increment="64" label="Max Node:" can_edit_text="true"
label_width="53" max_val="16382" min_val="64" mouse_opaque="true"
label_width="53" max_val="16382" min_val="64" val_width="36" mouse_opaque="true"
name="RenderMaxNodeSize" show_text="true" width="189" tool_tip="Maximum memory size limit for rendering NEW objects, in Kb. Anything over the limit will not be rendered. [Default 4096]"/>
<text bottom_delta="-17" follows="left|top" font="SansSerifSmall" height="16" left="5"
name="cmd_line_text_7" width="189">