diff options
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/CMakeLists.txt | 6 | ||||
-rw-r--r-- | indra/llui/llmenubutton.cpp | 11 | ||||
-rw-r--r-- | indra/llui/llmenubutton.h | 21 | ||||
-rw-r--r-- | indra/llui/llview.cpp | 18 |
4 files changed, 38 insertions, 18 deletions
diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 673494820f..b3b2f4ae56 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -29,7 +29,7 @@ set(llui_SOURCE_FILES llaccordionctrl.cpp llaccordionctrltab.cpp llbadge.cpp - llbadgeholder.cpp + llbadgeholder.cpp llbadgeowner.cpp llbutton.cpp llcheckboxctrl.cpp @@ -124,7 +124,7 @@ set(llui_HEADER_FILES llaccordionctrl.h llaccordionctrltab.h llbadge.h - llbadgeholder.h + llbadgeholder.h llbadgeowner.h llbutton.h llcallbackmap.h @@ -167,7 +167,7 @@ set(llui_HEADER_FILES llnotificationslistener.h llnotificationsutil.h llnotificationtemplate.h - llnotificationvisibilityrule.h + llnotificationvisibilityrule.h llpanel.h llprogressbar.h llradiogroup.h diff --git a/indra/llui/llmenubutton.cpp b/indra/llui/llmenubutton.cpp index eed0085273..50d59f79f4 100644 --- a/indra/llui/llmenubutton.cpp +++ b/indra/llui/llmenubutton.cpp @@ -35,9 +35,16 @@ static LLDefaultChildRegistry::Register<LLMenuButton> r("menu_button"); +void LLMenuButton::MenuPositions::declareValues() +{ + declare("topleft", MP_TOP_LEFT); + declare("topright", MP_TOP_RIGHT); + declare("bottomleft", MP_BOTTOM_LEFT); +} LLMenuButton::Params::Params() -: menu_filename("menu_filename") +: menu_filename("menu_filename"), + position("position", MP_BOTTOM_LEFT) { } @@ -45,7 +52,7 @@ LLMenuButton::Params::Params() LLMenuButton::LLMenuButton(const LLMenuButton::Params& p) : LLButton(p), mIsMenuShown(false), - mMenuPosition(MP_BOTTOM_LEFT) + mMenuPosition(p.position) { std::string menu_filename = p.menu_filename; diff --git a/indra/llui/llmenubutton.h b/indra/llui/llmenubutton.h index 7b657595da..e2396e7fb2 100644 --- a/indra/llui/llmenubutton.h +++ b/indra/llui/llmenubutton.h @@ -35,21 +35,30 @@ class LLMenuButton : public LLButton { public: + typedef enum e_menu_position + { + MP_TOP_LEFT, + MP_TOP_RIGHT, + MP_BOTTOM_LEFT + } EMenuPosition; + + struct MenuPositions + : public LLInitParam::TypeValuesHelper<EMenuPosition, MenuPositions> + { + static void declareValues(); + }; + struct Params : public LLInitParam::Block<Params, LLButton::Params> { // filename for it's toggleable menu Optional<std::string> menu_filename; + Optional<EMenuPosition> position; Params(); }; - typedef enum e_menu_position - { - MP_TOP_LEFT, - MP_TOP_RIGHT, - MP_BOTTOM_LEFT - } EMenuPosition; + boost::signals2::connection setMouseDownCallback( const mouse_signal_t::slot_type& cb ); diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 8803d106ba..659a54cc6e 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1655,15 +1655,19 @@ BOOL LLView::hasAncestor(const LLView* parentp) const BOOL LLView::childHasKeyboardFocus( const std::string& childname ) const { - LLView *child = findChildView(childname, TRUE); - if (child) - { - return gFocusMgr.childHasKeyboardFocus(child); - } - else + LLView *focus = dynamic_cast<LLView *>(gFocusMgr.getKeyboardFocus()); + + while (focus != NULL) { - return FALSE; + if (focus->getName() == childname) + { + return TRUE; + } + + focus = focus->getParent(); } + + return FALSE; } //----------------------------------------------------------------------------- |