From 658ccc3e85487f9f24ff3b5926e60d6cce7f42e0 Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Wed, 7 Apr 2010 11:08:04 -0700 Subject: Re-insert backed out SLE checkin so we can fix it --- 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 41bee540fc..9824f59358 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -319,7 +319,7 @@ void LLBottomTray::onChange(EStatusType status, const std::string &channelURI, b // skipped to avoid button blinking if (status != STATUS_JOINING && status!= STATUS_LEFT_CHANNEL) { - mSpeakBtn->setFlyoutBtnEnabled(LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking()); + mSpeakBtn->setFlyoutBtnEnabled(LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking()); } } @@ -489,7 +489,7 @@ BOOL LLBottomTray::postBuild() mSpeakBtn->setShowToolTip( getString("VoiceControlBtnToolTip") ); // Registering Chat Bar to receive Voice client status change notifications. - gVoiceClient->addObserver(this); + LLVoiceClient::getInstance()->addObserver(this); mObjectDefaultWidthMap[RS_BUTTON_GESTURES] = mGesturePanel->getRect().getWidth(); mObjectDefaultWidthMap[RS_BUTTON_MOVEMENT] = mMovementPanel->getRect().getWidth(); -- cgit v1.2.3 From 79332f4e3e1131fbab88b7b75cca7ab57c3c3e25 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 12 May 2010 17:15:46 +0300 Subject: EXT-7104 : WIP : Removed dummy icons between buttons may be hidden to simplify adding new buttons. * removed dummy icons * encreased width and minimal width of next to the left layout panels to icons' widths. * removed code processed dummy icons Reviewed by Vadim. --HG-- branch : product-engine --- indra/newview/llbottomtray.cpp | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 04a6c48b4f..774248ce4d 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -1122,11 +1122,6 @@ void LLBottomTray::initStateProcessedObjectMap() mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_MOVEMENT, mMovementPanel)); mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_CAMERA, mCamPanel)); mStateProcessedObjectMap.insert(std::make_pair(RS_BUTTON_SNAPSHOT, mSnapshotPanel)); - - mDummiesMap.insert(std::make_pair(RS_BUTTON_GESTURES, getChild("after_gesture_panel"))); - mDummiesMap.insert(std::make_pair(RS_BUTTON_MOVEMENT, getChild("after_movement_panel"))); - mDummiesMap.insert(std::make_pair(RS_BUTTON_CAMERA, getChild("after_cam_panel"))); - mDummiesMap.insert(std::make_pair(RS_BUTTON_SPEAK, getChild("after_speak_panel"))); } void LLBottomTray::setTrayButtonVisible(EResizeState shown_object_type, bool visible) @@ -1140,12 +1135,6 @@ void LLBottomTray::setTrayButtonVisible(EResizeState shown_object_type, bool vis } panel->setVisible(visible); - - if (mDummiesMap.count(shown_object_type)) - { - // 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) @@ -1168,20 +1157,13 @@ bool LLBottomTray::setVisibleAndFitWidths(EResizeState object_type, bool visible return false; } - const S32 dummy_width = mDummiesMap.count(object_type) - ? mDummiesMap[object_type]->getParent()->getRect().getWidth() - : 0; - bool is_set = true; if (visible) { - // Assume that only chiclet panel can be auto-resized and - // don't take into account width of dummy widgets + // Assume that only chiclet panel can be auto-resized const S32 available_width = - mChicletPanel->getParent()->getRect().getWidth() - - mChicletPanel->getMinWidth() - - dummy_width; + mChicletPanel->getParent()->getRect().getWidth() - mChicletPanel->getMinWidth(); S32 preferred_width = mObjectDefaultWidthMap[object_type]; S32 current_width = cur_panel->getRect().getWidth(); @@ -1249,7 +1231,7 @@ bool LLBottomTray::setVisibleAndFitWidths(EResizeState object_type, bool visible // Shrink buttons if needed if (is_set && decrease_width) { - processWidthDecreased( -result_width - dummy_width ); + processWidthDecreased( -result_width); } } else @@ -1264,7 +1246,7 @@ bool LLBottomTray::setVisibleAndFitWidths(EResizeState object_type, bool visible // Extend other buttons if need if (delta_width) { - processWidthIncreased(delta_width + dummy_width); + processWidthIncreased(delta_width); } } return is_set; -- cgit v1.2.3 From 3040d68c2637084176bdae759a89e264b1a3e14e Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 13 May 2010 15:14:30 +0300 Subject: EXT-7104 : WIP : bottomtray refactoring for future changes. Functionality was not changed. * updated method related to resize logic to take references to S32 instead of pointer. * added doxygen comments for these methods. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/381/ --HG-- branch : product-engine --- indra/newview/llbottomtray.cpp | 94 +++++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 47 deletions(-) (limited to 'indra/newview/llbottomtray.cpp') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 774248ce4d..d95b1cfa79 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -711,26 +711,26 @@ S32 LLBottomTray::processWidthDecreased(S32 delta_width) S32 buttons_freed_width = 0; if (still_should_be_processed) { - processShrinkButtons(&delta_width, &buttons_freed_width); + processShrinkButtons(delta_width, buttons_freed_width); if (delta_width < 0) { - processHideButton(RS_BUTTON_SNAPSHOT, &delta_width, &buttons_freed_width); + processHideButton(RS_BUTTON_SNAPSHOT, delta_width, buttons_freed_width); } if (delta_width < 0) { - processHideButton(RS_BUTTON_CAMERA, &delta_width, &buttons_freed_width); + processHideButton(RS_BUTTON_CAMERA, delta_width, buttons_freed_width); } if (delta_width < 0) { - processHideButton(RS_BUTTON_MOVEMENT, &delta_width, &buttons_freed_width); + processHideButton(RS_BUTTON_MOVEMENT, delta_width, buttons_freed_width); } if (delta_width < 0) { - processHideButton(RS_BUTTON_GESTURES, &delta_width, &buttons_freed_width); + processHideButton(RS_BUTTON_GESTURES, delta_width, buttons_freed_width); } if (delta_width < 0) @@ -778,25 +778,25 @@ void LLBottomTray::processWidthIncreased(S32 delta_width) S32 available_width = total_available_width; if (available_width > 0) { - processShowButton(RS_BUTTON_GESTURES, &available_width); + processShowButton(RS_BUTTON_GESTURES, available_width); } if (available_width > 0) { - processShowButton(RS_BUTTON_MOVEMENT, &available_width); + processShowButton(RS_BUTTON_MOVEMENT, available_width); } if (available_width > 0) { - processShowButton(RS_BUTTON_CAMERA, &available_width); + processShowButton(RS_BUTTON_CAMERA, available_width); } if (available_width > 0) { - processShowButton(RS_BUTTON_SNAPSHOT, &available_width); + processShowButton(RS_BUTTON_SNAPSHOT, available_width); } - processExtendButtons(&available_width); + processExtendButtons(available_width); // if we have to show/extend some buttons but resized delta width is not enough... S32 processed_width = total_available_width - available_width; @@ -853,7 +853,7 @@ void LLBottomTray::processWidthIncreased(S32 delta_width) } } -bool LLBottomTray::processShowButton(EResizeState shown_object_type, S32* available_width) +bool LLBottomTray::processShowButton(EResizeState shown_object_type, S32& available_width) { lldebugs << "Trying to show object type: " << shown_object_type << llendl; llassert(mStateProcessedObjectMap[shown_object_type] != NULL); @@ -869,15 +869,15 @@ bool LLBottomTray::processShowButton(EResizeState shown_object_type, S32* availa { //validate if we have enough room to show this button const S32 required_width = panel->getRect().getWidth(); - can_be_shown = *available_width >= required_width; + can_be_shown = available_width >= required_width; if (can_be_shown) { - *available_width -= required_width; + available_width -= required_width; setTrayButtonVisible(shown_object_type, true); lldebugs << "processed object type: " << shown_object_type - << ", rest available width: " << *available_width + << ", rest available width: " << available_width << llendl; mResizeState &= ~shown_object_type; } @@ -885,7 +885,7 @@ bool LLBottomTray::processShowButton(EResizeState shown_object_type, S32* availa return can_be_shown; } -void LLBottomTray::processHideButton(EResizeState processed_object_type, S32* required_width, S32* buttons_freed_width) +void LLBottomTray::processHideButton(EResizeState processed_object_type, S32& required_width, S32& buttons_freed_width) { lldebugs << "Trying to hide object type: " << processed_object_type << llendl; llassert(mStateProcessedObjectMap[processed_object_type] != NULL); @@ -899,11 +899,11 @@ void LLBottomTray::processHideButton(EResizeState processed_object_type, S32* re if (panel->getVisible()) { - *required_width += panel->getRect().getWidth(); + required_width += panel->getRect().getWidth(); - if (*required_width > 0) + if (required_width > 0) { - *buttons_freed_width += *required_width; + buttons_freed_width += required_width; } setTrayButtonVisible(processed_object_type, false); @@ -911,24 +911,24 @@ void LLBottomTray::processHideButton(EResizeState processed_object_type, S32* re mResizeState |= processed_object_type; lldebugs << "processing object type: " << processed_object_type - << ", buttons_freed_width: " << *buttons_freed_width + << ", buttons_freed_width: " << buttons_freed_width << llendl; } } -void LLBottomTray::processShrinkButtons(S32* required_width, S32* buttons_freed_width) +void LLBottomTray::processShrinkButtons(S32& required_width, S32& buttons_freed_width) { processShrinkButton(RS_BUTTON_CAMERA, required_width); - if (*required_width < 0) + if (required_width < 0) { processShrinkButton(RS_BUTTON_MOVEMENT, required_width); } - if (*required_width < 0) + if (required_width < 0) { processShrinkButton(RS_BUTTON_GESTURES, required_width); } - if (*required_width < 0) + if (required_width < 0) { S32 panel_min_width = 0; @@ -948,23 +948,23 @@ void LLBottomTray::processShrinkButtons(S32* required_width, S32* buttons_freed_ mSpeakBtn->setLabelVisible(false); mSpeakPanel->reshape(panel_width - possible_shrink_width, mSpeakPanel->getRect().getHeight()); - *required_width += possible_shrink_width; + required_width += possible_shrink_width; - if (*required_width > 0) + if (required_width > 0) { - *buttons_freed_width += *required_width; + buttons_freed_width += required_width; } lldebugs << "Shrunk panel: " << panel_name << ", shrunk width: " << possible_shrink_width - << ", rest width to process: " << *required_width + << ", rest width to process: " << required_width << llendl; } } } } -void LLBottomTray::processShrinkButton(EResizeState processed_object_type, S32* required_width) +void LLBottomTray::processShrinkButton(EResizeState processed_object_type, S32& required_width) { llassert(mStateProcessedObjectMap[processed_object_type] != NULL); LLPanel* panel = mStateProcessedObjectMap[processed_object_type]; @@ -992,63 +992,63 @@ void LLBottomTray::processShrinkButton(EResizeState processed_object_type, S32* // let calculate real width to shrink // 1. apply all possible width - *required_width += possible_shrink_width; + required_width += possible_shrink_width; // 2. it it is too much... - if (*required_width > 0) + if (required_width > 0) { // reduce applied shrunk width to the excessive value. - possible_shrink_width -= *required_width; - *required_width = 0; + possible_shrink_width -= required_width; + required_width = 0; } panel->reshape(panel_width - possible_shrink_width, panel->getRect().getHeight()); lldebugs << "Shrunk panel: " << panel_name << ", shrunk width: " << possible_shrink_width - << ", rest width to process: " << *required_width + << ", rest width to process: " << required_width << llendl; } } } -void LLBottomTray::processExtendButtons(S32* available_width) +void LLBottomTray::processExtendButtons(S32& available_width) { // do not allow extending any buttons if we have some buttons hidden if (mResizeState & RS_BUTTONS_CAN_BE_HIDDEN) return; processExtendButton(RS_BUTTON_GESTURES, available_width); - if (*available_width > 0) + if (available_width > 0) { processExtendButton(RS_BUTTON_MOVEMENT, available_width); } - if (*available_width > 0) + if (available_width > 0) { processExtendButton(RS_BUTTON_CAMERA, available_width); } - if (*available_width > 0) + if (available_width > 0) { 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) // HACK: this button doesn't change size so possible_extend_width will be 0 + 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()); log(mSpeakBtn, "speak button is extended"); - *available_width -= possible_extend_width; + available_width -= possible_extend_width; lldebugs << "Extending panel: " << mSpeakPanel->getName() << ", extended width: " << possible_extend_width - << ", rest width to process: " << *available_width + << ", rest width to process: " << available_width << llendl; } } } -void LLBottomTray::processExtendButton(EResizeState processed_object_type, S32* available_width) +void LLBottomTray::processExtendButton(EResizeState processed_object_type, S32& available_width) { llassert(mStateProcessedObjectMap[processed_object_type] != NULL); LLPanel* panel = mStateProcessedObjectMap[processed_object_type]; @@ -1069,20 +1069,20 @@ void LLBottomTray::processExtendButton(EResizeState processed_object_type, S32* // let calculate real width to extend // 1. apply all possible width - *available_width -= possible_extend_width; + available_width -= possible_extend_width; // 2. it it is too much... - if (*available_width < 0) + if (available_width < 0) { // reduce applied extended width to the excessive value. - possible_extend_width += *available_width; - *available_width = 0; + possible_extend_width += available_width; + available_width = 0; } panel->reshape(panel_width + possible_extend_width, panel->getRect().getHeight()); lldebugs << "Extending panel: " << panel->getName() << ", extended width: " << possible_extend_width - << ", rest width to process: " << *available_width + << ", rest width to process: " << available_width << llendl; } } @@ -1226,7 +1226,7 @@ bool LLBottomTray::setVisibleAndFitWidths(EResizeState object_type, bool visible current_width = result_width; } - is_set = processShowButton(object_type, ¤t_width); + is_set = processShowButton(object_type, current_width); // Shrink buttons if needed if (is_set && decrease_width) -- cgit v1.2.3