From 121978b125e1ca7f9e94add8ab74202cd48f2362 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Mon, 5 Sep 2011 23:42:25 +0200 Subject: [PATCH 1/3] - fixed : "Click here to chat" hint text doesn't dissapear when focus is given to the multiline chatbar (thankies Mistress) --HG-- branch : Chat-NearbyChat --- indra/llui/lltextbase.cpp | 15 +++++++++++++++ indra/llui/lltextbase.h | 8 ++++++++ .../default/xui/en/floater_nearby_chat_multi.xml | 5 ++--- .../default/xui/en/widgets/simple_text_editor.xml | 1 + 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 6ae876f547..64de942365 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -144,6 +144,9 @@ LLTextBase::Params::Params() : cursor_color("cursor_color"), text_color("text_color"), text_readonly_color("text_readonly_color"), +// [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-09-05 (Catznip-2.8.0b) | Added: Catznip-2.8.0b + text_label_color("text_label_color"), +// [/SL:KB] bg_visible("bg_visible", false), border_visible("border_visible", false), bg_readonly_color("bg_readonly_color"), @@ -209,6 +212,10 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mIsSelecting( FALSE ), mPlainText ( p.plain_text ), mWordWrap(p.wrap), +// [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-09-05 (Catznip-2.8.0b) | Added: Catznip-2.8.0b + mLabel(p.label), + mLabelColor(p.text_label_color), +// [/SL:KB] mUseEllipses( p.use_ellipses ), mParseHTML(p.parse_urls), mParseHighlights(p.parse_highlights), @@ -503,6 +510,14 @@ void LLTextBase::drawText() const S32 text_len = getLength(); if( text_len <= 0 ) { +// [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-09-05 (Catznip-2.8.0b) | Added: Catznip-2.8.0b + if ( (!hasFocus()) && (mLabel.length()) ) + { + mDefaultFont->render( + mLabel.getWString(), 0, mLineInfoList.begin()->mRect.mLeft, mDocumentView->getRect().mBottom, mLabelColor, + LLFontGL::LEFT, LLFontGL::BOTTOM, 0, LLFontGL::NO_SHADOW, S32_MAX, mDocumentView->getRect().getWidth()); + } +// [/SL:KB] return; } S32 selection_left = -1; diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 4718883440..3cf1c40fc2 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -249,6 +249,9 @@ public: Optional cursor_color, text_color, text_readonly_color, +// [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-09-05 (Catznip-2.8.0b) | Added: Catznip-2.8.0b + text_label_color, +// [/SL:KB] bg_readonly_color, bg_writeable_color, bg_focus_color, @@ -572,6 +575,11 @@ protected: bool mScrollNeeded; // need to change scroll region because of change to cursor position S32 mScrollIndex; // index of first character to keep visible in scroll region +// [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-09-05 (Catznip-2.8.0b) | Added: Catznip-2.8.0b + LLUIString mLabel; + LLUIColor mLabelColor; +// [/SL:KB] + // Fired when a URL link is clicked commit_signal_t* mURLClickSignal; diff --git a/indra/newview/skins/default/xui/en/floater_nearby_chat_multi.xml b/indra/newview/skins/default/xui/en/floater_nearby_chat_multi.xml index 080b98585f..f14d3eaf66 100644 --- a/indra/newview/skins/default/xui/en/floater_nearby_chat_multi.xml +++ b/indra/newview/skins/default/xui/en/floater_nearby_chat_multi.xml @@ -104,14 +104,13 @@ commit_on_return="true" follows="left|right|bottom" height="50" + label="Click here to chat" layout="topleft" max_length="1024" name="chat_editor" use_ellipses="false" width="300" - word_wrap="true"> - Click here to chat - + word_wrap="true" /> diff --git a/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml b/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml index a120b1aec8..cfaa64e583 100644 --- a/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml @@ -15,6 +15,7 @@ default_color="TextDefaultColor" text_color="TextFgColor" text_readonly_color="TextFgReadOnlyColor" + text_label_color="TextFgTentativeColor" text_selected_color="White" h_pad="6" v_pad="4" From 2b74491d38877c01f08d3f5f12647c7db3762b90 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Mon, 5 Sep 2011 23:42:51 +0200 Subject: [PATCH 2/3] - added : Shift+Enter to whisper from the chatbar(s) --HG-- branch : Chat-NearbyChat --- indra/newview/llnearbychatbar.cpp | 8 ++++++++ indra/newview/llnearbychatbarmulti.cpp | 14 +++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 6cf603b3be..57a7b33dfd 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -501,6 +501,14 @@ BOOL LLNearbyChatBar::handleKeyHere( KEY key, MASK mask ) sendChat(CHAT_TYPE_SHOUT); handled = TRUE; } +// [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-08-20 (Catznip-2.8.0a) | Added: Catznip-2.8.0a + if ( (KEY_RETURN == key) && (mask == MASK_SHIFT) ) + { + // Whisper + sendChat(CHAT_TYPE_WHISPER); + handled = TRUE; + } +// [/SL:KB] return handled; } diff --git a/indra/newview/llnearbychatbarmulti.cpp b/indra/newview/llnearbychatbarmulti.cpp index 5fdf5eccfa..a91e55cccd 100644 --- a/indra/newview/llnearbychatbarmulti.cpp +++ b/indra/newview/llnearbychatbarmulti.cpp @@ -40,10 +40,18 @@ BOOL LLNearbyChatBarMulti::postBuild() BOOL LLNearbyChatBarMulti::handleKeyHere(KEY key, MASK mask) { BOOL handled = FALSE; - if ( (KEY_RETURN == key) && (MASK_CONTROL == mask) ) + if (KEY_RETURN == key) { - sendChat(CHAT_TYPE_SHOUT); - handled = TRUE; + if (MASK_CONTROL == mask) + { + sendChat(CHAT_TYPE_SHOUT); + handled = TRUE; + } + else if (MASK_SHIFT == mask) + { + sendChat(CHAT_TYPE_WHISPER); + handled = TRUE; + } } else if ( (KEY_UP == key) && (MASK_CONTROL == mask) ) { From dc15a97ec859a8909ce26f1dbbf9d84a514c5174 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Tue, 6 Sep 2011 00:56:07 +0200 Subject: [PATCH 3/3] - fixed : Ctrl+Enter'ing or Shift+Enter'ing chat in the multiline chat bar won't save the chat in the line history --HG-- branch : Chat-NearbyChat --- indra/newview/llnearbychatbarmulti.cpp | 10 +++++----- indra/newview/llnearbychatbarmulti.h | 4 +--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/indra/newview/llnearbychatbarmulti.cpp b/indra/newview/llnearbychatbarmulti.cpp index a91e55cccd..2966a94e28 100644 --- a/indra/newview/llnearbychatbarmulti.cpp +++ b/indra/newview/llnearbychatbarmulti.cpp @@ -16,7 +16,7 @@ BOOL LLNearbyChatBarMulti::postBuild() { m_pChatEditor = findChild("chat_editor"); - m_pChatEditor->setCommitCallback(boost::bind(&LLNearbyChatBarMulti::onChatBoxCommit, this)); + m_pChatEditor->setCommitCallback(boost::bind(&LLNearbyChatBarMulti::onChatBoxCommit, this, CHAT_TYPE_NORMAL)); m_pChatEditor->setKeystrokeCallback(boost::bind(&LLNearbyChatBarMulti::onChatBoxKeystroke, this, _1)); m_pChatEditor->setFocusLostCallback(boost::bind(&onChatBoxFocusLost, m_pChatEditor)); m_pChatEditor->setFocusReceivedCallback(boost::bind(&onChatBoxFocusReceived, m_pChatEditor)); @@ -44,12 +44,12 @@ BOOL LLNearbyChatBarMulti::handleKeyHere(KEY key, MASK mask) { if (MASK_CONTROL == mask) { - sendChat(CHAT_TYPE_SHOUT); + onChatBoxCommit(CHAT_TYPE_SHOUT); handled = TRUE; } else if (MASK_SHIFT == mask) { - sendChat(CHAT_TYPE_WHISPER); + onChatBoxCommit(CHAT_TYPE_WHISPER); handled = TRUE; } } @@ -82,7 +82,7 @@ BOOL LLNearbyChatBarMulti::handleKeyHere(KEY key, MASK mask) return handled; } -void LLNearbyChatBarMulti::onChatBoxCommit() +void LLNearbyChatBarMulti::onChatBoxCommit(EChatType eChatType) { if (m_pChatEditor->getLength() > 0) { @@ -111,7 +111,7 @@ void LLNearbyChatBarMulti::onChatBoxCommit() mCurrentHistoryLine = mLineHistory.end() - 1; // Send the chat - sendChat(CHAT_TYPE_NORMAL); + LLNearbyChatBarBase::sendChat(m_pChatEditor, eChatType); } gAgent.stopTyping(); diff --git a/indra/newview/llnearbychatbarmulti.h b/indra/newview/llnearbychatbarmulti.h index b6566fcd88..21580337b2 100644 --- a/indra/newview/llnearbychatbarmulti.h +++ b/indra/newview/llnearbychatbarmulti.h @@ -17,11 +17,9 @@ public: virtual BOOL postBuild(); protected: - void onChatBoxCommit(); + void onChatBoxCommit(EChatType eChatType); void onChatBoxKeystroke(LLTextEditor* pTextCtrl); - void sendChat(EChatType type) { LLNearbyChatBarBase::sendChat(m_pChatEditor, type); } - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); /*virtual*/ LLWString getChatBoxText();