summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llmenugl.cpp8
-rw-r--r--indra/llui/llpanel.cpp2
-rw-r--r--indra/llui/llview.cpp3
-rw-r--r--indra/llui/llview.h3
4 files changed, 13 insertions, 3 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 87f01cf44f..67993988fe 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -2596,6 +2596,7 @@ LLMenuItemGL* LLMenuGL::getHighlightedItem()
LLMenuItemGL* LLMenuGL::highlightNextItem(LLMenuItemGL* cur_item, BOOL skip_disabled)
{
+ if (mItems.empty()) return NULL;
// highlighting first item on a torn off menu is the
// same as giving focus to it
if (!cur_item && getTornOff())
@@ -2674,6 +2675,8 @@ LLMenuItemGL* LLMenuGL::highlightNextItem(LLMenuItemGL* cur_item, BOOL skip_disa
LLMenuItemGL* LLMenuGL::highlightPrevItem(LLMenuItemGL* cur_item, BOOL skip_disabled)
{
+ if (mItems.empty()) return NULL;
+
// highlighting first item on a torn off menu is the
// same as giving focus to it
if (!cur_item && getTornOff())
@@ -2986,6 +2989,11 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
const S32 CURSOR_HEIGHT = 22; // Approximate "normal" cursor size
const S32 CURSOR_WIDTH = 12;
+ if(menu->getChildList()->empty())
+ {
+ return;
+ }
+
// Save click point for detecting cursor moves before mouse-up.
// Must be in local coords to compare with mouseUp events.
// If the mouse doesn't move, the menu will stay open ala the Mac.
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index c8e56630f1..d0aba2733f 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -434,7 +434,7 @@ void LLPanel::initFromParams(const LLPanel::Params& p)
//and LLView::initFromParams will use them to set visible and enabled
setVisible(p.visible);
setEnabled(p.enabled);
-
+ setFocusRoot(p.focus_root);
setSoundFlags(p.sound_flags);
// control_name, tab_stop, focus_lost_callback, initial_value, rect, enabled, visible
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 6ac009956d..267640a226 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -102,6 +102,7 @@ LLView::Params::Params()
left_pad("left_pad"),
left_delta("left_delta", S32_MAX),
from_xui("from_xui", false),
+ focus_root("focus_root", false),
needs_translate("translate"),
xmlns("xmlns"),
xmlns_xsi("xmlns:xsi"),
@@ -117,7 +118,7 @@ LLView::LLView(const LLView::Params& p)
mParentView(NULL),
mReshapeFlags(FOLLOWS_NONE),
mFromXUI(p.from_xui),
- mIsFocusRoot(FALSE),
+ mIsFocusRoot(p.focus_root),
mLastVisible(FALSE),
mNextInsertionOrdinal(0),
mHoverCursor(getCursorFromString(p.hover_cursor)),
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index e6e0a41962..654e99563e 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -116,7 +116,8 @@ public:
visible,
mouse_opaque,
use_bounding_rect,
- from_xui;
+ from_xui,
+ focus_root;
Optional<S32> tab_group,
default_tab_group;