From b4d35c8d24d1095cdb67864b6576ef280b76c646 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Wed, 9 Sep 2009 02:31:31 -0700 Subject: Created my own version of Emerald's chat channel tool --- linden/indra/newview/llfloaterchat.cpp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'linden/indra/newview/llfloaterchat.cpp') diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp index 5117b8d..f624ec3 100644 --- a/linden/indra/newview/llfloaterchat.cpp +++ b/linden/indra/newview/llfloaterchat.cpp @@ -56,10 +56,11 @@ #include "llfloaterchatterbox.h" #include "llfloatermute.h" #include "llkeyboard.h" -//#include "lllineeditor.h" +#include "lllineeditor.h" #include "llmutelist.h" //#include "llresizehandle.h" #include "llchatbar.h" +#include "llspinctrl.h" #include "llstatusbar.h" #include "llviewertexteditor.h" #include "llviewergesture.h" // for triggering gestures @@ -223,6 +224,34 @@ void log_chat_text(const LLChat& chat) LLLogChat::saveHistory(std::string("chat"),histstr); } + +// static +void LLFloaterChat::toggleHistoryChannelControl() +{ + LLFloaterChat* chat_floater = LLFloaterChat::getInstance(LLSD()); + BOOL visible = gSavedSettings.getBOOL("ChatChannelSelect"); + BOOL control = chat_floater->getChild<LLSpinCtrl>("channel_control")->getVisible(); + + LLLineEditor* input = chat_floater->getChild<LLLineEditor>("Chat Editor"); + LLRect input_rect = input->getRect(); + S32 chan_width = chat_floater->getChild<LLSpinCtrl>("channel_control")->getRect().getWidth(); + + if (visible && !control) + { + input_rect.setLeftTopAndSize(input_rect.mLeft+chan_width+4, input_rect.mTop, + input_rect.getWidth()-chan_width, input_rect.getHeight()); + } + else if (!visible && control) + { + input_rect.setLeftTopAndSize(input_rect.mLeft-chan_width-4, input_rect.mTop, + input_rect.getWidth()+chan_width, input_rect.getHeight()); + } + input->setRect(input_rect); + + chat_floater->childSetVisible("channel_control", visible); + chat_floater->childSetEnabled("channel_control", visible); +} + // static void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) { -- cgit v1.1