diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-08-12 01:12:27 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-08-12 01:12:27 +0000 |
commit | 0bf4b5f2222ffb8171be094613363427f3b8470a (patch) | |
tree | 4b742d6815f44a85c98113e9c5a3017eafc5968d /indra/newview/llstatusbar.cpp | |
parent | 8d7e56f219d0915e2c4a19baf2809dbc6ede7fa5 (diff) |
merge https://svn.aws.productengine.com/secondlife/export-from-ll@1277 https://svn.aws.productengine.com/secondlife/pe/stable-1@1297 -> viewer-2-0
Fixes:
EXT 208 EXT 366 EXT-211 EXT-245 EXT-246 EXT-278 EXT-279 EXT-280 EXT-298 EXT-301 EXT-304 EXT-311 EXT-317 EXT-318 EXT-319 EXT-339 EXT-343 EXT-344 EXT-346 EXT-349 EXT-350 EXT-351 EXT-354 EXT-355 EXT-358 EXT-360 EXT-362 EXT-369 EXT-372 EXT-374 EXT-381 EXT-382 EXT-383 EXT-395 EXT-396 EXT-412
Other changes:
Movement & Caemra controls work
Profile and Me panel refactoring
Notification refactoring
Diffstat (limited to 'indra/newview/llstatusbar.cpp')
-rw-r--r-- | indra/newview/llstatusbar.cpp | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 12fb811328..569e7b3397 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -48,6 +48,7 @@ #include "llfloaterscriptdebug.h" #include "llhudicon.h" #include "llfloaterinventory.h" +#include "llnavigationbar.h" #include "llkeyboard.h" #include "lllineeditor.h" #include "llmenugl.h" @@ -244,6 +245,30 @@ void LLStatusBar::draw() LLPanel::draw(); } +BOOL LLStatusBar::handleRightMouseUp(S32 x, S32 y, MASK mask) +{ + if (mHideNavbarContextMenu) + { + mHideNavbarContextMenu->buildDrawLabels(); + mHideNavbarContextMenu->updateParent(LLMenuGL::sMenuContainer); + LLMenuGL::showPopup(this, mHideNavbarContextMenu, x, y); + } + + return TRUE; +} + +BOOL LLStatusBar::postBuild() +{ + mCommitCallbackRegistrar.add("HideNavbarMenu.Action", boost::bind(&LLStatusBar::onHideNavbarContextMenuItemClicked, this, _2)); + mEnableCallbackRegistrar.add("HideNavbarMenu.EnableMenuItem", boost::bind(&LLStatusBar::onHideNavbarContextMenuItemEnabled, this, _2)); + + mHideNavbarContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_hide_navbar.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + gMenuHolder->addChild(mHideNavbarContextMenu); + + gMenuBarView->setRightClickedCallback(boost::bind(&LLStatusBar::onMainMenuRightClicked, this, _1, _2, _3, _4)); + + return TRUE; +} // Per-frame updates of visibility void LLStatusBar::refresh() @@ -716,6 +741,48 @@ void LLStatusBar::setupDate() } } +bool LLStatusBar::onHideNavbarContextMenuItemEnabled(const LLSD& userdata) +{ + std::string item = userdata.asString(); + + if (item == "show_navbar_navigation_panel") + { + return gSavedSettings.getBOOL("ShowNavbarNavigationPanel"); + } + else if (item == "show_navbar_favorites_panel") + { + return gSavedSettings.getBOOL("ShowNavbarFavoritesPanel"); + } + + return FALSE; +} + +void LLStatusBar::onHideNavbarContextMenuItemClicked(const LLSD& userdata) +{ + std::string item = userdata.asString(); + + if (item == "show_navbar_navigation_panel") + { + BOOL state = !gSavedSettings.getBOOL("ShowNavbarNavigationPanel"); + + LLNavigationBar::getInstance()->showNavigationPanel(state); + gSavedSettings.setBOOL("ShowNavbarNavigationPanel", state); + } + else if (item == "show_navbar_favorites_panel") + { + BOOL state = !gSavedSettings.getBOOL("ShowNavbarFavoritesPanel"); + + LLNavigationBar::getInstance()->showFavoritesPanel(state); + gSavedSettings.setBOOL("ShowNavbarFavoritesPanel", state); + } +} + + +void LLStatusBar::onMainMenuRightClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask) +{ + handleRightMouseUp(x, y, mask); +} + // static void LLStatusBar::onCommitSearch(LLUICtrl*, void* data) { |