summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llchathistory.cpp12
-rw-r--r--indra/newview/llchiclet.cpp57
-rw-r--r--indra/newview/llchiclet.h19
-rw-r--r--indra/newview/llimfloater.cpp13
-rw-r--r--indra/newview/llscreenchannel.cpp21
-rw-r--r--indra/newview/llscriptfloater.cpp26
-rw-r--r--indra/newview/llscriptfloater.h4
-rw-r--r--indra/newview/skins/default/xui/en/panel_toast.xml3
-rw-r--r--indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml13
-rw-r--r--indra/newview/skins/default/xui/en/widgets/chiclet_im_group.xml16
-rw-r--r--indra/newview/skins/default/xui/en/widgets/chiclet_im_p2p.xml15
-rw-r--r--indra/newview/skins/default/xui/en/widgets/chiclet_offer.xml14
-rw-r--r--indra/newview/skins/default/xui/en/widgets/chiclet_script.xml14
13 files changed, 200 insertions, 27 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 2fc83c7e54..977f5c2bd0 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -577,23 +577,17 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_
view->reshape(target_rect.getWidth(), view->getRect().getHeight());
view->setOrigin(target_rect.mLeft, view->getRect().mBottom);
- std::string header_text = "[" + chat.mTimeStr + "] ";
+ std::string widget_associated_text = "\n[" + chat.mTimeStr + "] ";
if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM)
- header_text += chat.mFromName + delimiter;
+ widget_associated_text += chat.mFromName + delimiter;
- mEditor->appendWidget(p, header_text, false);
+ mEditor->appendWidget(p, widget_associated_text, false);
mLastFromName = chat.mFromName;
mLastFromID = chat.mFromID;
mLastMessageTime = new_message_time;
}
std::string message = irc_me ? chat.mText.substr(3) : chat.mText;
- if ( message.size() > 0 && !LLStringOps::isSpace(message[message.size() - 1]) )
- {
- // Ensure that message ends with NewLine, to avoid losing of new lines
- // while copy/paste from text chat. See EXT-3263.
- message += NEW_LINE;
- }
mEditor->appendText(message, FALSE, style_params);
mEditor->blockUndo();
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index 5cbe6f9670..f21fbbe6f5 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -453,6 +453,7 @@ LLIMChiclet::LLIMChiclet(const LLIMChiclet::Params& p)
, mNewMessagesIcon(NULL)
, mSpeakerCtrl(NULL)
, mCounterCtrl(NULL)
+, mChicletButton(NULL)
{
enableCounterControl(p.enable_counter);
}
@@ -576,6 +577,11 @@ void LLIMChiclet::onMouseDown()
setCounter(0);
}
+void LLIMChiclet::setToggleState(bool toggle)
+{
+ mChicletButton->setToggleState(toggle);
+}
+
BOOL LLIMChiclet::handleMouseDown(S32 x, S32 y, MASK mask)
{
onMouseDown();
@@ -634,6 +640,7 @@ LLIMChiclet::EType LLIMChiclet::getIMSessionType(const LLUUID& session_id)
LLIMP2PChiclet::Params::Params()
: avatar_icon("avatar_icon")
+, chiclet_button("chiclet_button")
, unread_notifications("unread_notifications")
, speaker("speaker")
, new_message_icon("new_message_icon")
@@ -646,6 +653,10 @@ LLIMP2PChiclet::LLIMP2PChiclet(const Params& p)
, mChicletIconCtrl(NULL)
, mPopupMenu(NULL)
{
+ LLButton::Params button_params = p.chiclet_button;
+ mChicletButton = LLUICtrlFactory::create<LLButton>(button_params);
+ addChild(mChicletButton);
+
LLIconCtrl::Params new_msg_params = p.new_message_icon;
mNewMessagesIcon = LLUICtrlFactory::create<LLIconCtrl>(new_msg_params);
addChild(mNewMessagesIcon);
@@ -760,6 +771,7 @@ void LLIMP2PChiclet::onMenuItemClicked(const LLSD& user_data)
LLAdHocChiclet::Params::Params()
: avatar_icon("avatar_icon")
+, chiclet_button("chiclet_button")
, unread_notifications("unread_notifications")
, speaker("speaker")
, new_message_icon("new_message_icon")
@@ -773,6 +785,10 @@ LLAdHocChiclet::LLAdHocChiclet(const Params& p)
, mChicletIconCtrl(NULL)
, mPopupMenu(NULL)
{
+ LLButton::Params button_params = p.chiclet_button;
+ mChicletButton = LLUICtrlFactory::create<LLButton>(button_params);
+ addChild(mChicletButton);
+
LLIconCtrl::Params new_msg_params = p.new_message_icon;
mNewMessagesIcon = LLUICtrlFactory::create<LLIconCtrl>(new_msg_params);
addChild(mNewMessagesIcon);
@@ -887,6 +903,7 @@ BOOL LLAdHocChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask)
LLIMGroupChiclet::Params::Params()
: group_icon("group_icon")
+, chiclet_button("chiclet_button")
, unread_notifications("unread_notifications")
, speaker("speaker")
, new_message_icon("new_message_icon")
@@ -900,6 +917,10 @@ LLIMGroupChiclet::LLIMGroupChiclet(const Params& p)
, mChicletIconCtrl(NULL)
, mPopupMenu(NULL)
{
+ LLButton::Params button_params = p.chiclet_button;
+ mChicletButton = LLUICtrlFactory::create<LLButton>(button_params);
+ addChild(mChicletButton);
+
LLIconCtrl::Params new_msg_params = p.new_message_icon;
mNewMessagesIcon = LLUICtrlFactory::create<LLIconCtrl>(new_msg_params);
addChild(mNewMessagesIcon);
@@ -1414,6 +1435,32 @@ S32 LLChicletPanel::notifyParent(const LLSD& info)
return LLPanel::notifyParent(info);
}
+void LLChicletPanel::setChicletToggleState(const LLUUID& session_id, bool toggle)
+{
+ if(session_id.isNull())
+ {
+ llwarns << "Null Session ID" << llendl;
+ }
+
+ // toggle off all chiclets, except specified
+ S32 size = getChicletCount();
+ for(int n = 0; n < size; ++n)
+ {
+ LLIMChiclet* chiclet = getChiclet<LLIMChiclet>(n);
+ if(chiclet && chiclet->getSessionId() != session_id)
+ {
+ chiclet->setToggleState(false);
+ }
+ }
+
+ // toggle specified chiclet
+ LLIMChiclet* chiclet = findChiclet<LLIMChiclet>(session_id);
+ if(chiclet)
+ {
+ chiclet->setToggleState(toggle);
+ }
+}
+
void LLChicletPanel::arrange()
{
if(mChicletList.empty())
@@ -1806,6 +1853,7 @@ LLChicletSpeakerCtrl::LLChicletSpeakerCtrl(const Params&p)
LLScriptChiclet::Params::Params()
: icon("icon")
+ , chiclet_button("chiclet_button")
, new_message_icon("new_message_icon")
{
}
@@ -1814,6 +1862,10 @@ LLScriptChiclet::LLScriptChiclet(const Params&p)
: LLIMChiclet(p)
, mChicletIconCtrl(NULL)
{
+ LLButton::Params button_params = p.chiclet_button;
+ mChicletButton = LLUICtrlFactory::create<LLButton>(button_params);
+ addChild(mChicletButton);
+
LLIconCtrl::Params new_msg_params = p.new_message_icon;
mNewMessagesIcon = LLUICtrlFactory::create<LLIconCtrl>(new_msg_params);
addChild(mNewMessagesIcon);
@@ -1862,6 +1914,7 @@ static const std::string INVENTORY_USER_OFFER ("UserGiveItem");
LLInvOfferChiclet::Params::Params()
: icon("icon")
+ , chiclet_button("chiclet_button")
, new_message_icon("new_message_icon")
{
}
@@ -1870,6 +1923,10 @@ LLInvOfferChiclet::LLInvOfferChiclet(const Params&p)
: LLIMChiclet(p)
, mChicletIconCtrl(NULL)
{
+ LLButton::Params button_params = p.chiclet_button;
+ mChicletButton = LLUICtrlFactory::create<LLButton>(button_params);
+ addChild(mChicletButton);
+
LLIconCtrl::Params new_msg_params = p.new_message_icon;
mNewMessagesIcon = LLUICtrlFactory::create<LLIconCtrl>(new_msg_params);
addChild(mNewMessagesIcon);
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index 3665e4d093..ae5b2148db 100644
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -422,6 +422,8 @@ public:
*/
virtual void onMouseDown();
+ virtual void setToggleState(bool toggle);
+
protected:
LLIMChiclet(const LLIMChiclet::Params& p);
@@ -438,7 +440,7 @@ protected:
LLIconCtrl* mNewMessagesIcon;
LLChicletNotificationCounterCtrl* mCounterCtrl;
LLChicletSpeakerCtrl* mSpeakerCtrl;
-
+ LLButton* mChicletButton;
/** the id of another participant, either an avatar id or a group id*/
LLUUID mOtherParticipantId;
@@ -473,6 +475,8 @@ class LLIMP2PChiclet : public LLIMChiclet
public:
struct Params : public LLInitParam::Block<Params, LLIMChiclet::Params>
{
+ Optional<LLButton::Params> chiclet_button;
+
Optional<LLChicletAvatarIconCtrl::Params> avatar_icon;
Optional<LLChicletNotificationCounterCtrl::Params> unread_notifications;
@@ -538,6 +542,8 @@ class LLAdHocChiclet : public LLIMChiclet
public:
struct Params : public LLInitParam::Block<Params, LLIMChiclet::Params>
{
+ Optional<LLButton::Params> chiclet_button;
+
Optional<LLChicletAvatarIconCtrl::Params> avatar_icon;
Optional<LLChicletNotificationCounterCtrl::Params> unread_notifications;
@@ -614,6 +620,8 @@ public:
struct Params : public LLInitParam::Block<Params, LLIMChiclet::Params>
{
+ Optional<LLButton::Params> chiclet_button;
+
Optional<LLIconCtrl::Params> icon;
Optional<LLIconCtrl::Params> new_message_icon;
@@ -656,6 +664,8 @@ public:
struct Params : public LLInitParam::Block<Params, LLIMChiclet::Params>
{
+ Optional<LLButton::Params> chiclet_button;
+
Optional<LLChicletInvOfferIconCtrl::Params> icon;
Optional<LLIconCtrl::Params> new_message_icon;
@@ -697,6 +707,8 @@ public:
struct Params : public LLInitParam::Block<Params, LLIMChiclet::Params>
{
+ Optional<LLButton::Params> chiclet_button;
+
Optional<LLChicletGroupIconCtrl::Params> group_icon;
Optional<LLChicletNotificationCounterCtrl::Params> unread_notifications;
@@ -1040,6 +1052,11 @@ public:
S32 notifyParent(const LLSD& info);
+ /**
+ * Toggle chiclet by session id ON and toggle OFF all other chiclets.
+ */
+ void setChicletToggleState(const LLUUID& session_id, bool toggle);
+
protected:
LLChicletPanel(const Params&p);
friend class LLUICtrlFactory;
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index aee34eb0af..eb3f1b1d10 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -115,6 +115,8 @@ LLIMFloater::LLIMFloater(const LLUUID& session_id)
void LLIMFloater::onFocusLost()
{
LLIMModel::getInstance()->resetActiveSessionID();
+
+ LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(mSessionID, false);
}
void LLIMFloater::onFocusReceived()
@@ -126,6 +128,8 @@ void LLIMFloater::onFocusReceived()
{
mInputEditor->setFocus(TRUE);
}
+
+ LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(mSessionID, true);
}
// virtual
@@ -490,6 +494,15 @@ void LLIMFloater::setVisible(BOOL visible)
updateMessages();
mInputEditor->setFocus(TRUE);
}
+
+ if(!visible)
+ {
+ LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(mSessionID);
+ if(chiclet)
+ {
+ chiclet->setToggleState(false);
+ }
+ }
}
//static
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index 0adc9fc258..a00b6a9288 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -47,6 +47,7 @@
#include "llsyswellwindow.h"
#include "llimfloater.h"
#include "llscriptfloater.h"
+#include "llfontgl.h"
#include <algorithm>
@@ -568,6 +569,7 @@ void LLScreenChannel::showToastsTop()
void LLScreenChannel::createStartUpToast(S32 notif_num, F32 timer)
{
LLRect toast_rect;
+ LLRect tbox_rect;
LLToast::Params p;
p.lifetime_secs = timer;
p.enable_hide_btn = false;
@@ -582,9 +584,26 @@ void LLScreenChannel::createStartUpToast(S32 notif_num, F32 timer)
std::string text = LLTrans::getString("StartUpNotifications");
+ tbox_rect = text_box->getRect();
+ S32 tbox_width = tbox_rect.getWidth();
+ S32 tbox_vpad = text_box->getVPad();
+ S32 text_width = text_box->getDefaultFont()->getWidth(text);
+ S32 text_height = text_box->getTextPixelHeight();
+
+ // EXT - 3703 (Startup toast message doesn't fit toast width)
+ // Calculating TextBox HEIGHT needed to include the whole string according to the given WIDTH of the TextBox.
+ S32 new_tbox_height = (text_width/tbox_width + 1) * text_height;
+ // Calculating TOP position of TextBox
+ S32 new_tbox_top = new_tbox_height + tbox_vpad + gSavedSettings.getS32("ToastGap");
+ // Calculating toast HEIGHT according to the new TextBox size
+ S32 toast_height = new_tbox_height + tbox_vpad * 2;
+
+ tbox_rect.setLeftTopAndSize(tbox_rect.mLeft, new_tbox_top, tbox_rect.getWidth(), new_tbox_height);
+ text_box->setRect(tbox_rect);
+
toast_rect = mStartUpToastPanel->getRect();
mStartUpToastPanel->reshape(getRect().getWidth(), toast_rect.getHeight(), true);
- toast_rect.setLeftTopAndSize(0, toast_rect.getHeight()+gSavedSettings.getS32("ToastGap"), getRect().getWidth(), toast_rect.getHeight());
+ toast_rect.setLeftTopAndSize(0, toast_height + gSavedSettings.getS32("ToastGap"), getRect().getWidth(), toast_height);
mStartUpToastPanel->setRect(toast_rect);
text_box->setValue(text);
diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp
index cf62d47362..0d9cf06bc3 100644
--- a/indra/newview/llscriptfloater.cpp
+++ b/indra/newview/llscriptfloater.cpp
@@ -72,6 +72,9 @@ LLScriptFloater::LLScriptFloater(const LLSD& key)
bool LLScriptFloater::toggle(const LLUUID& object_id)
{
+ // Force chiclet toggle on here because first onFocusReceived() will not toggle it on.
+ LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(object_id, true);
+
LLUUID notification_id = LLScriptFloaterManager::getInstance()->findNotificationId(object_id);
LLScriptFloater* floater = LLFloaterReg::findTypedInstance<LLScriptFloater>("script_floater", notification_id);
@@ -180,6 +183,15 @@ void LLScriptFloater::setVisible(BOOL visible)
LLDockableFloater::setVisible(visible);
hideToastsIfNeeded();
+
+ if(!visible)
+ {
+ LLIMChiclet* chiclet = LLBottomTray::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(getObjectId());
+ if(chiclet)
+ {
+ chiclet->setToggleState(false);
+ }
+ }
}
void LLScriptFloater::onMouseDown()
@@ -199,6 +211,20 @@ void LLScriptFloater::onMouseDown()
}
}
+void LLScriptFloater::onFocusLost()
+{
+ LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(getObjectId(), false);
+}
+
+void LLScriptFloater::onFocusReceived()
+{
+ // first focus will be received before setObjectId() call - don't toggle chiclet
+ if(getObjectId().notNull())
+ {
+ LLBottomTray::getInstance()->getChicletPanel()->setChicletToggleState(getObjectId(), true);
+ }
+}
+
void LLScriptFloater::hideToastsIfNeeded()
{
using namespace LLNotificationsUI;
diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h
index ed10dc5fe9..f86605c5d1 100644
--- a/indra/newview/llscriptfloater.h
+++ b/indra/newview/llscriptfloater.h
@@ -174,6 +174,10 @@ protected:
*/
void onMouseDown();
+ /*virtual*/ void onFocusLost();
+
+ /*virtual*/ void onFocusReceived();
+
private:
LLToastNotifyPanel* mScriptForm;
LLUUID mObjectId;
diff --git a/indra/newview/skins/default/xui/en/panel_toast.xml b/indra/newview/skins/default/xui/en/panel_toast.xml
index ba2d61afb7..d198237e5d 100644
--- a/indra/newview/skins/default/xui/en/panel_toast.xml
+++ b/indra/newview/skins/default/xui/en/panel_toast.xml
@@ -39,7 +39,8 @@
name="toast_text"
word_wrap="true"
text_color="white"
- top="5"
+ top="5"
+ v_pad="5"
use_ellipses="true"
width="260">
Toast text;
diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml
index 693c43f141..2bec5b8a29 100644
--- a/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml
+++ b/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml
@@ -4,6 +4,13 @@
name="im_adhoc_chiclet"
show_speaker="false"
width="25">
+ <chiclet_im_adhoc.chiclet_button
+ height="25"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ name="chiclet_button"
+ tab_stop="false"
+ width="25"/>
<chiclet_im_adhoc.speaker
auto_update="true"
draw_border="false"
@@ -13,11 +20,13 @@
visible="false"
width="20" />
<chiclet_im_adhoc.avatar_icon
+ bottom="3"
follows="left|top|bottom"
- height="22"
+ height="19"
+ left="3"
mouse_opaque="true"
name="adhoc_icon"
- width="22" />
+ width="19" />
<chiclet_im_adhoc.unread_notifications
font_halign="center"
height="25"
diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_im_group.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_im_group.xml
index f4fc58701c..1d7f3208af 100644
--- a/indra/newview/skins/default/xui/en/widgets/chiclet_im_group.xml
+++ b/indra/newview/skins/default/xui/en/widgets/chiclet_im_group.xml
@@ -4,6 +4,13 @@
name="im_group_chiclet"
show_speaker="false"
width="25">
+ <chiclet_im_group.chiclet_button
+ height="25"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ name="chiclet_button"
+ tab_stop="false"
+ width="25"/>
<chiclet_im_group.speaker
auto_update="true"
draw_border="false"
@@ -13,13 +20,14 @@
visible="false"
width="20" />
<chiclet_im_group.group_icon
+ bottom="3"
default_icon="Generic_Group"
follows="left|top|bottom"
- height="18"
- bottom_pad="4"
- mouse_opaque="true"
+ height="19"
+ left="3"
+ mouse_opaque="false"
name="group_icon"
- width="18" />
+ width="19" />
<chiclet_im_group.unread_notifications
height="25"
font_halign="center"
diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_im_p2p.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_im_p2p.xml
index 535113f717..e6289f7cef 100644
--- a/indra/newview/skins/default/xui/en/widgets/chiclet_im_p2p.xml
+++ b/indra/newview/skins/default/xui/en/widgets/chiclet_im_p2p.xml
@@ -4,6 +4,13 @@
name="im_p2p_chiclet"
show_speaker="false"
width="25">
+ <chiclet_im_p2p.chiclet_button
+ height="25"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ name="chiclet_button"
+ tab_stop="false"
+ width="25"/>
<chiclet_im_p2p.speaker
auto_update="true"
draw_border="false"
@@ -13,11 +20,13 @@
visible="false"
width="20"/>
<chiclet_im_p2p.avatar_icon
+ bottom="3"
follows="left|top|bottom"
- height="22"
- mouse_opaque="true"
+ height="19"
+ left="3"
+ mouse_opaque="false"
name="avatar_icon"
- width="22" />
+ width="19" />
<chiclet_im_p2p.unread_notifications
height="25"
font_halign="center"
diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_offer.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_offer.xml
index 86bea9be50..138b50c968 100644
--- a/indra/newview/skins/default/xui/en/widgets/chiclet_offer.xml
+++ b/indra/newview/skins/default/xui/en/widgets/chiclet_offer.xml
@@ -3,14 +3,22 @@
height="25"
name="offer_chiclet"
width="25">
+ <chiclet_offer.chiclet_button
+ height="25"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ name="chiclet_button"
+ tab_stop="false"
+ width="25"/>
<chiclet_offer.icon
+ bottom="3"
default_icon="Generic_Object_Small"
follows="all"
- height="20"
+ height="19"
+ left="3"
mouse_opaque="false"
name="chiclet_icon"
- bottom_pad="2"
- width="20" />
+ width="19" />
<chiclet_offer.new_message_icon
bottom="11"
height="14"
diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_script.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_script.xml
index b1f9f5b0e8..ecf149dc76 100644
--- a/indra/newview/skins/default/xui/en/widgets/chiclet_script.xml
+++ b/indra/newview/skins/default/xui/en/widgets/chiclet_script.xml
@@ -3,14 +3,22 @@
height="25"
name="script_chiclet"
width="25">
+ <chiclet_script.chiclet_button
+ height="25"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ name="chiclet_button"
+ tab_stop="false"
+ width="25"/>
<chiclet_script.icon
+ bottom="3"
follows="all"
- height="20"
+ height="19"
image_name="Generic_Object_Small"
+ left="3"
mouse_opaque="false"
name="chiclet_icon"
- width="20"
- bottom_pad="2" />
+ width="19"/>
<chiclet_script.new_message_icon
bottom="11"
height="14"