summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llmenugl.cpp4
-rw-r--r--indra/llui/llmenugl.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 4edae46f32..d6dfe6c198 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -1642,6 +1642,7 @@ LLMenuGL::LLMenuGL(const LLMenuGL::Params& p)
mHorizontalLayout( p.horizontal_layout ),
mScrollable(mHorizontalLayout ? FALSE : p.scrollable), // Scrolling is supported only for vertical layout
mMaxScrollableItems(p.max_scrollable_items),
+ mPreferredWidth(p.preferred_width),
mKeepFixedSize( p.keep_fixed_size ),
mLabel (p.label),
mLastMouseX(0),
@@ -2025,6 +2026,9 @@ void LLMenuGL::arrange( void )
}
}
+ if (mPreferredWidth < U32_MAX)
+ width = llmin(mPreferredWidth, max_width);
+
if (mScrollable)
{
S32 max_items_height = max_height - spillover_item_height * 2;
diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h
index 44459a6c0e..0bf6301f93 100644
--- a/indra/llui/llmenugl.h
+++ b/indra/llui/llmenugl.h
@@ -383,6 +383,7 @@ public:
keep_fixed_size,
scrollable;
Optional<U32> max_scrollable_items;
+ Optional<U32> preferred_width;
Optional<LLUIColor> bg_color;
Optional<S32> shortcut_pad;
@@ -396,7 +397,9 @@ public:
bg_color("bg_color", LLUIColorTable::instance().getColor( "MenuDefaultBgColor" )),
scrollable("scrollable", false),
max_scrollable_items("max_scrollable_items", U32_MAX),
+ preferred_width("preferred_width", U32_MAX),
shortcut_pad("shortcut_pad")
+
{
addSynonym(bg_visible, "opaque");
addSynonym(bg_color, "color");
@@ -544,6 +547,7 @@ protected:
S32 mMouseVelX;
S32 mMouseVelY;
U32 mMaxScrollableItems;
+ U32 mPreferredWidth;
BOOL mHorizontalLayout;
BOOL mScrollable;
BOOL mKeepFixedSize;