summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2010-02-24 17:27:40 +0200
committerMike Antipov <mantipov@productengine.com>2010-02-24 17:27:40 +0200
commite40f22116762ddc629a8efb2057c81e6ffde3a99 (patch)
treeab4e394cf17dac3fc4492e03a9d00a38363247fd
parent08ede585ce33b2551d8e22bec5c5b3a5e345051f (diff)
Fixed major bug EXT-5589 (Notifications button falls under side panel)
-- added usage of max_width from layout_panel xml param instead of hardcoded in code. --HG-- branch : product-engine
-rw-r--r--indra/newview/llbottomtray.cpp21
-rw-r--r--indra/newview/skins/default/xui/en/panel_bottomtray.xml1
2 files changed, 17 insertions, 5 deletions
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index 3511328161..b88be53d79 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -60,7 +60,6 @@ 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";
- const S32 MAX_CHAT_BAR_WIDTH = 320;
S32 get_panel_min_width(LLLayoutStack* stack, LLPanel* panel)
{
@@ -73,6 +72,17 @@ namespace
return minimal_width;
}
+ S32 get_panel_max_width(LLLayoutStack* stack, LLPanel* panel)
+ {
+ S32 max_width = 0;
+ llassert(stack);
+ if ( stack && panel && panel->getVisible() )
+ {
+ stack->getPanelMaxSize(panel->getName(), &max_width, NULL);
+ }
+ return max_width;
+ }
+
S32 get_curr_width(LLUICtrl* ctrl)
{
S32 cur_width = 0;
@@ -746,10 +756,11 @@ void LLBottomTray::processWidthIncreased(S32 delta_width)
if (delta_width <= 0) return;
const S32 chiclet_panel_width = mChicletPanel->getParent()->getRect().getWidth();
- const S32 chiclet_panel_min_width = mChicletPanel->getMinWidth();
+ static const S32 chiclet_panel_min_width = mChicletPanel->getMinWidth();
const S32 chatbar_panel_width = mNearbyChatBar->getRect().getWidth();
- const S32 chatbar_panel_min_width = get_panel_min_width(mToolbarStack, mNearbyChatBar);
+ static const S32 chatbar_panel_min_width = get_panel_min_width(mToolbarStack, mNearbyChatBar);
+ static const S32 chatbar_panel_max_width = get_panel_max_width(mToolbarStack, mNearbyChatBar);
const S32 chatbar_available_shrink_width = chatbar_panel_width - chatbar_panel_min_width;
const S32 available_width_chiclet = chiclet_panel_width - chiclet_panel_min_width;
@@ -826,9 +837,9 @@ void LLBottomTray::processWidthIncreased(S32 delta_width)
// how many space can nearby chatbar take?
S32 chatbar_panel_width_ = mNearbyChatBar->getRect().getWidth();
- if (delta_width > 0 && chatbar_panel_width_ < MAX_CHAT_BAR_WIDTH)
+ if (delta_width > 0 && chatbar_panel_width_ < chatbar_panel_max_width)
{
- S32 delta_panel_max = MAX_CHAT_BAR_WIDTH - chatbar_panel_width_;
+ S32 delta_panel_max = chatbar_panel_max_width - chatbar_panel_width_;
S32 delta_panel = llmin(delta_width, delta_panel_max);
lldebugs << "Unprocesed delta width: " << delta_width
<< ", can be applied to chatbar: " << delta_panel_max
diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml
index 4c5d5a1b96..015a2e91ff 100644
--- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml
+++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml
@@ -47,6 +47,7 @@
min_height="23"
width="310"
top="4"
+ max_width="320"
min_width="216"
name="chat_bar"
user_resize="false"