diff options
Diffstat (limited to 'indra/newview/lltoastnotifypanel.cpp')
| -rw-r--r-- | indra/newview/lltoastnotifypanel.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 0c4a9c81c2..e905a879cb 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -38,6 +38,7 @@ #include "llnotifications.h" #include "lluiconstants.h" #include "llrect.h" +#include "llstring.h" #include "lltrans.h" #include "llnotificationsutil.h" #include "llviewermessage.h" @@ -91,8 +92,24 @@ LLButton* LLToastNotifyPanel::createButton(const LLSD& form_element, bool is_opt 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 + + // Use Emoji font as exception if text contains red heart emoji (10084 U+2764) to ensure proper rendering + std::string font_name = mIsScriptDialog ? sFontScript : sFontDefault; + if (mIsScriptDialog) + { + LLWString wtext = utf8str_to_wstring(text); + for (llwchar ch : wtext) + { + if (ch == 0x2764) + { + font_name = "Emoji"; + break; + } + } + } + const LLFontGL* font = LLFontGL::getFont(LLFontDescriptor( - mIsScriptDialog ? sFontScript : sFontDefault, make_small_btn ? "Small" : "Medium", 0)); + font_name, make_small_btn ? "Small" : "Medium", 0)); p.name = name; p.label = text; p.tool_tip = text; @@ -284,7 +301,7 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images ) mIsScriptDialog = (notif_name == "ScriptDialog" || notif_name == "ScriptDialogGroup"); static LLCachedControl<S32> btn_width(gSavedSettings, "ToastButtonWidth", 90); - static LLCachedControl<S32> script_button_width(gSavedSettings, "ScriptToastButtonWidth", 110); + static LLCachedControl<S32> script_button_width(gSavedSettings, "ScriptToastButtonWidth", 127); mButtonWidth = mIsScriptDialog ? script_button_width : btn_width; bool is_content_trusted = (notif_name != "LoadWebPage"); |
