diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-04-26 21:57:40 +0300 |
|---|---|---|
| committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-04-26 21:57:40 +0300 |
| commit | a0d7d873552dc1611eb4f8957cf99e777b199dbe (patch) | |
| tree | 4d2bff47d6d7bd253076473c85f43f17eedbc12c /indra/llui/llsliderctrl.cpp | |
| parent | 2ea5c5986a467e253ad0131b4af0faee23b263a4 (diff) | |
| parent | d7f1c88c35849e56f5b352f13c16a08467d1533b (diff) | |
Merge branch 'master' into DRTVWR-460
# Conflicts:
# indra/llmath/llquaternion.h
# indra/newview/lldrawpoolwater.cpp
# indra/newview/lljoystickbutton.cpp
# indra/newview/llvosky.cpp
# indra/newview/skins/default/textures/textures.xml
Diffstat (limited to 'indra/llui/llsliderctrl.cpp')
| -rw-r--r-- | indra/llui/llsliderctrl.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp index 0056cb6dc4..3b89a8ca63 100644 --- a/indra/llui/llsliderctrl.cpp +++ b/indra/llui/llsliderctrl.cpp @@ -283,6 +283,35 @@ 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 (mTextBox) + { + right -= mTextBox->getRect().getWidth() + 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 +433,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) { |
