diff options
author | Denis Serdjuk <dserduk@productengine.com> | 2010-03-09 13:42:39 +0200 |
---|---|---|
committer | Denis Serdjuk <dserduk@productengine.com> | 2010-03-09 13:42:39 +0200 |
commit | ded6723781fa87954b4bba9bee98f9a50c6f9d82 (patch) | |
tree | d56d9ad404ed98d3f53bb4724fa14d74f379c468 /indra/newview/lltoastnotifypanel.cpp | |
parent | b52c1682a8c103d99e5ebc702b0bae28971e1886 (diff) |
fixed Normal Bug EXT-5999 llDialog in 2.0 viewer has different text limits than in 1.23 viewer
Cause:
Dialog floater had arranged own shape to the shape of toast panel. So there is no way to change such behaviour from xml without changing of other toasts
Solution:
New param has been added to constructor of toast panel to make possible setting an initial shape of panel before update buttons layout
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/lltoastnotifypanel.cpp')
-rw-r--r-- | indra/newview/lltoastnotifypanel.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index c47c017143..e6d13a7613 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -53,7 +53,7 @@ S32 BUTTON_WIDTH = 90; const LLFontGL* LLToastNotifyPanel::sFont = NULL; const LLFontGL* LLToastNotifyPanel::sFontSmall = NULL; -LLToastNotifyPanel::LLToastNotifyPanel(LLNotificationPtr& notification) : +LLToastNotifyPanel::LLToastNotifyPanel(LLNotificationPtr& notification, const LLRect& rect) : LLToastPanel(notification), mTextBox(NULL), mInfoPanel(NULL), @@ -63,6 +63,10 @@ mNumButtons(0), mAddedDefaultBtn(false) { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_notification.xml"); + if(rect != LLRect::null) + { + this->setShape(rect); + } mInfoPanel = getChild<LLPanel>("info_panel"); mControlPanel = getChild<LLPanel>("control_panel"); BUTTON_WIDTH = gSavedSettings.getS32("ToastButtonWidth"); @@ -159,7 +163,12 @@ mAddedDefaultBtn(false) * for a scriptdialog toast h_pad can be < 2*HPAD if we have a lot of buttons. * In last case set default h_pad to avoid heaping of buttons */ - h_pad = 2*HPAD; + S32 button_per_row = button_panel_width / BUTTON_WIDTH; + h_pad = (button_panel_width % BUTTON_WIDTH) / (button_per_row - 1);// -1 because we do not need space after last button in a row + if(h_pad < 2*HPAD) // still not enough space between buttons ? + { + h_pad = 2*HPAD; + } } if (mIsScriptDialog) { @@ -224,7 +233,7 @@ LLButton* LLToastNotifyPanel::createButton(const LLSD& form_element, BOOL is_opt p.click_callback.function(boost::bind(&LLToastNotifyPanel::onClickButton, userdata)); p.rect.width = BUTTON_WIDTH; p.auto_resize = false; - p.follows.flags(FOLLOWS_RIGHT | FOLLOWS_LEFT | FOLLOWS_BOTTOM); + p.follows.flags(FOLLOWS_LEFT | FOLLOWS_BOTTOM); if (mIsCaution) { p.image_color(LLUIColorTable::instance().getColor("ButtonCautionImageColor")); |