Make the viewer lighter by one or two BOOLs per slider!
This commit is contained in:
@@ -54,7 +54,6 @@ LLSlider::LLSlider(
|
||||
F32 min_value,
|
||||
F32 max_value,
|
||||
F32 increment,
|
||||
BOOL volume,
|
||||
const std::string& control_name)
|
||||
:
|
||||
LLUICtrl( name, rect, TRUE, commit_callback,
|
||||
@@ -64,7 +63,6 @@ LLSlider::LLSlider(
|
||||
mMinValue( min_value ),
|
||||
mMaxValue( max_value ),
|
||||
mIncrement( increment ),
|
||||
mVolumeSlider( volume ),
|
||||
mMouseOffset( 0 ),
|
||||
mTrackColor( LLUI::sColorsGroup->getColor( "SliderTrackColor" ) ),
|
||||
mThumbOutlineColor( LLUI::sColorsGroup->getColor( "SliderThumbOutlineColor" ) ),
|
||||
@@ -317,20 +315,11 @@ LLXMLNodePtr LLSlider::getXML(bool save_children) const
|
||||
{
|
||||
LLXMLNodePtr node = LLUICtrl::getXML();
|
||||
|
||||
if (mVolumeSlider)
|
||||
{
|
||||
node->setName(LL_VOLUME_SLIDER_CTRL_TAG);
|
||||
}
|
||||
else
|
||||
{
|
||||
node->setName(LL_SLIDER_TAG);
|
||||
}
|
||||
|
||||
node->setName(LL_SLIDER_TAG);
|
||||
node->createChild("initial_val", TRUE)->setFloatValue(getInitialValue());
|
||||
node->createChild("min_val", TRUE)->setFloatValue(getMinValue());
|
||||
node->createChild("max_val", TRUE)->setFloatValue(getMaxValue());
|
||||
node->createChild("increment", TRUE)->setFloatValue(getIncrement());
|
||||
node->createChild("volume", TRUE)->setBoolValue(mVolumeSlider);
|
||||
|
||||
return node;
|
||||
}
|
||||
@@ -365,17 +354,13 @@ LLView* LLSlider::fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFacto
|
||||
F32 increment = 0.1f;
|
||||
node->getAttributeF32("increment", increment);
|
||||
|
||||
BOOL volume = node->hasName("volume_slider") ? TRUE : FALSE;
|
||||
node->getAttributeBOOL("volume", volume);
|
||||
|
||||
LLSlider* slider = new LLSlider("slider_bar",
|
||||
rect,
|
||||
NULL,
|
||||
initial_value,
|
||||
min_value,
|
||||
max_value,
|
||||
increment,
|
||||
volume);
|
||||
increment);
|
||||
|
||||
slider->initFromXML(node, parent);
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ public:
|
||||
F32 min_value,
|
||||
F32 max_value,
|
||||
F32 increment,
|
||||
BOOL volume, //TODO: create a "volume" slider sub-class or just use image art, no? -MG
|
||||
const std::string& control_name = LLStringUtil::null );
|
||||
|
||||
virtual LLXMLNodePtr getXML(bool save_children = true) const;
|
||||
@@ -92,7 +91,6 @@ private:
|
||||
F32 mMaxValue;
|
||||
F32 mIncrement;
|
||||
|
||||
BOOL mVolumeSlider;
|
||||
S32 mMouseOffset;
|
||||
LLRect mDragStartThumbRect;
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@ LLSliderCtrl::LLSliderCtrl(const std::string& name, const LLRect& rect,
|
||||
S32 text_left,
|
||||
BOOL show_text,
|
||||
BOOL can_edit_text,
|
||||
BOOL volume,
|
||||
commit_callback_t commit_callback,
|
||||
F32 initial_value, F32 min_value, F32 max_value, F32 increment,
|
||||
const std::string& control_which)
|
||||
@@ -67,7 +66,6 @@ LLSliderCtrl::LLSliderCtrl(const std::string& name, const LLRect& rect,
|
||||
mFont(font),
|
||||
mShowText( show_text ),
|
||||
mCanEditText( can_edit_text ),
|
||||
mVolumeSlider( volume ),
|
||||
mPrecision( 3 ),
|
||||
mLabelBox( NULL ),
|
||||
mLabelWidth( label_width ),
|
||||
@@ -105,7 +103,7 @@ LLSliderCtrl::LLSliderCtrl(const std::string& name, const LLRect& rect,
|
||||
mSlider = new LLSlider(std::string("slider"),
|
||||
slider_rect,
|
||||
boost::bind(&LLSliderCtrl::onSliderCommit,_1,_2),
|
||||
initial_value, min_value, max_value, increment, volume,
|
||||
initial_value, min_value, max_value, increment,
|
||||
control_which );
|
||||
addChild( mSlider );
|
||||
|
||||
@@ -387,8 +385,6 @@ LLXMLNodePtr LLSliderCtrl::getXML(bool save_children) const
|
||||
node->createChild("show_text", TRUE)->setBoolValue(mShowText);
|
||||
|
||||
node->createChild("can_edit_text", TRUE)->setBoolValue(mCanEditText);
|
||||
|
||||
node->createChild("volume", TRUE)->setBoolValue(mVolumeSlider);
|
||||
|
||||
node->createChild("decimal_digits", TRUE)->setIntValue(mPrecision);
|
||||
|
||||
@@ -438,9 +434,6 @@ LLView* LLSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
|
||||
BOOL can_edit_text = FALSE;
|
||||
node->getAttributeBOOL("can_edit_text", can_edit_text);
|
||||
|
||||
BOOL volume = FALSE;
|
||||
node->getAttributeBOOL("volume", volume);
|
||||
|
||||
F32 initial_value = 0.f;
|
||||
node->getAttributeF32("initial_val", initial_value);
|
||||
|
||||
@@ -497,7 +490,6 @@ LLView* LLSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
|
||||
rect.getWidth() - text_left,
|
||||
show_text,
|
||||
can_edit_text,
|
||||
volume,
|
||||
NULL,
|
||||
initial_value,
|
||||
min_value,
|
||||
|
||||
@@ -57,7 +57,6 @@ public:
|
||||
S32 text_left,
|
||||
BOOL show_text,
|
||||
BOOL can_edit_text,
|
||||
BOOL volume, //TODO: create a "volume" slider sub-class or just use image art, no? -MG
|
||||
commit_callback_t commit_callback,
|
||||
F32 initial_value, F32 min_value, F32 max_value, F32 increment,
|
||||
const std::string& control_which = LLStringUtil::null );
|
||||
@@ -125,8 +124,7 @@ private:
|
||||
const LLFontGL* mFont;
|
||||
BOOL mShowText;
|
||||
BOOL mCanEditText;
|
||||
BOOL mVolumeSlider;
|
||||
|
||||
|
||||
S32 mPrecision;
|
||||
LLTextBox* mLabelBox;
|
||||
S32 mLabelWidth;
|
||||
|
||||
@@ -56,25 +56,25 @@ LLDebugVarMessageBox::LLDebugVarMessageBox(const std::string& title, EDebugVarTy
|
||||
switch(var_type)
|
||||
{
|
||||
case VAR_TYPE_F32:
|
||||
mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,130,190,110), title, NULL, 70, 130, TRUE, TRUE, FALSE, NULL, *((F32*)var), -100.f, 100.f, 0.1f, LLStringUtil::null);
|
||||
mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,130,190,110), title, NULL, 70, 130, TRUE, TRUE, NULL, *((F32*)var), -100.f, 100.f, 0.1f, LLStringUtil::null);
|
||||
mSlider1->setPrecision(3);
|
||||
addChild(mSlider1);
|
||||
mSlider2 = NULL;
|
||||
mSlider3 = NULL;
|
||||
break;
|
||||
case VAR_TYPE_S32:
|
||||
mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,100,190,80), title, NULL, 70, 130, TRUE, TRUE, FALSE, NULL, (F32)*((S32*)var), -255.f, 255.f, 1.f, LLStringUtil::null);
|
||||
mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,100,190,80), title, NULL, 70, 130, TRUE, TRUE, NULL, (F32)*((S32*)var), -255.f, 255.f, 1.f, LLStringUtil::null);
|
||||
mSlider1->setPrecision(0);
|
||||
addChild(mSlider1);
|
||||
mSlider2 = NULL;
|
||||
mSlider3 = NULL;
|
||||
break;
|
||||
case VAR_TYPE_VEC3:
|
||||
mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,130,190,110), std::string("x: "), NULL, 70, 130, TRUE, TRUE, FALSE, NULL, ((LLVector3*)var)->mV[VX], -100.f, 100.f, 0.1f, LLStringUtil::null);
|
||||
mSlider1 = new LLSliderCtrl(std::string("slider 1"), LLRect(20,130,190,110), std::string("x: "), NULL, 70, 130, TRUE, TRUE, NULL, ((LLVector3*)var)->mV[VX], -100.f, 100.f, 0.1f, LLStringUtil::null);
|
||||
mSlider1->setPrecision(3);
|
||||
mSlider2 = new LLSliderCtrl(std::string("slider 2"), LLRect(20,100,190,80), std::string("y: "), NULL, 70, 130, TRUE, TRUE, FALSE, NULL, ((LLVector3*)var)->mV[VY], -100.f, 100.f, 0.1f, LLStringUtil::null);
|
||||
mSlider2 = new LLSliderCtrl(std::string("slider 2"), LLRect(20,100,190,80), std::string("y: "), NULL, 70, 130, TRUE, TRUE, NULL, ((LLVector3*)var)->mV[VY], -100.f, 100.f, 0.1f, LLStringUtil::null);
|
||||
mSlider2->setPrecision(3);
|
||||
mSlider3 = new LLSliderCtrl(std::string("slider 3"), LLRect(20,70,190,50), std::string("z: "), NULL, 70, 130, TRUE, TRUE, FALSE, NULL, ((LLVector3*)var)->mV[VZ], -100.f, 100.f, 0.1f, LLStringUtil::null);
|
||||
mSlider3 = new LLSliderCtrl(std::string("slider 3"), LLRect(20,70,190,50), std::string("z: "), NULL, 70, 130, TRUE, TRUE, NULL, ((LLVector3*)var)->mV[VZ], -100.f, 100.f, 0.1f, LLStringUtil::null);
|
||||
mSlider3->setPrecision(3);
|
||||
addChild(mSlider1);
|
||||
addChild(mSlider2);
|
||||
|
||||
Reference in New Issue
Block a user