From e284efa648b913595525d46d2c394cf827136fc9 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 19 Jan 2019 05:07:01 -0500 Subject: [PATCH] Improve notifications a bit (mainly lets you click links in notices) Actually respect the color they're supposed to be by setting text AFTER creation Don't double up with setEnabled, we're setting read only through the constructor Be Mouse Opaque, handle mouse events beyond scrolling, match group notices Don't call things more than once, that's nonsense. --- indra/newview/llgroupnotify.cpp | 1 - indra/newview/llnotify.cpp | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/indra/newview/llgroupnotify.cpp b/indra/newview/llgroupnotify.cpp index 0250af47e..982dfcad4 100644 --- a/indra/newview/llgroupnotify.cpp +++ b/indra/newview/llgroupnotify.cpp @@ -183,7 +183,6 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject, LLColor4 semi_transparent(1.0f,1.0f,1.0f,0.8f); text->setCursor(0,0); - text->setEnabled(FALSE); text->setWordWrap(TRUE); //text->setTabStop(FALSE); // was interfering with copy-and-paste text->setTabsToNextField(TRUE); diff --git a/indra/newview/llnotify.cpp b/indra/newview/llnotify.cpp index 3dc774d53..3556f4a63 100644 --- a/indra/newview/llnotify.cpp +++ b/indra/newview/llnotify.cpp @@ -234,19 +234,18 @@ LLNotifyBox::LLNotifyBox(LLNotificationPtr notification) const S32 MAX_LENGTH = 512 + 20 + DB_FIRST_NAME_BUF_SIZE + DB_LAST_NAME_BUF_SIZE + DB_INV_ITEM_NAME_BUF_SIZE; // For script dialogs: add space for title. - auto text = new LLTextEditor(std::string("box"), LLRect(x, y, getRect().getWidth()-2, mIsTip ? BOTTOM : BTN_TOP+16), MAX_LENGTH, message, sFont, FALSE, true); + auto text = new LLTextEditor(std::string("box"), LLRect(x, y, getRect().getWidth()-2, mIsTip ? BOTTOM : BTN_TOP+16), MAX_LENGTH, LLStringUtil::null, sFont, FALSE, true); text->setWordWrap(TRUE); - text->setTabStop(FALSE); - text->setMouseOpaque(FALSE); + text->setMouseOpaque(TRUE); text->setBorderVisible(FALSE); - text->setTakesNonScrollClicks(FALSE); + text->setTakesNonScrollClicks(TRUE); text->setHideScrollbarForShortDocs(TRUE); text->setReadOnlyBgColor ( LLColor4::transparent ); // the background color of the box is manually // rendered under the text box, therefore we want // the actual text box to be transparent text->setReadOnlyFgColor(gColors.getColor(mIsCaution && mIsTip ? "NotifyCautionWarnColor" : "NotifyTextColor")); //sets caution text color for tip notifications - text->setEnabled(FALSE); // makes it read-only text->setTabStop(FALSE); // can't tab to it (may be a problem for scrolling via keyboard) + text->setText(message); // Now we can set the text, since colors have been set. addChild(text); }