summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
authorJosh Bell <josh@lindenlab.com>2007-12-21 06:44:41 +0000
committerJosh Bell <josh@lindenlab.com>2007-12-21 06:44:41 +0000
commitdf4d167cd13fd89a85e4d30dca94e40c934707d7 (patch)
treecde9373bce657013bf04c83ab60b4a4aa826fc76 /indra/newview/llviewerwindow.cpp
parent8fde5f0d3241205067e5d7bf5380757e764eff31 (diff)
svn merge -r74200:76302 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-18-6-Viewer --> release
Wheee, this was fun. Um, let's back-port fixes a little more rapidly next time. Reviewed by CG until alexandria died, did the rest by my lonesome.
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp73
1 files changed, 60 insertions, 13 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 4c96083337..2a496f6698 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1849,16 +1849,6 @@ void LLViewerWindow::initWorldUI()
// keep onscreen
gFloaterView->adjustToFitScreen(gFloaterMap, FALSE);
-
- if (gSavedSettings.getBOOL("ShowCameraControls"))
- {
- LLFloaterCamera::show(NULL);
- }
-
- if (gSavedSettings.getBOOL("ShowMovementControls"))
- {
- LLFloaterMove::show(NULL);
- }
gIMMgr = LLIMMgr::getInstance();
@@ -2154,8 +2144,12 @@ void LLViewerWindow::setNormalControlsVisible( BOOL visible )
{
gMenuBarView->setVisible( visible );
gMenuBarView->setEnabled( visible );
+
+ // ...and set the menu color appropriately.
+ setMenuBackgroundColor(gAgent.getGodLevel() > GOD_NOT,
+ LLAppViewer::instance()->isInProductionGrid());
}
-
+
if ( gStatusBar )
{
gStatusBar->setVisible( visible );
@@ -2163,8 +2157,38 @@ void LLViewerWindow::setNormalControlsVisible( BOOL visible )
}
}
-
-
+void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid)
+{
+ LLString::format_map_t args;
+ LLColor4 new_bg_color;
+
+ if(god_mode && LLAppViewer::instance()->isInProductionGrid())
+ {
+ new_bg_color = gColors.getColor( "MenuBarGodBgColor" );
+ }
+ else if(god_mode && !LLAppViewer::instance()->isInProductionGrid())
+ {
+ new_bg_color = gColors.getColor( "MenuNonProductionGodBgColor" );
+ }
+ else if(!god_mode && !LLAppViewer::instance()->isInProductionGrid())
+ {
+ new_bg_color = gColors.getColor( "MenuNonProductionBgColor" );
+ }
+ else
+ {
+ new_bg_color = gColors.getColor( "MenuBarBgColor" );
+ }
+
+ if(gMenuBarView)
+ {
+ gMenuBarView->setBackgroundColor( new_bg_color );
+ }
+
+ if(gStatusBar)
+ {
+ gStatusBar->setBackgroundColor( new_bg_color );
+ }
+}
void LLViewerWindow::drawDebugText()
{
@@ -2369,6 +2393,18 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
toggle_debug_menus(NULL);
}
+ // Explicit hack for debug menu.
+ if ((mask == (MASK_SHIFT | MASK_CONTROL)) &&
+ ('G' == key || 'g' == key))
+ {
+ if (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) //on splash page
+ {
+ BOOL visible = ! gSavedSettings.getBOOL("ForceShowGrid");
+ gSavedSettings.setBOOL("ForceShowGrid", visible);
+ LLPanelLogin::loadLoginPage();
+ }
+ }
+
// Example "bug" for bug reporter web page
if ((MASK_SHIFT & mask)
&& (MASK_ALT & mask)
@@ -2410,6 +2446,11 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
{
return TRUE;
}
+ // let menus handle navigation keys
+ if (gLoginMenuBarView && gLoginMenuBarView->handleKey(key, mask, TRUE))
+ {
+ return TRUE;
+ }
// Traverses up the hierarchy
LLUICtrl* keyboard_focus = gFocusMgr.getKeyboardFocus();
@@ -2515,6 +2556,12 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
{
return TRUE;
}
+
+ // give menus a chance to handle keys
+ if (gLoginMenuBarView && gLoginMenuBarView->handleAcceleratorKey(key, mask))
+ {
+ return TRUE;
+ }
// don't pass keys on to world when something in ui has focus
return gFocusMgr.childHasKeyboardFocus(mRootView)