diff options
author | Andrew Polunin <apolunin@productengine.com> | 2010-06-18 15:58:00 +0300 |
---|---|---|
committer | Andrew Polunin <apolunin@productengine.com> | 2010-06-18 15:58:00 +0300 |
commit | 2c5af9672c8b531762475c752dd1904a4024ff67 (patch) | |
tree | e97f3a00fe526e65d7ed44bf264afd39486b408c /indra/newview/llviewermenu.cpp | |
parent | a8276dfd5998a7ef86668d7a8e3f9e8a7d124801 (diff) |
EXT-5808 FIXED Added another context menu. Also Navigation Bar and Mini-Location bar are mutually exclusive now
- Implemented context menu for Mini-Location bar (menu_topinfobar.xml)
- Implemented function show_topinfobar_context_menu() (in llviewermenu.h) which displays context menu for Mini-Location bar.
- Functions toggle_show_navigation_panel() and toggle_show_mini_location_panel() modified so that Navigation Bar and Mini-Location bar are mutually exclusive (when the former is visible the latter is hidden and vice versa).
- Implemented method LLPanelTopInfoBar::onContextMenuItemClicked which handles \"landmark\" and \"copy\" Mini-Location bar context menu actions.
Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/607/
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 36650af6cb..635cc361f3 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7693,6 +7693,31 @@ void show_navbar_context_menu(LLView* ctrl, S32 x, S32 y) LLMenuGL::showPopup(ctrl, show_navbar_context_menu, x, y); } +void show_topinfobar_context_menu(LLView* ctrl, S32 x, S32 y) +{ + static LLMenuGL* show_topbarinfo_context_menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_topinfobar.xml", + gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + + LLMenuItemGL* landmark_item = show_topbarinfo_context_menu->getChild<LLMenuItemGL>("Landmark"); + if (!LLLandmarkActions::landmarkAlreadyExists()) + { + landmark_item->setLabel(LLTrans::getString("AddLandmarkNavBarMenu")); + } + else + { + landmark_item->setLabel(LLTrans::getString("EditLandmarkNavBarMenu")); + } + + if(gMenuHolder->hasVisibleMenu()) + { + gMenuHolder->hideMenus(); + } + + show_topbarinfo_context_menu->buildDrawLabels(); + show_topbarinfo_context_menu->updateParent(LLMenuGL::sMenuContainer); + LLMenuGL::showPopup(ctrl, show_topbarinfo_context_menu, x, y); +} + void initialize_edit_menu() { view_listener_t::addMenu(new LLEditUndo(), "Edit.Undo"); |