diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7de4f4289a..27bcddc447 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -14,6 +14,17 @@ Value 1 + AutohideChatBar + + Comment + Hide the chat bar from the bottom button bar and only show it as an overlay when needed. + Persist + 1 + Type + Boolean + Value + 0 + GridListDownload Comment diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index e25c8a61c3..63d62b121b 100755 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -201,10 +201,7 @@ public: void onFocusLost() { - if (gAgentCamera.cameraMouselook()) - { - LLBottomTray::getInstance()->setVisible(FALSE); - } + setVisible(FALSE); } LLNearbyChatBar* mNearbyChatBar; @@ -225,6 +222,7 @@ LLBottomTray::LLBottomTray(const LLSD&) mBottomTrayContextMenu(NULL), mCamButton(NULL), mBottomTrayLite(NULL), + mPopupChatBar(NULL), mIsInLiteMode(false), mDragStarted(false), mDraggedItem(NULL), @@ -237,7 +235,6 @@ LLBottomTray::LLBottomTray(const LLSD&) mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL); - buildFromFile("panel_bottomtray.xml"); // // find this callback registered in llfloatercamera.cpp now // LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("CameraPresets.ChangeView", boost::bind(&LLFloaterCamera::onClickCameraItem, _2)); @@ -251,8 +248,14 @@ LLBottomTray::LLBottomTray(const LLSD&) mBottomTrayLite = new LLBottomTrayLite(); mBottomTrayLite->setFollowsAll(); mBottomTrayLite->setVisible(FALSE); + + mPopupChatBar = new LLBottomTrayLite(); + mPopupChatBar->setFollowsAll(); + mPopupChatBar->setVisible(FALSE); } + buildFromFile("panel_bottomtray.xml"); + mImageDragIndication = LLUI::getUIImage(getString("DragIndicationImageName")); mDesiredNearbyChatWidth = mNearbyChatBar ? mNearbyChatBar->getRect().getWidth() : 0; } @@ -288,7 +291,13 @@ void* LLBottomTray::createNearbyChatBar(void* userdata) LLNearbyChatBar* LLBottomTray::getNearbyChatBar() { - return mIsInLiteMode ? mBottomTrayLite->mNearbyChatBar : mNearbyChatBar; + if(mIsInLiteMode) + return mBottomTrayLite->mNearbyChatBar; + + if(gSavedSettings.getBOOL("AutohideChatBar")) + return mPopupChatBar->mNearbyChatBar; + + return mNearbyChatBar; } LLIMChiclet* LLBottomTray::createIMChiclet(const LLUUID& session_id) @@ -421,6 +430,7 @@ void LLBottomTray::onMouselookModeOut() mIsInLiteMode = false; mBottomTrayLite->setVisible(FALSE); mNearbyChatBar->getChatBox()->setText(mBottomTrayLite->mNearbyChatBar->getChatBox()->getText()); + mPopupChatBar->mNearbyChatBar->getChatBox()->setText(mBottomTrayLite->mNearbyChatBar->getChatBox()->getText()); setVisible(TRUE); } @@ -433,30 +443,38 @@ void LLBottomTray::onMouselookModeIn() getParent()->addChild(mBottomTrayLite); mBottomTrayLite->setShape(getLocalRect()); - mBottomTrayLite->mNearbyChatBar->getChatBox()->setText(mNearbyChatBar->getChatBox()->getText()); + if(gSavedSettings.getBOOL("AutohideChatBar")) + mBottomTrayLite->mNearbyChatBar->getChatBox()->setText(mPopupChatBar->mNearbyChatBar->getChatBox()->getText()); + else + mBottomTrayLite->mNearbyChatBar->getChatBox()->setText(mNearbyChatBar->getChatBox()->getText()); mBottomTrayLite->mGesturePanel->setVisible(gSavedSettings.getBOOL("ShowGestureButton")); mIsInLiteMode = true; } -//virtual -// setVisible used instead of onVisibilityChange, since LLAgent calls it on entering/leaving mouselook mode. -// If bottom tray is already visible in mouselook mode, then onVisibilityChange will not be called from setVisible(true), -void LLBottomTray::setVisible(BOOL visible) +void LLBottomTray::setChatBarVisible(BOOL visible) { if (mIsInLiteMode) { mBottomTrayLite->setVisible(visible); } - else + else if(gSavedSettings.getBOOL("AutohideChatBar")) { - LLPanel::setVisible(visible); + // Attach the lite bottom tray + if (getParent() && mPopupChatBar->getParent() != getParent()) + getParent()->addChild(mPopupChatBar); + + if(visible) + { + if(mPopupChatBar->getVisible()) + return; + + mPopupChatBar->setShape(getLocalRect()); + mPopupChatBar->mGesturePanel->setVisible(gSavedSettings.getBOOL("ShowGestureButton")); + } + + mPopupChatBar->setVisible(visible); } - //-TT 2.6.9 - removed? - //if(visible) - // gFloaterView->setSnapOffsetBottom(getRect().getHeight()); - //else - // gFloaterView->setSnapOffsetBottom(0); } S32 LLBottomTray::notifyParent(const LLSD& info) @@ -649,9 +667,27 @@ BOOL LLBottomTray::postBuild() mAOToggleButton->setCommitCallback(boost::bind(&LLBottomTray::toggleAO,this)); mAOToggleButton->setToggleState(gSavedPerAccountSettings.getBOOL("UseAO")); // ## Zi: Animation Overrider + + gSavedSettings.getControl("AutohideChatBar")->getSignal()->connect(boost::bind(&LLBottomTray::onAutohideChatBarChanged, this)); + onAutohideChatBarChanged(); + return TRUE; } +void LLBottomTray::onAutohideChatBarChanged() +{ + if(gSavedSettings.getBOOL("AutohideChatBar")) + { + mChatBarContainer->setVisible(FALSE); + mNearbyCharResizeHandlePanel->setVisible(FALSE); + } + else + { + mChatBarContainer->setVisible(TRUE); + mNearbyCharResizeHandlePanel->setVisible(TRUE); + } +} + //Drag-n-drop void LLBottomTray::onDraggableButtonMouseDown(LLUICtrl* ctrl, S32 x, S32 y) diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index a186721953..b076244c21 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -103,7 +103,7 @@ public: virtual void reshape(S32 width, S32 height, BOOL called_from_parent); - virtual void setVisible(BOOL visible); + void setChatBarVisible(BOOL visible); /*virtual*/ S32 notifyParent(const LLSD& info); @@ -536,6 +536,7 @@ protected: void showSidebarPanel(const LLSD& panel_name); //-TT bool onContextMenuItemEnabled(const LLSD& userdata); + void onAutohideChatBarChanged(); // Either default or saved after user's manual resize width of nearby chat. // Nearby chat will not always have it, because sometimes it can be shrunk on resize, @@ -552,6 +553,7 @@ protected: LLButton* mCamButton; LLButton* mMovementButton; LLBottomTrayLite* mBottomTrayLite; + LLBottomTrayLite* mPopupChatBar; LLButton* mAOToggleButton; // ## Zi: Animation Overrider bool mIsInLiteMode; diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index d2f2d70418..86879d580d 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -917,7 +917,7 @@ void LLNearbyChatBar::startChat(const char* line) if (!cb ) return; - bt->setVisible(TRUE); + bt->setChatBarVisible(TRUE); cb->mChatBox->setFocus(TRUE); if (line) @@ -943,6 +943,7 @@ void LLNearbyChatBar::stopChat() if (!cb) return; + bt->setChatBarVisible(FALSE); cb->mChatBox->setFocus(FALSE); // stop typing animation diff --git a/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml b/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml index 985264c31b..191eac764b 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml @@ -900,6 +900,17 @@ text_color="White_25"> (requires restart) +