diff options
author | Oz Linden <oz@lindenlab.com> | 2011-04-21 20:23:26 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-04-21 20:23:26 -0400 |
commit | b15dca22637b0b2c1947b758a93f51163fb48cf1 (patch) | |
tree | 80aa8e85d95dc2b2dc1085d9d504ce3ea552bf4e | |
parent | 79dceafdfd767e264e3a21e12cb73e52f57cfe06 (diff) | |
parent | 7577ec25a066c5bb9b39978e32b8da084b1916d7 (diff) |
merge changes for storm-1095
-rw-r--r-- | doc/contributions.txt | 2 | ||||
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llnearbychatbar.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llnearbychatbar.h | 1 | ||||
-rw-r--r-- | indra/newview/llviewerchat.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llviewerchat.h | 6 |
6 files changed, 39 insertions, 0 deletions
diff --git a/doc/contributions.txt b/doc/contributions.txt index 2e6b01abc2..a19967fd4d 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -424,6 +424,7 @@ Jonathan Yap STORM-1094 STORM-1077 STORM-953 + STORM-1095 Kage Pixel VWR-11 Ken March @@ -660,6 +661,7 @@ Robin Cornelius STORM-422 STORM-960 STORM-1019 + STORM-1095 VWR-2488 VWR-9557 VWR-10579 diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index c72cf13745..b4b12024aa 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -411,6 +411,8 @@ BOOL LLFloaterPreference::postBuild() gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&LLNearbyChat::processChatHistoryStyleUpdate, _2)); + gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&LLViewerChat::signalChatFontChanged)); + gSavedSettings.getControl("ChatBubbleOpacity")->getSignal()->connect(boost::bind(&LLFloaterPreference::onNameTagOpacityChange, this, _2)); LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core"); diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 162e465fef..d3fd959152 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -47,6 +47,7 @@ #include "llwindow.h" #include "llviewerwindow.h" #include "llrootview.h" +#include "llviewerchat.h" S32 LLNearbyChatBar::sLastSpecialChatChannel = 0; @@ -433,13 +434,26 @@ BOOL LLNearbyChatBar::postBuild() mChatBox->setPassDelete(TRUE); mChatBox->setReplaceNewlinesWithSpaces(FALSE); mChatBox->setEnableLineHistory(TRUE); + mChatBox->setFont(LLViewerChat::getChatFont()); mOutputMonitor = getChild<LLOutputMonitorCtrl>("chat_zone_indicator"); mOutputMonitor->setVisible(FALSE); + // Register for font change notifications + LLViewerChat::setFontChangedCallback(boost::bind(&LLNearbyChatBar::onChatFontChange, this, _1)); + return TRUE; } +void LLNearbyChatBar::onChatFontChange(LLFontGL* fontp) +{ + // Update things with the new font whohoo + if (mChatBox) + { + mChatBox->setFont(fontp); + } +} + //static LLNearbyChatBar* LLNearbyChatBar::getInstance() { diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index 96ab45071b..efddec942f 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -127,6 +127,7 @@ protected: void sendChat( EChatType type ); void onChatBoxCommit(); + void onChatFontChange(LLFontGL* fontp); static LLWString stripChannelNumber(const LLWString &mesg, S32* channel); EChatType processChatTypeTriggers(EChatType type, std::string &str); diff --git a/indra/newview/llviewerchat.cpp b/indra/newview/llviewerchat.cpp index 286b16bab2..f5484ff010 100644 --- a/indra/newview/llviewerchat.cpp +++ b/indra/newview/llviewerchat.cpp @@ -36,6 +36,7 @@ #include "llinstantmessage.h" //SYSTEM_FROM // LLViewerChat +LLViewerChat::font_change_signal_t LLViewerChat::sChatFontChangedSignal; //static void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color) @@ -256,3 +257,16 @@ std::string LLViewerChat::getObjectImSLURL(const LLChat& chat, const LLSD& args) return url; } + +//static +boost::signals2::connection LLViewerChat::setFontChangedCallback(const font_change_signal_t::slot_type& cb) +{ + return sChatFontChangedSignal.connect(cb); +} + +//static +void LLViewerChat::signalChatFontChanged() +{ + // Notify all observers that our font has changed + sChatFontChangedSignal(getChatFont()); +} diff --git a/indra/newview/llviewerchat.h b/indra/newview/llviewerchat.h index 0f15d29f04..c05caf0a95 100644 --- a/indra/newview/llviewerchat.h +++ b/indra/newview/llviewerchat.h @@ -35,6 +35,8 @@ class LLViewerChat { public: + typedef boost::signals2::signal<void (LLFontGL*)> font_change_signal_t; + static void getChatColor(const LLChat& chat, LLColor4& r_color); static void getChatColor(const LLChat& chat, std::string& r_color_name, F32& r_color_alpha); static LLFontGL* getChatFont(); @@ -42,8 +44,12 @@ public: static void formatChatMsg(const LLChat& chat, std::string& formated_msg); static std::string getSenderSLURL(const LLChat& chat, const LLSD& args); + static boost::signals2::connection setFontChangedCallback(const font_change_signal_t::slot_type& cb); + static void signalChatFontChanged(); + private: static std::string getObjectImSLURL(const LLChat& chat, const LLSD& args); + static font_change_signal_t sChatFontChangedSignal; }; |