diff options
author | Merov Linden <merov@lindenlab.com> | 2013-02-05 21:13:06 -0800 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2013-02-05 21:13:06 -0800 |
commit | dadc5e84e189bca043870b192db7b8607d1d9daf (patch) | |
tree | a1f9a1cd172f4becf4c8dea21f27d51eed79f004 /indra | |
parent | 2aee8f6fbe2be3196300dd1ee6e31039de089207 (diff) | |
parent | 85f7f43069ea7ea47b4461fa1d7700339985ab35 (diff) |
Pull merge from lindenlab/viewer-chui
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/lltoastnotifypanel.cpp | 142 | ||||
-rw-r--r-- | indra/newview/lltoastpanel.cpp | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_notification.xml | 2 |
3 files changed, 14 insertions, 134 deletions
diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 0aab514531..bd6c42d474 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -223,104 +223,6 @@ void LLToastNotifyPanel::adjustPanelForTipNotice() } } -//typedef std::set<std::string> button_name_set_t; -//typedef std::map<std::string, button_name_set_t> disable_button_map_t; -// -//disable_button_map_t initUserGiveItemDisableButtonMap() -//{ -// // see EXT-5905 for disable rules -// -// disable_button_map_t disable_map; -// button_name_set_t buttons; -// -// buttons.insert("Show"); -// disable_map.insert(std::make_pair("Show", buttons)); -// -// buttons.insert("Discard"); -// disable_map.insert(std::make_pair("Discard", buttons)); -// -// buttons.insert("Mute"); -// disable_map.insert(std::make_pair("Mute", buttons)); -// -// return disable_map; -//} -// -//disable_button_map_t initTeleportOfferedDisableButtonMap() -//{ -// disable_button_map_t disable_map; -// button_name_set_t buttons; -// -// buttons.insert("Teleport"); -// buttons.insert("Cancel"); -// -// disable_map.insert(std::make_pair("Teleport", buttons)); -// disable_map.insert(std::make_pair("Cancel", buttons)); -// -// return disable_map; -//} -// -//disable_button_map_t initFriendshipOfferedDisableButtonMap() -//{ -// disable_button_map_t disable_map; -// button_name_set_t buttons; -// -// buttons.insert("Accept"); -// buttons.insert("Decline"); -// -// disable_map.insert(std::make_pair("Accept", buttons)); -// disable_map.insert(std::make_pair("Decline", buttons)); -// -// return disable_map; -//} -// -//button_name_set_t getButtonDisableList(const std::string& notification_name, const std::string& button_name) -//{ -// static disable_button_map_t user_give_item_disable_map = initUserGiveItemDisableButtonMap(); -// static disable_button_map_t teleport_offered_disable_map = initTeleportOfferedDisableButtonMap(); -// static disable_button_map_t friendship_offered_disable_map = initFriendshipOfferedDisableButtonMap(); -// -// disable_button_map_t::const_iterator it; -// disable_button_map_t::const_iterator it_end; -// disable_button_map_t search_map; -// -// if("UserGiveItem" == notification_name) -// { -// search_map = user_give_item_disable_map; -// } -// else if("TeleportOffered" == notification_name) -// { -// search_map = teleport_offered_disable_map; -// } -// else if("OfferFriendship" == notification_name) -// { -// search_map = friendship_offered_disable_map; -// } -// -// it = search_map.find(button_name); -// it_end = search_map.end(); -// -// if(it_end != it) -// { -// return it->second; -// } -// return button_name_set_t(); -//} - -//void LLToastNotifyPanel::disableButtons(const std::string& notification_name, const std::string& selected_button) -//{ - //button_name_set_t buttons = getButtonDisableList(notification_name, selected_button); - - //std::vector<index_button_pair_t>::const_iterator it = mButtons.begin(); - //for ( ; it != mButtons.end(); it++) - //{ - // LLButton* btn = it->second; - // if(buttons.find(btn->getName()) != buttons.end()) - // { - // btn->setEnabled(FALSE); - // } - //} -//} - // static void LLToastNotifyPanel::onClickButton(void* data) { @@ -352,7 +254,17 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images ) mNumButtons = 0; mAddedDefaultBtn = false; - buildFromFile( "panel_notification.xml"); + LLRect current_rect = getRect(); + + setXMLFilename(""); + buildFromFile("panel_notification.xml"); + + // reshape the panel to its previous size + if (current_rect.notEmpty()) + { + reshape(current_rect.getWidth(), current_rect.getHeight()); + } + if(rect != LLRect::null) { this->setShape(rect); @@ -491,37 +403,9 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images ) } } - // adjust panel's height to the text size - mInfoPanel->setFollowsAll(); snapToMessageHeight(mTextBox, MAX_LENGTH); } - - -//void LLToastNotifyPanel::onToastPanelButtonClicked(const LLUUID& notification_id, const std::string btn_name) -//{ -// if(mNotification->getID() == notification_id) -// { -// disableButtons(mNotification->getName(), btn_name); -// } -//} - -//void LLToastNotifyPanel::disableRespondedOptions(const LLNotificationPtr& notification) -//{ -// LLSD response = notification->getResponse(); -// for (LLSD::map_const_iterator response_it = response.beginMap(); -// response_it != response.endMap(); ++response_it) -// { -// if (response_it->second.isBoolean() && response_it->second.asBoolean()) -// { -// // that after multiple responses there can be many pressed buttons -// // need to process them all -// disableButtons(notification->getName(), response_it->first); -// } -// } -//} - - ////////////////////////////////////////////////////////////////////////// LLIMToastNotifyPanel::LLIMToastNotifyPanel(LLNotificationPtr& pNotification, const LLUUID& session_id, const LLRect& rect /* = LLRect::null */, @@ -538,13 +422,12 @@ LLIMToastNotifyPanel::~LLIMToastNotifyPanel() void LLIMToastNotifyPanel::reshape(S32 width, S32 height, BOOL called_from_parent /* = TRUE */) { + LLToastPanel::reshape(width, height, called_from_parent); snapToMessageHeight(mTextBox, MAX_LENGTH); } void LLIMToastNotifyPanel::compactButtons() { - mTextBox->setFollowsAll(); - //we can't set follows in xml since it broke toasts behavior setFollows(FOLLOWS_LEFT|FOLLOWS_RIGHT|FOLLOWS_TOP); @@ -590,6 +473,5 @@ void LLIMToastNotifyPanel::init( LLRect rect, bool show_images ) compactButtons(); } - // EOF diff --git a/indra/newview/lltoastpanel.cpp b/indra/newview/lltoastpanel.cpp index 54d3912136..187aee207c 100644 --- a/indra/newview/lltoastpanel.cpp +++ b/indra/newview/lltoastpanel.cpp @@ -81,9 +81,7 @@ void LLToastPanel::snapToMessageHeight(LLTextBase* message, S32 maxLineCount) S32 newTextHeight = llmin(requiredTextHeight, maxTextHeight); heightDelta = newTextHeight - oldTextHeight; - S32 new_panel_height = llmin( - llmax(getRect().getHeight() + heightDelta, MIN_PANEL_HEIGHT), - maxTextHeight); + S32 new_panel_height = llmax(getRect().getHeight() + heightDelta, MIN_PANEL_HEIGHT); //reshape the panel with new height if (new_panel_height != getRect().getHeight()) diff --git a/indra/newview/skins/default/xui/en/panel_notification.xml b/indra/newview/skins/default/xui/en/panel_notification.xml index 94c468e1bb..421ecf10a1 100644 --- a/indra/newview/skins/default/xui/en/panel_notification.xml +++ b/indra/newview/skins/default/xui/en/panel_notification.xml @@ -22,7 +22,7 @@ background_visible="true" bg_alpha_color="ToastBackground" bg_opaque_color="ToastBackground" - follows="left|right|top" + follows="all" height="100" label="info_panel" layout="topleft" |