summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrew Productengine <adyukov@productengine.com>2010-11-25 17:51:33 +0200
committerAndrew Productengine <adyukov@productengine.com>2010-11-25 17:51:33 +0200
commit2b39cf6c2d732c13517072c7c928588cdc41a3d1 (patch)
tree4dc7edadadf1549057bb0c81b4ad7f2cb78b5c96 /indra
parent65b3cd14caa9a53f528b1f4b9c1c838fc3ef803b (diff)
STORM-344 FIXED Fixed Speak button label shrinking when bottom bar has enough space for displaying full Speak label.
Bug was caused by counting only width added by last resize as usable for Speak button extending, so widening viewer window by few pixels many times when Speak is shrink would never let it expand regardless of available space. - Added check for possible chiclet panel shrinking width- cause spare space goes to it when extending. If there is enough space to give from chiclets to Speak, Speak is extended.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llbottomtray.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index 29c2b7565e..6ccb5aaf54 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -1365,20 +1365,33 @@ void LLBottomTray::processExtendButtons(S32& available_width)
processExtendButton(*it, available_width);
}
+ const S32 chiclet_panel_width = mChicletPanel->getParent()->getRect().getWidth();
+ static const S32 chiclet_panel_min_width = mChicletPanel->getMinWidth();
+ const S32 available_width_chiclet = chiclet_panel_width - chiclet_panel_min_width;
+
// then try to extend Speak button
- if (available_width > 0)
+ if (available_width > 0 || available_width_chiclet > 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 + available_width_chiclet) // 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;
-
+ if( available_width > possible_extend_width)
+ {
+ available_width -= possible_extend_width;
+ }
+ else
+ {
+ S32 required_width = possible_extend_width - available_width;
+ available_width = 0;
+ mChicletPanel->getParent()->reshape(mChicletPanel->getParent()->getRect().getWidth() - required_width, mChicletPanel->getParent()->getRect().getHeight());
+ }
lldebugs << "Extending Speak button panel: " << mSpeakPanel->getName()
<< ", extended width: " << possible_extend_width
<< ", rest width to process: " << available_width