summaryrefslogtreecommitdiff
path: root/indra/llui/llflyoutbutton.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2026-09-01 18:35:23 +0800
committerErik Kundiman <erik@megapahit.org>2026-09-04 21:58:53 +0800
commit00bb3bb6f07660bd914d29a1389342bb3060d254 (patch)
tree431f574922494d2201718f13085f17bc6bd7fb42 /indra/llui/llflyoutbutton.cpp
parenta8636720129952c10cf49ab80da21bf8b340b96c (diff)
parent4ef9f8f14b35ed388c294d53767a0dca0e890924 (diff)
Merge remote-tracking branch 'secondlife/release/26.4' into 26.4
Diffstat (limited to 'indra/llui/llflyoutbutton.cpp')
-rw-r--r--indra/llui/llflyoutbutton.cpp20
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;
+}