summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lltoastnotifypanel.cpp36
-rw-r--r--indra/newview/lltoastnotifypanel.h22
-rw-r--r--indra/newview/skins/default/xui/en/panel_notification.xml16
3 files changed, 26 insertions, 48 deletions
diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp
index bf3f4c1e88..9db4bc4d3f 100644
--- a/indra/newview/lltoastnotifypanel.cpp
+++ b/indra/newview/lltoastnotifypanel.cpp
@@ -50,8 +50,8 @@ S32 BUTTON_WIDTH = 90;
//static
-const LLFontGL* LLToastNotifyPanel::sFont = NULL;
-const LLFontGL* LLToastNotifyPanel::sFontSmall = NULL;
+const std::string LLToastNotifyPanel::sFontDefault("Emoji");
+const std::string LLToastNotifyPanel::sFontScript("SansSerif");
LLToastNotifyPanel::button_click_signal_t LLToastNotifyPanel::sButtonClickSignal;
@@ -85,11 +85,15 @@ LLButton* LLToastNotifyPanel::createButton(const LLSD& form_element, BOOL is_opt
mBtnCallbackData.push_back(userdata);
LLButton::Params p;
- bool make_small_btn = form_element["index"].asInteger() == -1 || form_element["index"].asInteger() == -2;
- const LLFontGL* font = make_small_btn ? sFontSmall: sFont; // for block and ignore buttons in script dialog
- p.name = form_element["name"].asString();
- p.label = form_element["text"].asString();
- p.tool_tip = form_element["text"].asString();
+ S32 index = form_element["index"].asInteger();
+ std::string name = form_element["name"].asString();
+ std::string text = form_element["text"].asString();
+ bool make_small_btn = index == -1 || index == -2; // for block and ignore buttons in script dialog
+ const LLFontGL* font = LLFontGL::getFont(LLFontDescriptor(
+ mIsScriptDialog ? sFontScript : sFontDefault, make_small_btn ? "Small" : "Medium", 0));
+ p.name = name;
+ p.label = text;
+ p.tool_tip = text;
p.font = font;
p.rect.height = BTN_HEIGHT;
p.click_callback.function(boost::bind(&LLToastNotifyPanel::onClickButton, userdata));
@@ -256,19 +260,12 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images )
{
deleteAllChildren();
- mTextBox = NULL;
- mInfoPanel = NULL;
- mControlPanel = NULL;
- mNumOptions = 0;
- mNumButtons = 0;
- mAddedDefaultBtn = false;
-
LLRect current_rect = getRect();
setXMLFilename("");
buildFromFile("panel_notification.xml");
- if(rect != LLRect::null)
+ if (rect != LLRect::null)
{
this->setShape(rect);
}
@@ -295,12 +292,6 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images )
// setup parameters
// get a notification message
mMessage = mNotification->getMessage();
- // init font variables
- if (!sFont)
- {
- sFont = LLFontGL::getFontSansSerif();
- sFontSmall = LLFontGL::getFontSansSerifSmall();
- }
// initialize
setFocusRoot(!mIsTip);
// get a form for the notification
@@ -318,15 +309,18 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images )
if (mIsCaution && !mIsTip)
{
mTextBox = getChild<LLTextBox>("caution_text_box");
+ mTextBox->setFont(LLFontGL::getFont(LLFontDescriptor(mIsScriptDialog ? sFontScript : sFontDefault, "Medium", LLFontGL::BOLD)));
}
else
{
mTextBox = getChild<LLTextEditor>("text_editor_box");
+ mTextBox->setFont(LLFontGL::getFont(LLFontDescriptor(mIsScriptDialog ? sFontScript : sFontDefault, "Medium", 0)));
}
mTextBox->setMaxTextLength(LLToastPanel::MAX_TEXT_LENGTH);
mTextBox->setVisible(TRUE);
mTextBox->setPlainText(!show_images);
+ mTextBox->setUseEmoji(!mIsScriptDialog);
mTextBox->setContentTrusted(is_content_trusted);
mTextBox->setValue(mNotification->getMessage());
mTextBox->setIsFriendCallback(LLAvatarActions::isFriend);
diff --git a/indra/newview/lltoastnotifypanel.h b/indra/newview/lltoastnotifypanel.h
index a5a637c6fa..4a6c2ada8a 100644
--- a/indra/newview/lltoastnotifypanel.h
+++ b/indra/newview/lltoastnotifypanel.h
@@ -102,9 +102,9 @@ protected:
//std::vector<index_button_pair_t> mButtons;
// panel elements
- LLTextBase* mTextBox;
- LLPanel* mInfoPanel; // a panel, that contains an information
- LLPanel* mControlPanel; // a panel, that contains buttons (if present)
+ LLTextBase* mTextBox { nullptr };
+ LLPanel* mInfoPanel { nullptr }; // panel for text information
+ LLPanel* mControlPanel { nullptr }; // panel for buttons (if present)
// internal handler for button being clicked
static void onClickButton(void* data);
@@ -124,17 +124,17 @@ protected:
*/
//void disableRespondedOptions(const LLNotificationPtr& notification);
- bool mIsTip;
- bool mAddedDefaultBtn;
- bool mIsScriptDialog;
- bool mIsCaution;
+ bool mIsTip { false };
+ bool mAddedDefaultBtn { false };
+ bool mIsScriptDialog { false };
+ bool mIsCaution { false };
std::string mMessage;
- S32 mNumOptions;
- S32 mNumButtons;
+ S32 mNumOptions { 0 };
+ S32 mNumButtons { 0 };
- static const LLFontGL* sFont;
- static const LLFontGL* sFontSmall;
+ static const std::string sFontDefault;
+ static const std::string sFontScript;
};
class LLIMToastNotifyPanel : public LLToastNotifyPanel
diff --git a/indra/newview/skins/default/xui/en/panel_notification.xml b/indra/newview/skins/default/xui/en/panel_notification.xml
index e962c1449a..3ddf525d16 100644
--- a/indra/newview/skins/default/xui/en/panel_notification.xml
+++ b/indra/newview/skins/default/xui/en/panel_notification.xml
@@ -32,21 +32,6 @@
<text
border_visible="false"
follows="left|right|top|bottom"
- font="SansSerif"
- height="85"
- layout="topleft"
- left="10"
- name="text_box"
- read_only="true"
- text_color="White"
- top="10"
- visible="false"
- width="285"
- wrap="true"/>
- <text
- border_visible="false"
- follows="left|right|top|bottom"
- font="SansSerifBold"
height="85"
layout="topleft"
left="10"
@@ -64,7 +49,6 @@
embedded_items="false"
enabled="false"
follows="left|right|top|bottom"
- font="SansSerif"
height="85"
layout="topleft"
left="10"