diff options
author | Nicky <nicky.dasmijn@posteo.nl> | 2024-08-03 14:30:06 +0200 |
---|---|---|
committer | Nicky <nicky.dasmijn@posteo.nl> | 2024-08-03 14:30:06 +0200 |
commit | 04c47b95323a8022785e58fec03c14769ddfa6af (patch) | |
tree | 2e781e03d8af6bc231f9340b1e289234c363ff20 /indra/llui/llscrollbar.cpp | |
parent | f480075e1ffbcc026843a3d14fd6533aad1e7126 (diff) | |
parent | 2ee039c736f64c91bb4f16e403360cddb0089707 (diff) |
Merge remote-tracking branch 'll/marchcat/b-develop' into feature/warning_cleansweep
Diffstat (limited to 'indra/llui/llscrollbar.cpp')
-rw-r--r-- | indra/llui/llscrollbar.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index 9c73b1ba3f..d0eec387bd 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -113,7 +113,8 @@ LLScrollbar::LLScrollbar(const Params & p) up_btn.tab_stop(false); up_btn.follows.flags = (mOrientation == VERTICAL ? (FOLLOWS_RIGHT | FOLLOWS_TOP) : (FOLLOWS_LEFT | FOLLOWS_BOTTOM)); - addChild(LLUICtrlFactory::create<LLButton>(up_btn)); + mLineUpBtn = LLUICtrlFactory::create<LLButton>(up_btn); + addChild(mLineUpBtn); LLButton::Params down_btn(mOrientation == VERTICAL ? p.down_button : p.right_button); down_btn.name(std::string("Line Down")); @@ -123,7 +124,8 @@ LLScrollbar::LLScrollbar(const Params & p) down_btn.mouse_held_callback.function(boost::bind(&LLScrollbar::onLineDownBtnPressed, this, _2)); down_btn.tab_stop(false); - addChild(LLUICtrlFactory::create<LLButton>(down_btn)); + mLineDownBtn = LLUICtrlFactory::create<LLButton>(down_btn); + addChild(mLineDownBtn); } @@ -468,22 +470,20 @@ void LLScrollbar::reshape(S32 width, S32 height, bool called_from_parent) { if (width == getRect().getWidth() && height == getRect().getHeight()) return; LLView::reshape( width, height, called_from_parent ); - LLButton* up_button = getChild<LLButton>("Line Up"); - LLButton* down_button = getChild<LLButton>("Line Down"); if (mOrientation == VERTICAL) { - up_button->reshape(up_button->getRect().getWidth(), llmin(getRect().getHeight() / 2, mThickness)); - down_button->reshape(down_button->getRect().getWidth(), llmin(getRect().getHeight() / 2, mThickness)); - up_button->setOrigin(0, getRect().getHeight() - up_button->getRect().getHeight()); - down_button->setOrigin(0, 0); + mLineUpBtn->reshape(mLineUpBtn->getRect().getWidth(), llmin(getRect().getHeight() / 2, mThickness)); + mLineDownBtn->reshape(mLineDownBtn->getRect().getWidth(), llmin(getRect().getHeight() / 2, mThickness)); + mLineUpBtn->setOrigin(0, getRect().getHeight() - mLineUpBtn->getRect().getHeight()); + mLineDownBtn->setOrigin(0, 0); } else { - up_button->reshape(llmin(getRect().getWidth() / 2, mThickness), up_button->getRect().getHeight()); - down_button->reshape(llmin(getRect().getWidth() / 2, mThickness), down_button->getRect().getHeight()); - up_button->setOrigin(0, 0); - down_button->setOrigin(getRect().getWidth() - down_button->getRect().getWidth(), 0); + mLineUpBtn->reshape(llmin(getRect().getWidth() / 2, mThickness), mLineUpBtn->getRect().getHeight()); + mLineDownBtn->reshape(llmin(getRect().getWidth() / 2, mThickness), mLineDownBtn->getRect().getHeight()); + mLineUpBtn->setOrigin(0, 0); + mLineDownBtn->setOrigin(getRect().getWidth() - mLineDownBtn->getRect().getWidth(), 0); } updateThumbRect(); } |