diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 2 | ||||
-rw-r--r-- | indra/newview/llbottomtray.cpp | 32 | ||||
-rw-r--r-- | indra/newview/llnearbychat.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llnearbychatbar.cpp | 35 | ||||
-rw-r--r-- | indra/newview/llnearbychatbar.h | 8 | ||||
-rw-r--r-- | indra/newview/llviewerfloaterreg.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 13 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_test_toolbar.xml | 14 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/toolbar.xml | 32 |
9 files changed, 78 insertions, 62 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index cc9e17409f..f1db72e5cc 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1493,7 +1493,7 @@ <key>Type</key> <string>S32</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>ChatBubbleOpacity</key> <map> diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index c8cfe5b51e..7a60903950 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -165,13 +165,13 @@ public: mChatBarContainer(NULL), mGesturePanel(NULL) { - mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL); + //mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL); buildFromFile("panel_bottomtray_lite.xml"); } BOOL postBuild() { - mNearbyChatBar = findChild<LLNearbyChatBar>("chat_bar"); + //mNearbyChatBar = findChild<LLNearbyChatBar>("chat_bar"); mChatBarContainer = getChild<LLLayoutPanel>("chat_bar_layout_panel"); mGesturePanel = getChild<LLPanel>("gesture_panel"); @@ -224,7 +224,7 @@ LLBottomTray::LLBottomTray(const LLSD&) // before chiclets do that. LLIMMgr::getInstance()->addSessionObserver(this); - mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL); + //mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL); buildFromFile("panel_bottomtray.xml"); @@ -271,7 +271,8 @@ LLBottomTray::~LLBottomTray() // *TODO Vadim: why void* ? void* LLBottomTray::createNearbyChatBar(void* userdata) { - return new LLNearbyChatBar(); + //return new LLNearbyChatBar(); + return NULL; } LLNearbyChatBar* LLBottomTray::getNearbyChatBar() @@ -537,10 +538,10 @@ BOOL LLBottomTray::postBuild() mBottomTrayContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_bottomtray.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); gMenuHolder->addChild(mBottomTrayContextMenu); - mNearbyChatBar = findChild<LLNearbyChatBar>("chat_bar"); - LLHints::registerHintTarget("chat_bar", mNearbyChatBar->LLView::getHandle()); + //mNearbyChatBar = findChild<LLNearbyChatBar>("chat_bar"); + //LLHints::registerHintTarget("chat_bar", mNearbyChatBar->LLView::getHandle()); - mListener.reset(new LLNearbyChatBarListener(*mNearbyChatBar)); + //mListener.reset(new LLNearbyChatBarListener(*mNearbyChatBar)); mChatBarContainer = getChild<LLLayoutPanel>("chat_bar_layout_panel"); mNearbyCharResizeHandlePanel = getChild<LLPanel>("chat_bar_resize_handle_panel"); @@ -577,7 +578,7 @@ BOOL LLBottomTray::postBuild() // Registering Chat Bar to receive Voice client status change notifications. LLVoiceClient::getInstance()->addObserver(this); - mNearbyChatBar->getChatBox()->setContextMenu(NULL); + //mNearbyChatBar->getChatBox()->setContextMenu(NULL); mChicletPanel = getChild<LLChicletPanel>("chiclet_list"); @@ -882,6 +883,7 @@ void LLBottomTray::draw() bool LLBottomTray::onContextMenuItemEnabled(const LLSD& userdata) { std::string item = userdata.asString(); + /* LLLineEditor* edit_box = mNearbyChatBar->findChild<LLLineEditor>("chat_box"); if (item == "can_cut") @@ -903,13 +905,13 @@ bool LLBottomTray::onContextMenuItemEnabled(const LLSD& userdata) else if (item == "can_select_all") { return edit_box->canSelectAll() && (edit_box->getLength()>0); - } + }*/ return true; } void LLBottomTray::onContextMenuItemClicked(const LLSD& userdata) -{ +{/* std::string item = userdata.asString(); LLLineEditor* edit_box = mNearbyChatBar->findChild<LLLineEditor>("chat_box"); @@ -933,7 +935,7 @@ void LLBottomTray::onContextMenuItemClicked(const LLSD& userdata) else if (item == "select_all") { edit_box->selectAll(); - } + }*/ } void LLBottomTray::log(LLView* panel, const std::string& descr) @@ -1117,8 +1119,8 @@ S32 LLBottomTray::processWidthDecreased(S32 delta_width) // chatbar should only be shrunk here, not stretched if (shrink_by > 0) { - lldebugs << "Shrinking nearby chat bar by " << shrink_by << " px " << llendl; - mChatBarContainer->reshape(mNearbyChatBar->getRect().getWidth() - shrink_by, mChatBarContainer->getRect().getHeight()); + //lldebugs << "Shrinking nearby chat bar by " << delta_panel << " px " << llendl; + //mChatBarContainer->reshape(mNearbyChatBar->getRect().getWidth() - delta_panel, mChatBarContainer->getRect().getHeight()); } log(mNearbyChatBar, "after processing panel decreasing via nearby chatbar panel"); @@ -1144,8 +1146,8 @@ S32 LLBottomTray::processWidthDecreased(S32 delta_width) if (buttons_freed_width > 0) { - S32 nearby_needed_width = mDesiredNearbyChatWidth - mNearbyChatBar->getRect().getWidth(); - if (nearby_needed_width > 0) + S32 nearby_needed_width = mDesiredNearbyChatWidth; + if ( 0) { S32 compensative_width = nearby_needed_width > buttons_freed_width ? buttons_freed_width : nearby_needed_width; log(mNearbyChatBar, "before applying compensative width"); diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 03ebc344f1..361912a5cb 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -92,7 +92,7 @@ BOOL LLNearbyChat::postBuild() if (getDockControl() == NULL) { setDockControl(new LLDockControl( - LLBottomTray::getInstance()->getNearbyChatBar(), this, + LLFloaterReg::getInstance("chat_bar"), this, getDockTongue(), LLDockControl::TOP, boost::bind(&LLNearbyChat::getAllowedRect, this, _1))); } diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 4b961db5f9..185acb1414 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -411,8 +411,9 @@ LLCtrlListInterface* LLGestureComboList::getListInterface() return mList; } -LLNearbyChatBar::LLNearbyChatBar() -: mChatBox(NULL) +LLNearbyChatBar::LLNearbyChatBar(const LLSD& key) + : LLFloater(key), + mChatBox(NULL) { mSpeakerMgr = LLLocalSpeakerMgr::getInstance(); } @@ -457,19 +458,13 @@ void LLNearbyChatBar::onChatFontChange(LLFontGL* fontp) //static LLNearbyChatBar* LLNearbyChatBar::getInstance() { - return LLBottomTray::getInstance() ? LLBottomTray::getInstance()->getNearbyChatBar() : NULL; -} - -//static -bool LLNearbyChatBar::instanceExists() -{ - return LLBottomTray::instanceExists() && LLBottomTray::getInstance()->getNearbyChatBar() != NULL; + return LLFloaterReg::getTypedInstance<LLNearbyChatBar>("chat_bar"); } void LLNearbyChatBar::draw() { displaySpeakingIndicator(); - LLPanel::draw(); + LLFloater::draw(); } std::string LLNearbyChatBar::getCurrentChat() @@ -780,17 +775,12 @@ void LLNearbyChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, // static void LLNearbyChatBar::startChat(const char* line) { - LLBottomTray *bt = LLBottomTray::getInstance(); - - if (!bt) - return; - - LLNearbyChatBar* cb = bt->getNearbyChatBar(); + LLNearbyChatBar* cb = LLNearbyChatBar::getInstance(); if (!cb ) return; - bt->setVisible(TRUE); + cb->setVisible(TRUE); cb->mChatBox->setFocus(TRUE); if (line) @@ -811,7 +801,7 @@ void LLNearbyChatBar::stopChat() if (!bt) return; - LLNearbyChatBar* cb = bt->getNearbyChatBar(); + LLNearbyChatBar* cb = LLNearbyChatBar::getInstance(); if (!cb) return; @@ -822,6 +812,15 @@ void LLNearbyChatBar::stopChat() gAgent.stopTyping(); } +void LLNearbyChatBar::onClose(bool app_quitting) +{ + LLFloater* nearby_chat = LLFloaterReg::findInstance("nearby_chat", LLSD()); + if (nearby_chat) + { + nearby_chat->closeFloater(app_quitting); + } +} + // If input of the form "/20foo" or "/20 foo", returns "foo" and channel 20. // Otherwise returns input and channel 0. LLWString LLNearbyChatBar::stripChannelNumber(const LLWString &mesg, S32* channel) diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index efddec942f..f4a8605e18 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -93,23 +93,23 @@ private: }; class LLNearbyChatBar -: public LLPanel +: public LLFloater { public: // constructor for inline chat-bars (e.g. hosted in chat history window) - LLNearbyChatBar(); + LLNearbyChatBar(const LLSD& key); ~LLNearbyChatBar() {} virtual BOOL postBuild(); static LLNearbyChatBar* getInstance(); - static bool instanceExists(); - LLLineEditor* getChatBox() { return mChatBox; } virtual void draw(); + virtual void onClose(bool app_quitting); + std::string getCurrentChat(); virtual BOOL handleKeyHere( KEY key, MASK mask ); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 375ee3ad33..b44e7283da 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -129,6 +129,7 @@ #include "llscriptfloater.h" #include "llfloatermodelpreview.h" #include "llcommandhandler.h" +#include "llnearbychatbar.h" // *NOTE: Please add files in alphabetical order to keep merges easy. @@ -180,6 +181,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("camera", "floater_camera.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCamera>); LLFloaterReg::add("nearby_chat", "floater_nearby_chat.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLNearbyChat>); + LLFloaterReg::add("chat_bar", "floater_chat_bar.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLNearbyChatBar>); LLFloaterReg::add("compile_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCompileQueue>); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index c651e86606..947f0ec184 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2462,7 +2462,12 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) // Traverses up the hierarchy if( keyboard_focus ) { - LLLineEditor* chat_editor = LLBottomTray::instanceExists() ? LLBottomTray::getInstance()->getNearbyChatBar()->getChatBox() : NULL; + LLNearbyChatBar* nearby_chat = LLFloaterReg::findTypedInstance<LLNearbyChatBar>("chat_bar"); + + if (nearby_chat) + { + LLLineEditor* chat_editor = nearby_chat->getChatBox(); + // arrow keys move avatar while chatting hack if (chat_editor && chat_editor->hasFocus()) { @@ -2493,7 +2498,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) } } } - + } if (keyboard_focus->handleKey(key, mask, FALSE)) { return TRUE; @@ -2524,11 +2529,11 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) if ( gSavedSettings.getS32("LetterKeysFocusChatBar") && !gAgentCamera.cameraMouselook() && !keyboard_focus && key < 0x80 && (mask == MASK_NONE || mask == MASK_SHIFT) ) { - LLLineEditor* chat_editor = LLBottomTray::instanceExists() ? LLBottomTray::getInstance()->getNearbyChatBar()->getChatBox() : NULL; + LLLineEditor* chat_editor = LLFloaterReg::getTypedInstance<LLNearbyChatBar>("chat_bar")->getChatBox(); if (chat_editor) { // passing NULL here, character will be added later when it is handled by character handler. - LLBottomTray::getInstance()->getNearbyChatBar()->startChat(NULL); + LLNearbyChatBar::getInstance()->startChat(NULL); return TRUE; } } diff --git a/indra/newview/skins/default/xui/en/floater_test_toolbar.xml b/indra/newview/skins/default/xui/en/floater_test_toolbar.xml index 85f0f104fc..b58c006b3f 100644 --- a/indra/newview/skins/default/xui/en/floater_test_toolbar.xml +++ b/indra/newview/skins/default/xui/en/floater_test_toolbar.xml @@ -13,22 +13,25 @@ width="500" left="0" top="20" - min_width="100" + min_button_width="0" + max_button_width="100" side="top"> <button auto_resize="true" + use_ellipses="true" label="Button"/> <button auto_resize="true" label="Button with long label"/> <button auto_resize="true" + use_ellipses="true" label="Button with longest label of all"/> </toolbar> <toolbar name="test_toolbar_left" follows="left|bottom|top" height="380" - width="100" + width="200" left="0" top="70" - min_width="100" + min_button_width="100" side="left"> <button height="30" label="Button"/> @@ -40,10 +43,9 @@ <toolbar name="test_toolbar_right" follows="right|bottom|top" height="380" - width="100" + width="200" right="500" top="70" - min_width="100" side="right"> <button auto_resize="true" label="Button 1"/> @@ -58,7 +60,7 @@ width="500" left="0" bottom="500" - min_width="100" + min_button_width="100" side="bottom"> <button auto_resize="true" label="Button"/> diff --git a/indra/newview/skins/default/xui/en/widgets/toolbar.xml b/indra/newview/skins/default/xui/en/widgets/toolbar.xml index a7f73c0c7c..45210277b2 100644 --- a/indra/newview/skins/default/xui/en/widgets/toolbar.xml +++ b/indra/newview/skins/default/xui/en/widgets/toolbar.xml @@ -1,15 +1,21 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<toolbar background_image = "Rounded_Rect"> - <button_icon_and_text - follows="none" - height="30" - chrome="true" - auto_resize="true" - /> - <button_icon - follows="none" - height="30" - chrome="true" - auto_resize="true" - /> +<toolbar button_height="30" + pad_left="5" + pad_right="5" + pad_top="5" + pad_bottom="5" + pad_between="5"> + + <button_panel name="button_panel" + bg_opaque_image="Rounded_Rect" + background_visible="true" + background_opaque="true"/> + <button_icon_and_text follows="left|top" + chrome="true" + use_ellipses="true" + auto_resize="true"/> + <button_icon follows="left|top" + chrome="true" + use_ellipses="true" + auto_resize="true"/> </toolbar> |