diff -r a8f868007986 -r 47558eb29a04 doc/contributions.txt --- a/doc/contributions.txt Tue Mar 29 19:32:41 2011 -0400 +++ b/doc/contributions.txt Wed Apr 13 15:25:19 2011 -0400 @@ -413,7 +413,7 @@ STORM-1019 STORM-1020 STORM-1064 - STORM-1077 + STORM-1095 Kage Pixel VWR-11 Ken March @@ -643,7 +643,7 @@ SNOW-747 STORM-422 STORM-960 - STORM-1019 + STORM-1095 VWR-2488 VWR-9557 VWR-10579 diff -r a8f868007986 -r 47558eb29a04 indra/llui/lllineeditor.h --- a/indra/llui/lllineeditor.h Tue Mar 29 19:32:41 2011 -0400 +++ b/indra/llui/lllineeditor.h Wed Apr 13 15:25:19 2011 -0400 @@ -201,6 +201,7 @@ const LLColor4& getTentativeFgColor() const { return mTentativeFgColor.get(); } const LLFontGL* getFont() const { return mGLFont; } + void setFont(const LLFontGL* font); void setIgnoreArrowKeys(BOOL b) { mIgnoreArrowKeys = b; } void setIgnoreTab(BOOL b) { mIgnoreTab = b; } diff -r a8f868007986 -r 47558eb29a04 indra/llui/lllineeditor.cpp --- a/indra/llui/lllineeditor.cpp Tue Mar 29 19:32:41 2011 -0400 +++ b/indra/llui/lllineeditor.cpp Wed Apr 13 15:25:19 2011 -0400 @@ -2290,3 +2290,8 @@ else mContextMenuHandle.markDead(); } + +void LLLineEditor::setFont(const LLFontGL* font) +{ + mGLFont = font; +} diff -r a8f868007986 -r 47558eb29a04 indra/newview/llbottomtray.cpp --- a/indra/newview/llbottomtray.cpp Tue Mar 29 19:32:41 2011 -0400 +++ b/indra/newview/llbottomtray.cpp Wed Apr 13 15:25:19 2011 -0400 @@ -55,6 +55,7 @@ #include "llviewerwindow.h" #include "llsdserialize.h" +#include "llviewerchat.h" #include "llfirstuse.h" // Distance from mouse down on which drag'n'drop should be started. @@ -556,6 +557,9 @@ mNearbyChatBar = findChild("chat_bar"); LLHints::registerHintTarget("chat_bar", mNearbyChatBar->LLView::getHandle()); + LLFontGL* font = LLViewerChat::getChatFont(); + mNearbyChatBar->getChatBox()->setFont(font); + mChatBarContainer = getChild("chat_bar_layout_panel"); mNearbyCharResizeHandlePanel = getChild("chat_bar_resize_handle_panel"); diff -r a8f868007986 -r 47558eb29a04 indra/newview/llfloaterpreference.cpp --- a/indra/newview/llfloaterpreference.cpp Tue Mar 29 19:32:41 2011 -0400 +++ b/indra/newview/llfloaterpreference.cpp Wed Apr 13 15:25:19 2011 -0400 @@ -390,6 +390,8 @@ 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("pref core"); diff -r a8f868007986 -r 47558eb29a04 indra/newview/llnearbychatbar.h --- a/indra/newview/llnearbychatbar.h Tue Mar 29 19:32:41 2011 -0400 +++ b/indra/newview/llnearbychatbar.h Wed Apr 13 15:25:19 2011 -0400 @@ -36,7 +36,6 @@ #include "llspeakers.h" #include "llbottomtray.h" - class LLGestureComboList : public LLGestureManagerObserver , public LLUICtrl @@ -115,6 +114,7 @@ static void startChat(const char* line); static void stopChat(); + void onChatFontChange(LLFontGL* fontp); static void sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate); static void sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate); diff -r a8f868007986 -r 47558eb29a04 indra/newview/llnearbychatbar.cpp --- a/indra/newview/llnearbychatbar.cpp Tue Mar 29 19:32:41 2011 -0400 +++ b/indra/newview/llnearbychatbar.cpp Wed Apr 13 15:25:19 2011 -0400 @@ -47,6 +47,7 @@ #include "llwindow.h" #include "llviewerwindow.h" #include "llrootview.h" +#include "llviewerchat.h" S32 LLNearbyChatBar::sLastSpecialChatChannel = 0; @@ -437,9 +438,21 @@ mOutputMonitor = getChild("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 -r a8f868007986 -r 47558eb29a04 indra/newview/llviewerchat.h --- a/indra/newview/llviewerchat.h Tue Mar 29 19:32:41 2011 -0400 +++ b/indra/newview/llviewerchat.h Wed Apr 13 15:25:19 2011 -0400 @@ -35,15 +35,21 @@ class LLViewerChat { public: + typedef boost::signals2::signal 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(); static S32 getChatFontSize(); 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; }; diff -r a8f868007986 -r 47558eb29a04 indra/newview/llviewerchat.cpp --- a/indra/newview/llviewerchat.cpp Tue Mar 29 19:32:41 2011 -0400 +++ b/indra/newview/llviewerchat.cpp Wed Apr 13 15:25:19 2011 -0400 @@ -35,7 +35,7 @@ #include "llworld.h" #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 +256,18 @@ 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 + LLFontGL* fontp = getChatFont(); + + sChatFontChangedSignal(fontp); +}