summaryrefslogtreecommitdiff
path: root/indra/newview/lltoastnotifypanel.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <andreylproductengine@lindenlab.com>2016-04-14 23:06:31 +0300
committerAndrey Lihatskiy <andreylproductengine@lindenlab.com>2016-04-14 23:06:31 +0300
commita1b5593d15841c4d1b63316392ce0149552d4979 (patch)
tree1a2e54dd7c552a196f87a5bc5bae6ccd77a524b3 /indra/newview/lltoastnotifypanel.cpp
parentc436716d92f3f38686b8d138e8e52a378c044490 (diff)
parent64710a3279a23634d4cbbbcec3680ee6c3a21416 (diff)
Merged in andreyl_productengine/viewer-lion-marchcat (pull request #34)
MAINT-6248 + MAINT-6293 Notification toasts UI improvements
Diffstat (limited to 'indra/newview/lltoastnotifypanel.cpp')
-rwxr-xr-xindra/newview/lltoastnotifypanel.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index 98ed2f0fc4..1a8ade5b10 100755
--- a/indra/newview/lltoastnotifypanel.cpp
+++ b/indra/newview/lltoastnotifypanel.cpp
@@ -103,7 +103,7 @@ LLButton* LLToastNotifyPanel::createButton(const LLSD& form_element, BOOL is_opt
p.image_color_disabled(LLUIColorTable::instance().getColor("ButtonCautionImageColor"));
}
// for the scriptdialog buttons we use fixed button size. This is a limit!
- if (!mIsScriptDialog && font->getWidth(form_element["text"].asString()) > BUTTON_WIDTH)
+ if (!mIsScriptDialog && font->getWidth(form_element["text"].asString()) > (BUTTON_WIDTH-2*HPAD))
{
p.rect.width = 1;
p.auto_resize = true;
@@ -160,7 +160,11 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vector<index_button_pair
}
LLButton* btn = it->second;
LLRect btn_rect(btn->getRect());
- if (left + btn_rect.getWidth() > max_width)// whether there is still some place for button+h_pad in the mControlPanel
+ if (buttons.size() == 1) // for the one-button forms, center that button
+ {
+ left = (max_width - btn_rect.getWidth()) / 2;
+ }
+ else if (left + btn_rect.getWidth() > max_width)// whether there is still some place for button+h_pad in the mControlPanel
{
// looks like we need to add button to the next row
left = 0;