diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index ac511d1c47..1e68f2a126 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-3.0.0a) | 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-3.0.0a) | 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-3.0.0a) | 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 5aa8eb6d9a..884fd678de 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-3.0.0a) | 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-3.0.0a) | 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/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index b06392658e..8f921af3d9 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-3.0.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 94ff6ebab5..29f4bfd32a 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)); @@ -30,10 +30,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) + { + onChatBoxCommit(CHAT_TYPE_SHOUT); + handled = TRUE; + } + else if (MASK_SHIFT == mask) + { + onChatBoxCommit(CHAT_TYPE_WHISPER); + handled = TRUE; + } } else if ( (KEY_UP == key) && (MASK_CONTROL == mask) ) { @@ -64,7 +72,7 @@ BOOL LLNearbyChatBarMulti::handleKeyHere(KEY key, MASK mask) return handled; } -void LLNearbyChatBarMulti::onChatBoxCommit() +void LLNearbyChatBarMulti::onChatBoxCommit(EChatType eChatType) { if (m_pChatEditor->getLength() > 0) { @@ -93,7 +101,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(); 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 b7fb783444..449928917d 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 @@ -87,14 +87,13 @@ commit_on_return="true" follows="all" height="45" + label="Click here to chat" layout="topleft" max_length="1024" name="chat_editor" use_ellipses="false" width="310" - 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"