summaryrefslogtreecommitdiff
path: root/indra/newview/llstatusbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llstatusbar.cpp')
-rw-r--r--indra/newview/llstatusbar.cpp75
1 files changed, 72 insertions, 3 deletions
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index bc90fe7adc..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()
@@ -479,9 +504,11 @@ void LLStatusBar::creditBalance(S32 credit)
void LLStatusBar::setBalance(S32 balance)
{
std::string money_str = LLResMgr::getInstance()->getMonetaryString( balance );
- std::string balance_str = "L$";
- balance_str += money_str;
- mBtnBuyCurrency->setLabel( balance_str );
+
+ LLStringUtil::format_map_t string_args;
+ string_args["[AMT]"] = llformat("%s", money_str.c_str());
+ std::string labe_str = getString("buycurrencylabel", string_args);
+ mBtnBuyCurrency->setLabel(labe_str);
// Resize the balance button so that the label fits it, and the button expands to the left.
// *TODO: LLButton should have an option where to expand.
@@ -714,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)
{