summaryrefslogtreecommitdiff
path: root/indra/llui/llsliderctrl.cpp
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-01-09 21:57:12 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-01-09 21:57:12 +0200
commit13c537e9a0f05857f89085b91ac098921c317fb1 (patch)
tree04a0f41d7be61c1456d8acbe681c3ae614dceb55 /indra/llui/llsliderctrl.cpp
parent3cb7eb639398db5f1828f6afb45e2313434b75f7 (diff)
SL-10279 Readjusting altitude slider
Diffstat (limited to 'indra/llui/llsliderctrl.cpp')
-rw-r--r--indra/llui/llsliderctrl.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp
index 0056cb6dc4..c3c3ce04f9 100644
--- a/indra/llui/llsliderctrl.cpp
+++ b/indra/llui/llsliderctrl.cpp
@@ -283,6 +283,31 @@ void LLSliderCtrl::updateText()
}
}
+void LLSliderCtrl::updateSliderRect()
+{
+ S32 right = getRect().getWidth();
+ S32 top = getRect().getHeight();
+ S32 bottom = 0;
+ S32 left = 0;
+ static LLUICachedControl<S32> sliderctrl_spacing("UISliderctrlSpacing", 0);
+ if (mEditor)
+ {
+ LLRect editor_rect = mEditor->getRect();
+ S32 editor_width = editor_rect.getWidth();
+ editor_rect.mRight = right;
+ editor_rect.mLeft = right - editor_width;
+ mEditor->setRect(editor_rect);
+
+ right -= editor_width + sliderctrl_spacing;
+ }
+ if (mLabelBox)
+ {
+ left += mLabelBox->getRect().getWidth() + sliderctrl_spacing;
+ }
+
+ mSlider->setRect(LLRect(left, top,right,bottom));
+}
+
// static
void LLSliderCtrl::onEditorCommit( LLUICtrl* ctrl, const LLSD& userdata )
{
@@ -404,6 +429,18 @@ void LLSliderCtrl::onCommit()
LLF32UICtrl::onCommit();
}
+void LLSliderCtrl::setRect(const LLRect& rect)
+{
+ LLF32UICtrl::setRect(rect);
+ updateSliderRect();
+}
+
+//virtual
+void LLSliderCtrl::reshape(S32 width, S32 height, BOOL called_from_parent)
+{
+ LLF32UICtrl::reshape(width, height, called_from_parent);
+ updateSliderRect();
+}
void LLSliderCtrl::setPrecision(S32 precision)
{