From 541e26d947e19cf087e068ab3f1bd46fb1d8fd4f Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 23 Aug 2011 07:55:34 -0400 Subject: STORM-1567 Mute button for llDialog popup Updating patch to current version of viewer-development --- indra/newview/lltoastnotifypanel.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'indra/newview/lltoastnotifypanel.cpp') diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index fa91f129b8..ea047a1878 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -305,10 +305,17 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vectorgetRect().getWidth(); LLButton* ignore_btn = NULL; + LLButton* mute_btn = NULL; for (std::vector::const_iterator it = buttons.begin(); it != buttons.end(); it++) { + if (-2 == it->first) + { + mute_btn = it->second; + continue; + } if (it->first == -1) { ignore_btn = it->second; @@ -328,6 +335,8 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vectoraddChild(btn, -1); } + + U32 ignore_btn_width = 0; if (mIsScriptDialog && ignore_btn != NULL) { LLRect ignore_btn_rect(ignore_btn->getRect()); @@ -337,11 +346,28 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vectorsetRect(ignore_btn_rect); + ignore_btn_width = ignore_btn_rect.getWidth(); mControlPanel->addChild(ignore_btn, -1); } + + if (mIsScriptDialog && mute_btn != NULL) + { + LLRect mute_btn_rect(mute_btn->getRect()); + S32 buttons_per_row = max_width / BUTTON_WIDTH; //assume that h_pad far less than BUTTON_WIDTH + S32 mute_btn_left = buttons_per_row * BUTTON_WIDTH + (buttons_per_row - 1) * h_pad - mute_btn_rect.getWidth() - ignore_btn_width - (h_pad / 2); + if (mute_btn_left + mute_btn_rect.getWidth() > max_width) // make sure that the mute button is in panel + { + mute_btn_left = max_width - mute_btn_rect.getWidth() - 2 * HPAD; + } + mute_btn_rect.setOriginAndSize(mute_btn_left, BOTTOM_PAD,// always move mute button at the bottom + mute_btn_rect.getWidth(), mute_btn_rect.getHeight()); + mute_btn->setRect(mute_btn_rect); + mControlPanel->addChild(mute_btn); + } } void LLToastNotifyPanel::adjustPanelForScriptNotice(S32 button_panel_width, S32 button_panel_height) -- cgit v1.2.3 From 1f486a9515d335e0156b23fa84eeb34cdf57cac1 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 26 Aug 2011 12:11:57 -0400 Subject: STORM-1567 Mute button for llDialog popup Made changes per RB feedback. --- indra/newview/lltoastnotifypanel.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/lltoastnotifypanel.cpp') diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index ea047a1878..6873cf058a 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -305,7 +305,6 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vectorgetRect().getWidth(); LLButton* ignore_btn = NULL; LLButton* mute_btn = NULL; @@ -346,7 +345,6 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vectorsetRect(ignore_btn_rect); @@ -358,6 +356,7 @@ void LLToastNotifyPanel::updateButtonsLayout(const std::vectorgetRect()); S32 buttons_per_row = max_width / BUTTON_WIDTH; //assume that h_pad far less than BUTTON_WIDTH + // Place mute (Block) button to the left of the ignore button. S32 mute_btn_left = buttons_per_row * BUTTON_WIDTH + (buttons_per_row - 1) * h_pad - mute_btn_rect.getWidth() - ignore_btn_width - (h_pad / 2); if (mute_btn_left + mute_btn_rect.getWidth() > max_width) // make sure that the mute button is in panel { -- cgit v1.2.3