From ded6723781fa87954b4bba9bee98f9a50c6f9d82 Mon Sep 17 00:00:00 2001 From: Denis Serdjuk Date: Tue, 9 Mar 2010 13:42:39 +0200 Subject: 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 --- indra/newview/lltoastnotifypanel.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'indra/newview/lltoastnotifypanel.cpp') 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("info_panel"); mControlPanel = getChild("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")); -- cgit v1.2.3