From f7594c713d93f397440c4af2f566a33f1b6af099 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Wed, 3 Feb 2010 17:42:23 +0200 Subject: fixed EXT-4737 Nearby chat edit field doesn't get focus after pasting --HG-- branch : product-engine --- indra/newview/llbottomtray.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index a2d594cfa2..0102e9488e 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -474,6 +474,7 @@ void LLBottomTray::onContextMenuItemClicked(const LLSD& userdata) else if (item == "paste") { edit_box->paste(); + edit_box->setFocus(TRUE); } else if (item == "delete") { -- cgit v1.2.3 From b52d2a2f1b0406becb80862686be7b6f2444006d Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Wed, 3 Feb 2010 22:16:18 +0200 Subject: Fixed normal bug EXT-4648 (Right segment of Speak button is disabled if nearby voice chat is disabled in estate). - Added methods for separate enabling of left and right parts of speak button and used them instead of simply enabling/disabling LLSpeakButton in bottomtray. - Made changes to reset() in LLCallFloater to show "no one near..." instead of "loading" in vcp for nearby chat in regions with disabled voice. --HG-- branch : product-engine --- indra/newview/llbottomtray.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 0102e9488e..4c8cec3d30 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -280,7 +280,13 @@ void LLBottomTray::onChange(EStatusType status, const std::string &channelURI, b break; } - mSpeakBtn->setEnabled(enable); + // We have to enable/disable right and left parts of speak button separately (EXT-4648) + mSpeakBtn->setSpeakBtnEnabled(enable); + // skipped to avoid button blinking + if (status != STATUS_JOINING && status!= STATUS_LEFT_CHANNEL) + { + mSpeakBtn->setFlyoutBtnEnabled(LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking()); + } } void LLBottomTray::onMouselookModeOut() @@ -410,9 +416,10 @@ BOOL LLBottomTray::postBuild() mSpeakPanel = getChild("speak_panel"); mSpeakBtn = getChild("talk"); - // Speak button should be initially disabled because + // Both parts of speak button should be initially disabled because // it takes some time between logging in to world and connecting to voice channel. - mSpeakBtn->setEnabled(FALSE); + mSpeakBtn->setSpeakBtnEnabled(false); + mSpeakBtn->setFlyoutBtnEnabled(false); // Localization tool doesn't understand custom buttons like mSpeakBtn->setSpeakToolTip( getString("SpeakBtnToolTip") ); -- cgit v1.2.3 From b2f0169a764119ad6b51ad0df964309ca7458278 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Thu, 4 Feb 2010 20:40:30 +0200 Subject: Fixed normal bug EXT-4627(Nearby Chat floater in Mouselook breaks ability to type & use gestures) --HG-- branch : product-engine --- indra/newview/llbottomtray.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 4c8cec3d30..92c00efe99 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -80,6 +80,14 @@ public: { mNearbyChatBar = getChild("chat_bar"); mGesturePanel = getChild("gesture_panel"); + + // Hide "show_nearby_chat" button + LLLineEditor* chat_box = mNearbyChatBar->getChatBox(); + LLUICtrl* show_btn = mNearbyChatBar->getChild("show_nearby_chat"); + S32 delta_width = show_btn->getRect().getWidth(); + show_btn->setVisible(FALSE); + chat_box->reshape(chat_box->getRect().getWidth() + delta_width, chat_box->getRect().getHeight()); + return TRUE; } -- cgit v1.2.3 From 3f0762f65ad8ba9d4f854378ca2d2dd826470f4e Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Thu, 4 Feb 2010 20:40:30 +0200 Subject: Fixed normal bug EXT-4307 (There are no text context menues for Search text field and for IM text field) --HG-- branch : product-engine --- indra/newview/llbottomtray.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 92c00efe99..93b708f299 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -441,6 +441,8 @@ BOOL LLBottomTray::postBuild() mObjectDefaultWidthMap[RS_BUTTON_CAMERA] = mCamPanel->getRect().getWidth(); mObjectDefaultWidthMap[RS_BUTTON_SPEAK] = mSpeakPanel->getRect().getWidth(); + mNearbyChatBar->getChatBox()->setContextMenu(NULL); + return TRUE; } -- cgit v1.2.3 From a0cab8fde8f9cfe8dacf8e8f7b40f28e76774526 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Tue, 16 Feb 2010 21:17:20 +0200 Subject: Fixed low priority bug EXT-5425 (Undocked 'Movement Controls' floater became docked after opening from 'World' top menu). --HG-- branch : product-engine --- indra/newview/llbottomtray.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 2958565fdf..48c0ec61d8 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -421,6 +421,18 @@ void LLBottomTray::showSnapshotButton(BOOL visible) setTrayButtonVisibleIfPossible(RS_BUTTON_SNAPSHOT, visible); } +void LLBottomTray::toggleMovementControls() +{ + if (mMovementButton) + mMovementButton->onCommit(); +} + +void LLBottomTray::toggleCameraControls() +{ + if (mCamButton) + mCamButton->onCommit(); +} + BOOL LLBottomTray::postBuild() { -- cgit v1.2.3 From 6a4aea457159192951b584c05a4d3a80a1d08290 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Tue, 16 Feb 2010 18:17:22 +0200 Subject: Fixed low bug EXT-5376(Gesture button has stripped label after unhide if it was hidden with stripped label) --HG-- branch : product-engine --- indra/newview/llbottomtray.cpp | 159 ++++++++++++++++++++++++++++++++--------- 1 file changed, 126 insertions(+), 33 deletions(-) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 93b708f299..2958565fdf 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -60,6 +60,26 @@ namespace const std::string& PANEL_MOVEMENT_NAME = "movement_panel"; const std::string& PANEL_CAMERA_NAME = "cam_panel"; const std::string& PANEL_GESTURE_NAME = "gesture_panel"; + + S32 get_panel_min_width(LLLayoutStack* stack, LLPanel* panel) + { + S32 minimal_width = 0; + if ( panel && panel->getVisible() ) + { + stack->getPanelMinSize(panel->getName(), &minimal_width, NULL); + } + return minimal_width; + } + + S32 get_curr_width(LLUICtrl* ctrl) + { + S32 cur_width = 0; + if ( ctrl && ctrl->getVisible() ) + { + cur_width = ctrl->getRect().getWidth(); + } + return cur_width; + } } class LLBottomTrayLite @@ -1094,58 +1114,131 @@ void LLBottomTray::setTrayButtonVisible(EResizeState shown_object_type, bool vis if (mDummiesMap.count(shown_object_type)) { - mDummiesMap[shown_object_type]->setVisible(visible); + // Hide/show layout panel for dummy icon. + mDummiesMap[shown_object_type]->getParent()->setVisible(visible); } } void LLBottomTray::setTrayButtonVisibleIfPossible(EResizeState shown_object_type, bool visible, bool raise_notification) { - bool can_be_set = true; - - if (visible) + if (!setVisibleAndFitWidths(shown_object_type, visible) && visible && raise_notification) { - LLPanel* panel = mStateProcessedObjectMap[shown_object_type]; - if (NULL == panel) - { - lldebugs << "There is no object to process for state: " << shown_object_type << llendl; - return; - } + LLNotificationsUtil::add("BottomTrayButtonCanNotBeShown", + LLSD(), + LLSD(), + LLNotificationFunctorRegistry::instance().DONOTHING); + } +} - const S32 dummy_width = mDummiesMap.count(shown_object_type) ? mDummiesMap[shown_object_type]->getRect().getWidth() : 0; +bool LLBottomTray::setVisibleAndFitWidths(EResizeState object_type, bool visible) +{ + LLPanel* cur_panel = mStateProcessedObjectMap[object_type]; + if (NULL == cur_panel) + { + lldebugs << "There is no object to process for state: " << object_type << llendl; + return false; + } - const S32 chatbar_panel_width = mNearbyChatBar->getRect().getWidth(); - const S32 chatbar_panel_min_width = mNearbyChatBar->getMinWidth(); + const S32 dummy_width = mDummiesMap.count(object_type) + ? mDummiesMap[object_type]->getParent()->getRect().getWidth() + : 0; - const S32 chiclet_panel_width = mChicletPanel->getParent()->getRect().getWidth(); - const S32 chiclet_panel_min_width = mChicletPanel->getMinWidth(); + bool is_set = true; - const S32 available_width = (chatbar_panel_width - chatbar_panel_min_width) - + (chiclet_panel_width - chiclet_panel_min_width); + if (visible) + { + // Assume that only chiclet panel can be auto-resized and + // don't take into account width of dummy widgets + const S32 available_width = + mChicletPanel->getParent()->getRect().getWidth() - + mChicletPanel->getMinWidth() - + dummy_width; + + S32 preferred_width = mObjectDefaultWidthMap[object_type]; + S32 current_width = cur_panel->getRect().getWidth(); + S32 result_width = 0; + bool decrease_width = false; + + // Mark this button to be shown + mResizeState |= object_type; + + if (preferred_width > 0 && available_width >= preferred_width) + { + result_width = preferred_width; + } + else if (available_width >= current_width) + { + result_width = current_width; + } + else + { + // Calculate the possible shrunk width as difference between current and minimal widths + const S32 chatbar_shrunk_width = + mNearbyChatBar->getRect().getWidth() - mNearbyChatBar->getMinWidth(); + + const S32 sum_of_min_widths = + get_panel_min_width(mToolbarStack, mStateProcessedObjectMap[RS_BUTTON_CAMERA]) + + get_panel_min_width(mToolbarStack, mStateProcessedObjectMap[RS_BUTTON_MOVEMENT]) + + get_panel_min_width(mToolbarStack, mStateProcessedObjectMap[RS_BUTTON_GESTURES]) + + get_panel_min_width(mToolbarStack, mSpeakPanel); + + const S32 sum_of_curr_widths = + get_curr_width(mStateProcessedObjectMap[RS_BUTTON_CAMERA]) + + get_curr_width(mStateProcessedObjectMap[RS_BUTTON_MOVEMENT]) + + get_curr_width(mStateProcessedObjectMap[RS_BUTTON_GESTURES]) + + get_curr_width(mSpeakPanel); + + const S32 possible_shrunk_width = + chatbar_shrunk_width + (sum_of_curr_widths - sum_of_min_widths); + + // Minimal width of current panel + S32 minimal_width = 0; + mToolbarStack->getPanelMinSize(cur_panel->getName(), &minimal_width, NULL); + + if ( (available_width + possible_shrunk_width) >= minimal_width) + { + // There is enough space for minimal width, but set the result_width + // to current_width so buttons widths decreasing will be done in predefined order + result_width = current_width; + decrease_width = true; + } + else + { + // Nothing can be done, give up... + return false; + } + } - const S32 required_width = panel->getRect().getWidth() + dummy_width; - can_be_set = available_width >= required_width; - } + if (result_width != current_width) + { + cur_panel->reshape(result_width, cur_panel->getRect().getHeight()); + current_width = result_width; + } - if (can_be_set) - { - setTrayButtonVisible(shown_object_type, visible); + is_set = processShowButton(object_type, ¤t_width); - // if we hide the button mark it NOT to show while future bottom tray extending - if (!visible) + // Shrink buttons if needed + if (is_set && decrease_width) { - mResizeState &= ~shown_object_type; + processWidthDecreased( -result_width - dummy_width ); } } else { - // mark this button to show it while future bottom tray extending - mResizeState |= shown_object_type; - if ( raise_notification ) - LLNotificationsUtil::add("BottomTrayButtonCanNotBeShown", - LLSD(), - LLSD(), - LLNotificationFunctorRegistry::instance().DONOTHING); + const S32 delta_width = get_curr_width(cur_panel); + + setTrayButtonVisible(object_type, false); + + // Mark button NOT to show while future bottom tray extending + mResizeState &= ~object_type; + + // Extend other buttons if need + if (delta_width) + { + processWidthIncreased(delta_width + dummy_width); + } } + return is_set; } //EOF -- cgit v1.2.3 From d2ef287e9c62dbf179ba624e60b882cfc59bb8ca Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 16 Feb 2010 16:38:16 +0000 Subject: defensiveness added to 81fc7fe78ca6 / EXT-5376 --- indra/newview/llbottomtray.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 2958565fdf..95a946cee8 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -64,7 +64,8 @@ namespace S32 get_panel_min_width(LLLayoutStack* stack, LLPanel* panel) { S32 minimal_width = 0; - if ( panel && panel->getVisible() ) + llassert(stack); + if ( stack && panel && panel->getVisible() ) { stack->getPanelMinSize(panel->getName(), &minimal_width, NULL); } -- cgit v1.2.3 From 4514b57126b2dae295602778589217f6e22451b8 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 18 Feb 2010 10:29:56 -0800 Subject: Backed out changeset: 744bd7c535fa --- indra/newview/llbottomtray.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index bbdaf5449f..8a7ed23b59 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -325,11 +325,6 @@ void LLBottomTray::setVisible(BOOL visible) } } } - - if(visible) - gFloaterView->setSnapOffsetBottom(getRect().getHeight()); - else - gFloaterView->setSnapOffsetBottom(0); } void LLBottomTray::showBottomTrayContextMenu(S32 x, S32 y, MASK mask) -- cgit v1.2.3 From 3af609b55c591ecc572c0872ba1b3013885d8ac9 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 18 Feb 2010 12:57:05 -0800 Subject: fixed some spacing munged by merge --- indra/newview/llbottomtray.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 463add9f4b..459a61dec3 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -117,7 +117,7 @@ public: if (gAgent.cameraMouselook()) { LLBottomTray::getInstance()->setVisible(FALSE); -} + } } LLNearbyChatBar* mNearbyChatBar; @@ -319,7 +319,7 @@ void LLBottomTray::onChange(EStatusType status, const std::string &channelURI, b } void LLBottomTray::onMouselookModeOut() - { +{ mIsInLiteMode = false; mBottomTrayLite->setVisible(FALSE); mNearbyChatBar->getChatBox()->setText(mBottomTrayLite->mNearbyChatBar->getChatBox()->getText()); @@ -350,10 +350,10 @@ void LLBottomTray::setVisible(BOOL visible) { mBottomTrayLite->setVisible(visible); } - else - { + else + { LLPanel::setVisible(visible); - } + } if(visible) gFloaterView->setSnapOffsetBottom(getRect().getHeight()); else @@ -566,7 +566,7 @@ void LLBottomTray::reshape(S32 width, S32 height, BOOL called_from_parent) { BOOL saved_anim = mToolbarStack->getAnimate(); // Set chiclet panel to be autoresized by default. - mToolbarStack->updatePanelAutoResize(PANEL_CHICLET_NAME, TRUE); + mToolbarStack->updatePanelAutoResize(PANEL_CHICLET_NAME, TRUE); // Disable animation to prevent layout updating in several frames. mToolbarStack->setAnimate(FALSE); // Force the updating of layout to reset panels collapse factor. @@ -1208,10 +1208,10 @@ bool LLBottomTray::setVisibleAndFitWidths(EResizeState object_type, bool visible // Nothing can be done, give up... return false; } - } + } if (result_width != current_width) - { + { cur_panel->reshape(result_width, cur_panel->getRect().getHeight()); current_width = result_width; } -- cgit v1.2.3 From 0b8be887de8e801aa1f4bb1dc1d94c1ac5fd58ef Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Fri, 19 Feb 2010 19:51:07 +0200 Subject: Fixed low bug EXT-5568 (The Speak button label hides after bottom tray width decreased.) --HG-- branch : product-engine --- indra/newview/llbottomtray.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 92031be8c5..17313fc113 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -926,13 +926,12 @@ void LLBottomTray::processShrinkButtons(S32* required_width, S32* buttons_freed_ } else { - // - mSpeakBtn->setLabelVisible(false); S32 panel_width = mSpeakPanel->getRect().getWidth(); S32 possible_shrink_width = panel_width - panel_min_width; if (possible_shrink_width > 0) { + mSpeakBtn->setLabelVisible(false); mSpeakPanel->reshape(panel_width - possible_shrink_width, mSpeakPanel->getRect().getHeight()); *required_width += possible_shrink_width; @@ -1007,11 +1006,11 @@ void LLBottomTray::processExtendButtons(S32* available_width) if (*available_width > 0) { - processExtendButton(RS_BUTTON_CAMERA, available_width); + processExtendButton(RS_BUTTON_MOVEMENT, available_width); } if (*available_width > 0) { - processExtendButton(RS_BUTTON_MOVEMENT, available_width); + processExtendButton(RS_BUTTON_CAMERA, available_width); } if (*available_width > 0) { @@ -1211,8 +1210,8 @@ bool LLBottomTray::setVisibleAndFitWidths(EResizeState object_type, bool visible if ( (available_width + possible_shrunk_width) >= minimal_width) { // There is enough space for minimal width, but set the result_width - // to current_width so buttons widths decreasing will be done in predefined order - result_width = current_width; + // to preferred_width so buttons widths decreasing will be done in predefined order + result_width = (preferred_width > 0) ? preferred_width : current_width; decrease_width = true; } else -- cgit v1.2.3 From f08ab41c3e5d7824cb34378ba5a400795e7e888c Mon Sep 17 00:00:00 2001 From: Kent Quirk Date: Sat, 20 Feb 2010 13:11:25 -0500 Subject: Importing patch for EXT-5571 for Beta 3 release. Fix by Callum originally. --- indra/newview/llbottomtray.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 459a61dec3..3f60cec6da 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -915,7 +915,7 @@ void LLBottomTray::processShrinkButtons(S32* required_width, S32* buttons_freed_ else { // - mSpeakBtn->setLabelVisible(false); + //mSpeakBtn->setLabelVisible(false); // HACK: this button doesn't change size so label should not be turned off S32 panel_width = mSpeakPanel->getRect().getWidth(); S32 possible_shrink_width = panel_width - panel_min_width; @@ -1006,7 +1006,7 @@ void LLBottomTray::processExtendButtons(S32* available_width) S32 panel_max_width = mObjectDefaultWidthMap[RS_BUTTON_SPEAK]; S32 panel_width = mSpeakPanel->getRect().getWidth(); S32 possible_extend_width = panel_max_width - panel_width; - if (possible_extend_width > 0 && possible_extend_width <= *available_width) + if (possible_extend_width >= 0 && possible_extend_width <= *available_width) // HACK: this button doesn't change size so possible_extend_width will be 0 { mSpeakBtn->setLabelVisible(true); mSpeakPanel->reshape(panel_max_width, mSpeakPanel->getRect().getHeight()); -- cgit v1.2.3