diff options
| author | Jonathan "Geenz" Goodman <geenz@lindenlab.com> | 2026-10-13 14:30:21 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-13 14:30:21 -0400 |
| commit | 8ba5d1a8adc47c21b23d9482e72de9517f9a98fc (patch) | |
| tree | f97d67c8ee574c6ebaac8d0d8ba120d041dca051 /indra/llui/llflyoutbutton.cpp | |
| parent | 18648fc51e2a0c750182d8aa3814ed5b6bf8445e (diff) | |
| parent | efc7d2d7bb542ac905cb7ebd82ee329523f95608 (diff) | |
Merge pull request #6193 from secondlife/release/26.4
Release/26.4
Diffstat (limited to 'indra/llui/llflyoutbutton.cpp')
| -rw-r--r-- | indra/llui/llflyoutbutton.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/indra/llui/llflyoutbutton.cpp b/indra/llui/llflyoutbutton.cpp index 2e198e8dbc..9d511bcf87 100644 --- a/indra/llui/llflyoutbutton.cpp +++ b/indra/llui/llflyoutbutton.cpp @@ -31,7 +31,7 @@ //static LLDefaultChildRegistry::Register<LLFlyoutButton> r2("flyout_button"); -const S32 FLYOUT_BUTTON_ARROW_WIDTH = 24; +constexpr S32 FLYOUT_BUTTON_ARROW_WIDTH = 22; LLFlyoutButton::LLFlyoutButton(const Params& p) : LLComboBox(p), @@ -43,9 +43,13 @@ LLFlyoutButton::LLFlyoutButton(const Params& p) LLButton::Params bp(p.action_button); bp.name(p.label); bp.label(p.label); - bp.rect.left(0).bottom(0).width(getRect().getWidth() - FLYOUT_BUTTON_ARROW_WIDTH).height(getRect().getHeight()); + bp.rect.left(0).bottom(0).width(getRect().getWidth() - FLYOUT_BUTTON_ARROW_WIDTH - 2 * BTN_DROP_SHADOW).height(getRect().getHeight()); bp.click_callback.function(boost::bind(&LLFlyoutButton::onActionButtonClick, this, _2)); bp.follows.flags(FOLLOWS_ALL); + if (p.font.isProvided()) + { + bp.font(p.font); + } mActionButton = LLUICtrlFactory::create<LLButton>(bp); addChild(mActionButton); @@ -74,4 +78,16 @@ void LLFlyoutButton::setToggleState(bool state) mToggleState = state; } +bool LLFlyoutButton::postBuild() +{ + bool result = LLComboBox::postBuild(); + + LLRect rect = getLocalRect(); + S32 arrow_width = llmax(FLYOUT_BUTTON_ARROW_WIDTH, mArrowImage ? mArrowImage->getWidth() : 0); + mButton->setRect(LLRect(getRect().getWidth() - llmax(8, arrow_width) - 2 * BTN_DROP_SHADOW, + rect.mTop, rect.mRight, rect.mBottom)); + mButton->setFollows(FOLLOWS_BOTTOM | FOLLOWS_TOP | FOLLOWS_RIGHT); + + return result; +} |
