summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorDmitry Zaporozhan <dzaporozhan@productengine.com>2010-01-19 12:42:33 +0200
committerDmitry Zaporozhan <dzaporozhan@productengine.com>2010-01-19 12:42:33 +0200
commit862ca3fa1628b0cef2e3db22f6c917a85492216f (patch)
tree06bb6c70d56f25c9f899c03bb439bf38e466d5f5 /indra/newview
parenta6429a6a14a2e40eae9ae623f3efb9244fa0748a (diff)
Fixed major bug EXT-4206 - Bottom bar spec calls for button background art on IM Chiclets.
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview')
-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/llscriptfloater.cpp26
-rw-r--r--indra/newview/llscriptfloater.h4
-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
10 files changed, 175 insertions, 16 deletions
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/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/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"