From 0f6242d9fd948cda1abf18885eef320b22d310c5 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 10 Nov 2009 14:00:38 -0800 Subject: Sanitize naming of getWindowRect (scaled vs. raw pixels) and getWorldViewRect (scaled vs. raw) Reduces chance of future UI bugs related to UI size. Discussed with Richard. --- indra/newview/llnearbychat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llnearbychat.cpp') diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 974291a54e..ac806d7106 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -290,7 +290,7 @@ void LLNearbyChat::setRect (const LLRect &rect) void LLNearbyChat::getAllowedRect(LLRect& rect) { - rect = gViewerWindow->getWorldViewRect(); + rect = gViewerWindow->getWorldViewRectRaw(); } -- cgit v1.2.3 From 11fc2da6fa5fba0bb659dd97f8533e4529aece06 Mon Sep 17 00:00:00 2001 From: angela Date: Thu, 12 Nov 2009 21:20:18 +0800 Subject: make color and font affecting both nearby chat and toasts --- indra/newview/llnearbychat.cpp | 107 ++++------------------------------------- 1 file changed, 9 insertions(+), 98 deletions(-) (limited to 'indra/newview/llnearbychat.cpp') diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index ac806d7106..85db69174d 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -132,120 +132,31 @@ void LLNearbyChat::applySavedVariables() } } -LLColor4 nearbychat_get_text_color(const LLChat& chat) -{ - LLColor4 text_color; - - if(chat.mMuted) - { - text_color.setVec(0.8f, 0.8f, 0.8f, 1.f); - } - else - { - switch(chat.mSourceType) - { - case CHAT_SOURCE_SYSTEM: - text_color = LLUIColorTable::instance().getColor("SystemChatColor"); - break; - case CHAT_SOURCE_AGENT: - if (chat.mFromID.isNull()) - { - text_color = LLUIColorTable::instance().getColor("SystemChatColor"); - } - else - { - if(gAgentID == chat.mFromID) - { - text_color = LLUIColorTable::instance().getColor("UserChatColor"); - } - else - { - text_color = LLUIColorTable::instance().getColor("AgentChatColor"); - } - } - break; - case CHAT_SOURCE_OBJECT: - if (chat.mChatType == CHAT_TYPE_DEBUG_MSG) - { - text_color = LLUIColorTable::instance().getColor("ScriptErrorColor"); - } - else if ( chat.mChatType == CHAT_TYPE_OWNER ) - { - text_color = LLUIColorTable::instance().getColor("llOwnerSayChatColor"); - } - else - { - text_color = LLUIColorTable::instance().getColor("ObjectChatColor"); - } - break; - default: - text_color.setToWhite(); - } - - if (!chat.mPosAgent.isExactlyZero()) - { - LLVector3 pos_agent = gAgent.getPositionAgent(); - F32 distance = dist_vec(pos_agent, chat.mPosAgent); - if (distance > gAgent.getNearChatRadius()) - { - // diminish far-off chat - text_color.mV[VALPHA] = 0.8f; - } - } - } - - return text_color; -} - -void LLNearbyChat::add_timestamped_line(const LLChat& chat, const LLColor4& color) -{ - S32 font_size = gSavedSettings.getS32("ChatFontSize"); - - const LLFontGL* fontp = NULL; - switch(font_size) - { - case 0: - fontp = LLFontGL::getFontSansSerifSmall(); - break; - default: - case 1: - fontp = LLFontGL::getFontSansSerif(); - break; - case 2: - fontp = LLFontGL::getFontSansSerifBig(); - break; - } - - LLStyle::Params style_params; - style_params.color(color); - style_params.font(fontp); - LLUUID uuid = chat.mFromID; - std::string from = chat.mFromName; - std::string message = chat.mText; - mChatHistory->appendWidgetMessage(chat, style_params); -} - void LLNearbyChat::addMessage(const LLChat& chat) { - LLColor4 color = nearbychat_get_text_color(chat); - if (chat.mChatType == CHAT_TYPE_DEBUG_MSG) { if(gSavedSettings.getBOOL("ShowScriptErrors") == FALSE) return; if (gSavedSettings.getS32("ShowScriptErrorsLocation")== 1)// show error in window //("ScriptErrorsAsChat")) { + + LLColor4 txt_color; + + LLViewerChat::getChatColor(chat,txt_color); + LLFloaterScriptDebug::addScriptLine(chat.mText, chat.mFromName, - color, + txt_color, chat.mFromID); return; } } - // could flash the chat button in the status bar here. JC if (!chat.mMuted) - add_timestamped_line(chat, color); + { + mChatHistory->appendWidgetMessage(chat); + } } void LLNearbyChat::onNearbySpeakers() -- cgit v1.2.3 From eeaeca81b9a0d35b12c047497dc388593b2e9f29 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Mon, 16 Nov 2009 14:13:36 +0200 Subject: fix for normal ticket EXT-2459 Nearby toasts aren't visible when nearby chat console is minimized --HG-- branch : product-engine --- indra/newview/llnearbychat.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llnearbychat.cpp') diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index ac806d7106..8bf964f0a7 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -292,5 +292,12 @@ void LLNearbyChat::getAllowedRect(LLRect& rect) { rect = gViewerWindow->getWorldViewRectRaw(); } - +void LLNearbyChat::setMinimized (BOOL minimize) +{ + if(minimize && !isDocked()) + { + setVisible(FALSE); + } + LLDockableFloater::setMinimized(minimize); +} -- cgit v1.2.3 From 1baf1d218644ac5dc00d9b41119a1ef168c709a2 Mon Sep 17 00:00:00 2001 From: angela Date: Mon, 16 Nov 2009 20:46:40 +0800 Subject: fix chat format for /me --- indra/newview/llnearbychat.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'indra/newview/llnearbychat.cpp') diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 85db69174d..68677decae 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -155,7 +155,33 @@ void LLNearbyChat::addMessage(const LLChat& chat) if (!chat.mMuted) { - mChatHistory->appendWidgetMessage(chat); + std::string message = chat.mText; + std::string prefix = message.substr(0, 4); + if (chat.mChatStyle == CHAT_STYLE_IRC) + { + LLStyle::Params append_style_params; + if (chat.mFromName.size() > 0) + { + append_style_params.italic= true; + LLChat add_chat=chat; + add_chat.mText = chat.mFromName + " "; + mChatHistory->appendWidgetMessage(add_chat, append_style_params); + } + message = message.substr(3); + + LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); + LLViewerChat::getChatColor(chat,txt_color); + LLFontGL* fontp = LLViewerChat::getChatFont(); + append_style_params.color(txt_color); + append_style_params.readonly_color(txt_color); + append_style_params.font(fontp); + append_style_params.underline = true; + mChatHistory->appendText(message, FALSE, append_style_params); + } + else + { + mChatHistory->appendWidgetMessage(chat); + } } } -- cgit v1.2.3 From b38ca5ec323beecd7fa431addb021199c85764f6 Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 16 Nov 2009 15:47:45 -0800 Subject: fix for UI scale != 1.0 breaking edit tools, web browser, world view rect, etc. --- indra/newview/llnearbychat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llnearbychat.cpp') diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 85db69174d..0c01fa821e 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -201,7 +201,7 @@ void LLNearbyChat::setRect (const LLRect &rect) void LLNearbyChat::getAllowedRect(LLRect& rect) { - rect = gViewerWindow->getWorldViewRectRaw(); + rect = gViewerWindow->getWorldViewRectScaled(); } -- cgit v1.2.3 From 0098bf40ea73078e2164ae55a8fa2f9049d0d4e9 Mon Sep 17 00:00:00 2001 From: angela Date: Tue, 17 Nov 2009 16:33:49 +0800 Subject: undo the changes for LLStyle params; add sizeFromFont in LLFontGL ; use font.style, font.name and font.size params for font creating --- indra/newview/llnearbychat.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'indra/newview/llnearbychat.cpp') diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 3af9448564..cae5c52378 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -157,25 +157,29 @@ void LLNearbyChat::addMessage(const LLChat& chat) { std::string message = chat.mText; std::string prefix = message.substr(0, 4); + if (chat.mChatStyle == CHAT_STYLE_IRC) { + LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); + LLViewerChat::getChatColor(chat,txt_color); + LLFontGL* fontp = LLViewerChat::getChatFont(); + std::string font_name = LLFontGL::nameFromFont(fontp); + std::string font_size = LLFontGL::sizeFromFont(fontp); LLStyle::Params append_style_params; + append_style_params.color(txt_color); + append_style_params.readonly_color(txt_color); + append_style_params.font.name(font_name); + append_style_params.font.size(font_size); if (chat.mFromName.size() > 0) { - append_style_params.italic= true; + append_style_params.font.style = "ITALIC"; LLChat add_chat=chat; add_chat.mText = chat.mFromName + " "; mChatHistory->appendWidgetMessage(add_chat, append_style_params); } - message = message.substr(3); - LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); - LLViewerChat::getChatColor(chat,txt_color); - LLFontGL* fontp = LLViewerChat::getChatFont(); - append_style_params.color(txt_color); - append_style_params.readonly_color(txt_color); - append_style_params.font(fontp); - append_style_params.underline = true; + message = message.substr(3); + append_style_params.font.style = "UNDERLINE"; mChatHistory->appendText(message, FALSE, append_style_params); } else -- cgit v1.2.3 From d43e33400a2ef9d89ed6d13067055b5b1edbde78 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Tue, 17 Nov 2009 14:33:07 +0200 Subject: implemented EXT-2515 "Docked floaters should be resizeable"; --HG-- branch : product-engine --- indra/newview/llnearbychat.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'indra/newview/llnearbychat.cpp') diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 029019a8dc..6cac5385b6 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -89,8 +89,6 @@ BOOL LLNearbyChat::postBuild() mChatHistory = getChild("chat_history"); - setCanResize(true); - if(!LLDockableFloater::postBuild()) return false; @@ -98,7 +96,7 @@ BOOL LLNearbyChat::postBuild() { setDockControl(new LLDockControl( LLBottomTray::getInstance()->getNearbyChatBar(), this, - getDockTongue(), LLDockControl::LEFT, boost::bind(&LLNearbyChat::getAllowedRect, this, _1))); + getDockTongue(), LLDockControl::TOP, boost::bind(&LLNearbyChat::getAllowedRect, this, _1))); } return true; @@ -187,13 +185,6 @@ void LLNearbyChat::onOpen(const LLSD& key ) } } -void LLNearbyChat::setDocked (bool docked, bool pop_on_undock) -{ - LLDockableFloater::setDocked(docked, pop_on_undock); - - setCanResize(!docked); -} - void LLNearbyChat::setRect (const LLRect &rect) { LLDockableFloater::setRect(rect); -- cgit v1.2.3 From a66aa0fd9a7aa20484521bf9b3809297e31466b0 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Tue, 17 Nov 2009 18:42:51 +0200 Subject: fixed major EXT-2551 Nearby Chat undocs after minimizing and opening (being docked before) --HG-- branch : product-engine --- indra/newview/llnearbychat.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'indra/newview/llnearbychat.cpp') diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index f1cd8e558f..16a47890c3 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -224,12 +224,3 @@ void LLNearbyChat::getAllowedRect(LLRect& rect) { rect = gViewerWindow->getWorldViewRectRaw(); } -void LLNearbyChat::setMinimized (BOOL minimize) -{ - if(minimize && !isDocked()) - { - setVisible(FALSE); - } - LLDockableFloater::setMinimized(minimize); -} - -- cgit v1.2.3 From 203490e2a0915c5ce59ccacba420388327f9143b Mon Sep 17 00:00:00 2001 From: James Cook Date: Wed, 18 Nov 2009 14:29:01 -0800 Subject: Change /me emote formatting to pure italics, not underlined. Review pending with Richard/Leyla --- indra/newview/llnearbychat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llnearbychat.cpp') diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 16a47890c3..1f984e3af8 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -177,7 +177,7 @@ void LLNearbyChat::addMessage(const LLChat& chat) } message = message.substr(3); - append_style_params.font.style = "UNDERLINE"; + append_style_params.font.style = "ITALIC"; mChatHistory->appendText(message, FALSE, append_style_params); } else -- cgit v1.2.3 From 9e403da7b0fd013371e73820b8aa70820f4f620b Mon Sep 17 00:00:00 2001 From: Sergey Borushevsky Date: Mon, 23 Nov 2009 20:34:06 +0200 Subject: Implemented major sub-task EXT-2517 (Add support for the viewer 1.23 chat history style (widget-less)) --HG-- branch : product-engine --- indra/newview/llnearbychat.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llnearbychat.cpp') diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 09fd9b2949..80a6cc343f 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -173,7 +173,7 @@ void LLNearbyChat::addMessage(const LLChat& chat) append_style_params.font.style = "ITALIC"; LLChat add_chat=chat; add_chat.mText = chat.mFromName + " "; - mChatHistory->appendWidgetMessage(add_chat, append_style_params); + mChatHistory->appendMessage(add_chat, false, append_style_params); } message = message.substr(3); @@ -182,7 +182,7 @@ void LLNearbyChat::addMessage(const LLChat& chat) } else { - mChatHistory->appendWidgetMessage(chat); + mChatHistory->appendMessage(chat); } } } -- cgit v1.2.3