From edbda23c1aaafcaa7d8b0ec2b9c876f474823f8a Mon Sep 17 00:00:00 2001 From: Arrehn Date: Sun, 27 Nov 2011 00:35:29 -0500 Subject: [PATCH] Show conversation icons when autohide nearbychat is enabled. Don't show nearbychat icon if it's docked to communications --- indra/newview/llbottomtray.cpp | 53 ++++++++++++++++++- indra/newview/llbottomtray.h | 3 ++ .../skins/default/xui/en/panel_bottomtray.xml | 4 +- 3 files changed, 57 insertions(+), 3 deletions(-) diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 2c52550c3c..d135e252d5 100755 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -429,6 +429,49 @@ bool LLBottomTray::handleVoiceEnabledToggle(const LLSD& newvalue) } // [/SL:KB] +// AO: Delicately reshape the chat bar + related icons to handle the various states of docked/undocked nearbychat + autohide +// This is called whenever autohide or docked state changes, and also on startup. Temporary implementation until we have +// more robust bottombar/icon support. +void LLBottomTray::handleChatHistoryTornOff() +{ + BOOL showNearbyChatIcon = gSavedSettings.getBOOL("ChatHistoryTornOff"); + LLButton* nearbyChatButton = findChild("show_nearby_chat"); + if (nearbyChatButton) + { + if (showNearbyChatIcon) + { + // show nearbychat icon, it is in its own floater. + nearbyChatButton->reshape(30, nearbyChatButton->getRect().getHeight()); + mNearbyChatBar->reshape(mChatBarContainer->getRect().getWidth()-62,mNearbyChatBar->getRect().getHeight()); + if (gSavedSettings.getBOOL("AutohideChatBar")) + { + mChatBarContainer->reshape(62,mChatBarContainer->getRect().getHeight()); + } + else + { + mChatBarContainer->reshape(mChatBarContainer->getRect().getWidth(),mChatBarContainer->getRect().getHeight()); + } + } + else + { + // hide nearbychat, it's handled within the comm window. + nearbyChatButton->reshape(1, nearbyChatButton->getRect().getHeight()); + mNearbyChatBar->reshape(mChatBarContainer->getRect().getWidth()-31,mNearbyChatBar->getRect().getHeight()); + if (gSavedSettings.getBOOL("AutohideChatBar")) + { + mChatBarContainer->reshape(31,mChatBarContainer->getRect().getHeight()); + } + else + { + mChatBarContainer->reshape(mChatBarContainer->getRect().getWidth(),mChatBarContainer->getRect().getHeight()); + } + } + nearbyChatButton->setVisible(showNearbyChatIcon); + } + + reshape(getRect().getWidth(), getRect().getHeight(), false); +} + void LLBottomTray::onMouselookModeOut() { mIsInLiteMode = false; @@ -643,6 +686,9 @@ BOOL LLBottomTray::postBuild() // [/SL:KB] // mNearbyChatBar->getChatBox()->setContextMenu(NULL); + + //AO: try to adapt bottom tray icons to whether or not nearbychat is torn off or not. + gSavedSettings.getControl("ChatHistoryTornOff")->getSignal()->connect(boost::bind(&LLBottomTray::handleChatHistoryTornOff, this)); mChicletPanel = getChild("chiclet_list"); @@ -675,6 +721,7 @@ BOOL LLBottomTray::postBuild() gSavedSettings.getControl("AutohideChatBar")->getSignal()->connect(boost::bind(&LLBottomTray::onAutohideChatBarChanged, this)); onAutohideChatBarChanged(); + handleChatHistoryTornOff(); //AO, autohide nearbychat button return TRUE; } @@ -683,13 +730,17 @@ void LLBottomTray::onAutohideChatBarChanged() { if(gSavedSettings.getBOOL("AutohideChatBar")) { + //AO: Don't hide the whole chatbar container! It contains an icon to the conversations widnow, which should always remain visible. + //Instead of hiding the whole container, we resize it to just show this icon. mChatbarWidth = mChatBarContainer->getRect().getWidth(); - mChatBarContainer->setVisible(FALSE); + handleChatHistoryTornOff(); + //mChatBarContainer->setVisible(FALSE); mNearbyCharResizeHandlePanel->setVisible(FALSE); } else { mChatBarContainer->setVisible(TRUE); + mChatBarContainer->reshape(mChatbarWidth,mChatBarContainer->getRect().getHeight()); mNearbyCharResizeHandlePanel->setVisible(TRUE); } } diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index d922e5abb7..c4b64e7fa7 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -114,6 +114,9 @@ public: // [SL:KB] - Patch: UI-BottomTray | Checked: 2010-11-26 (Catznip-2.4.0f) | Modified: Catznip-2.4.0f static bool handleVoiceEnabledToggle(const LLSD& newvalue); // [/SL:KB] + + //AO adjust chat icons based on whether chat history is torn off or not. + void handleChatHistoryTornOff(); void showBottomTrayContextMenu(S32 x, S32 y, MASK mask); diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index 8b2048aea8..6cb12d8bd4 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -37,7 +37,7 @@ top="0" width="1310">