From 2c0814b00a26d99de00161f9307e706a49251017 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 22 Sep 2020 18:26:23 +0300 Subject: SL-13335 Friendlier L$ Buy flow when no payment method on file --- indra/newview/lltoastalertpanel.cpp | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'indra/newview/lltoastalertpanel.cpp') diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index 6a29be4aa1..af8cb8b5cb 100644 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -121,6 +121,15 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal data.mURLExternal = mNotification->getURLOpenExternally(); } + if((*it).has("width")) + { + data.mWidth = (*it)["width"].asInteger(); + } + else + { + data.mWidth = 0; + } + mButtonData.push_back(data); option_index++; } @@ -159,15 +168,29 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal // Calc total width of buttons S32 button_width = 0; S32 sp = font->getWidth(std::string("OO")); + S32 btn_total_width = 0; + S32 default_size_btns = 0; for( S32 i = 0; i < num_options; i++ ) - { + { S32 w = S32(font->getWidth( options[i].second ) + 0.99f) + sp + 2 * LLBUTTON_H_PAD; - button_width = llmax( w, button_width ); + if (mButtonData[i].mWidth > w) + { + btn_total_width += mButtonData[i].mWidth; + } + else + { + button_width = llmax(w, button_width); + default_size_btns++; + } } - S32 btn_total_width = button_width; + if( num_options > 1 ) { - btn_total_width = (num_options * button_width) + ((num_options - 1) * BTN_HPAD); + btn_total_width = btn_total_width + (button_width * default_size_btns) + ((num_options - 1) * BTN_HPAD); + } + else + { + btn_total_width = llmax(btn_total_width, button_width); } // Message: create text box using raw string, as text has been structure deliberately @@ -333,7 +356,7 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal if(btn) { btn->setName(options[i].first); - btn->setRect(button_rect.setOriginAndSize( button_left, VPAD, button_width, BTN_HEIGHT )); + btn->setRect(button_rect.setOriginAndSize( button_left, VPAD, (mButtonData[i].mWidth == 0) ? button_width : mButtonData[i].mWidth, BTN_HEIGHT )); btn->setLabel(options[i].second); btn->setFont(font); @@ -348,7 +371,7 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal btn->setFocus(TRUE); } } - button_left += button_width + BTN_HPAD; + button_left += ((mButtonData[i].mWidth == 0) ? button_width : mButtonData[i].mWidth) + BTN_HPAD; } setCheckBoxes(HPAD, VPAD); -- cgit v1.2.3 From 7ae4f766f03fa9046c30ee868697e7ec637b6ad0 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 23 Sep 2020 16:57:54 +0300 Subject: SL-13335 Init default button width --- indra/newview/lltoastalertpanel.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/newview/lltoastalertpanel.cpp') diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index af8cb8b5cb..4f46d1c0a2 100644 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -125,10 +125,6 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal { data.mWidth = (*it)["width"].asInteger(); } - else - { - data.mWidth = 0; - } mButtonData.push_back(data); option_index++; -- cgit v1.2.3 From d43d8bc68b4cbe40e2fb39dea0530a152463d1f9 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 23 Mar 2021 17:38:22 +0200 Subject: SL-14900 new Landmark creation flow --- indra/newview/lltoastalertpanel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/lltoastalertpanel.cpp') diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index 4f46d1c0a2..8baad30e8f 100644 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -291,7 +291,7 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal mLineEditor->setText(edit_text_contents); std::string notif_name = mNotification->getName(); - if (("SaveOutfitAs" == notif_name) || ("SaveSettingAs" == notif_name)) + if (("SaveOutfitAs" == notif_name) || ("SaveSettingAs" == notif_name) || ("CreateLandmarkFolder" == notif_name)) { mLineEditor->setPrevalidate(&LLTextValidate::validateASCII); } -- cgit v1.2.3