summaryrefslogtreecommitdiff
path: root/indra/newview/llchiclet.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llchiclet.h')
-rw-r--r--indra/newview/llchiclet.h105
1 files changed, 68 insertions, 37 deletions
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index b50702205c..eab4a282f5 100644
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -107,6 +107,7 @@ public:
{
draw_tooltip(FALSE);
mouse_opaque(FALSE);
+ default_icon_name("Generic_Person");
};
};
@@ -128,7 +129,7 @@ public:
Optional<std::string> default_icon;
Params()
- : default_icon("default_icon", "default_land_picture.j2c")
+ : default_icon("default_icon", "Generic_Group")
{
};
};
@@ -147,13 +148,13 @@ protected:
};
/*
- * Class for displaying status of Voice Chat
+ * Class for displaying of speaker's voice indicator
*/
-class LLChicletSpeakerCtrl : public LLIconCtrl
+class LLChicletSpeakerCtrl : public LLOutputMonitorCtrl
{
public:
- struct Params : public LLInitParam::Block<Params, LLIconCtrl::Params>
+ struct Params : public LLInitParam::Block<Params, LLOutputMonitorCtrl::Params>
{
Params(){};
};
@@ -266,8 +267,6 @@ private:
* Base class for Instant Message chiclets.
* IMChiclet displays icon, number of unread messages(optional)
* and voice chat status(optional).
-* Every chiclet should override LLUICtrl::getRequiredRect and return
-* desired width.
*/
class LLIMChiclet : public LLChiclet
{
@@ -306,9 +305,14 @@ public:
virtual LLUUID getOtherParticipantId() { return mOtherParticipantId; }
/*
- * Shows/hides voice chat status control.
+ * Init Speaker Control with speaker's ID
*/
- virtual void setShowSpeaker(bool show) { mShowSpeaker = show; }
+ virtual void initSpeakerControl();
+
+ /*
+ * set status (Shows/Hide) for voice control.
+ */
+ virtual void setShowSpeaker(bool show);
/*
* Returns voice chat status control visibility.
@@ -316,6 +320,11 @@ public:
virtual bool getShowSpeaker() {return mShowSpeaker;};
/*
+ * Shows/Hides for voice control for a chiclet.
+ */
+ virtual void toggleSpeakerControl();
+
+ /*
* Shows/hides overlay icon concerning new unread messages.
*/
virtual void setShowNewMessagesIcon(bool show);
@@ -325,10 +334,7 @@ public:
*/
virtual bool getShowNewMessagesIcon();
- /*
- * Draws border around chiclet.
- */
- /*virtual*/ void draw();
+ virtual void draw();
/**
* Determine whether given ID refers to a group or an IM chat session.
@@ -363,6 +369,8 @@ protected:
LLIconCtrl* mNewMessagesIcon;
LLChicletNotificationCounterCtrl* mCounterCtrl;
+ LLChicletSpeakerCtrl* mSpeakerCtrl;
+
/** the id of another participant, either an avatar id or a group id*/
LLUUID mOtherParticipantId;
@@ -410,8 +418,6 @@ public:
/* virtual */ void setOtherParticipantId(const LLUUID& other_participant_id);
- /*virtual*/ void setShowSpeaker(bool show);
-
/*
* Sets number of unread messages. Will update chiclet's width if number text
* exceeds size of counter and notify it's parent about size change.
@@ -419,15 +425,14 @@ public:
/*virtual*/ void setCounter(S32);
/*
- * Returns number of unread messages.
+ * Init Speaker Control with speaker's ID
*/
- /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); }
+ /*virtual*/ void initSpeakerControl();
/*
- * Returns rect, required to display chiclet.
- * Width is the only valid value.
+ * Returns number of unread messages.
*/
- /*virtual*/ LLRect getRequiredRect();
+ /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); }
protected:
LLIMP2PChiclet(const Params& p);
@@ -457,7 +462,6 @@ protected:
private:
LLChicletAvatarIconCtrl* mChicletIconCtrl;
- LLChicletSpeakerCtrl* mSpeakerCtrl;
LLMenuGL* mPopupMenu;
};
@@ -495,15 +499,19 @@ public:
/*virtual*/ void setCounter(S32);
/*
- * Returns number of unread messages.
+ * Keep Speaker Control with actual speaker's ID
*/
- /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); }
+ /*virtual*/ void draw();
/*
- * Returns rect, required to display chiclet.
- * Width is the only valid value.
+ * Init Speaker Control with speaker's ID
*/
- /*virtual*/ LLRect getRequiredRect();
+ /*virtual*/ void initSpeakerControl();
+
+ /*
+ * Returns number of unread messages.
+ */
+ /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); }
protected:
LLAdHocChiclet(const Params& p);
@@ -514,10 +522,14 @@ protected:
*/
virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
+ /*
+ * Finds a current speaker and resets the SpeakerControl with speaker's ID
+ */
+ /*virtual*/ void switchToCurrentSpeaker();
+
private:
LLChicletAvatarIconCtrl* mChicletIconCtrl;
- LLChicletSpeakerCtrl* mSpeakerCtrl;
LLMenuGL* mPopupMenu;
};
@@ -547,14 +559,17 @@ public:
*/
/*virtual*/ void setSessionId(const LLUUID& session_id);
+ /*
+ * Keep Speaker Control with actual speaker's ID
+ */
+ /*virtual*/ void draw();
+
/**
* Callback for LLGroupMgrObserver, we get this when group data is available or changed.
* Sets group icon.
*/
/*virtual*/ void changed(LLGroupChange gc);
- /*virtual*/ void setShowSpeaker(bool show);
-
/*
* Sets number of unread messages. Will update chiclet's width if number text
* exceeds size of counter and notify it's parent about size change.
@@ -562,15 +577,14 @@ public:
/*virtual*/ void setCounter(S32);
/*
- * Returns number of unread messages.
+ * Init Speaker Control with speaker's ID
*/
- /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); }
+ /*virtual*/ void initSpeakerControl();
/*
- * Returns rect, required to display chiclet.
- * Width is the only valid value.
+ * Returns number of unread messages.
*/
- /*virtual*/ LLRect getRequiredRect();
+ /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); }
~LLIMGroupChiclet();
@@ -579,6 +593,11 @@ protected:
friend class LLUICtrlFactory;
/*
+ * Finds a current speaker and resets the SpeakerControl with speaker's ID
+ */
+ /*virtual*/ void switchToCurrentSpeaker();
+
+ /*
* Creates chiclet popup menu. Will create P2P or Group IM Chat menu
* based on other participant's id.
*/
@@ -597,7 +616,6 @@ protected:
private:
LLChicletGroupIconCtrl* mChicletIconCtrl;
- LLChicletSpeakerCtrl* mSpeakerCtrl;
LLMenuGL* mPopupMenu;
};
@@ -660,9 +678,6 @@ public:
Optional<S32> chiclet_padding,
scrolling_offset;
- Optional<LLButton::Params> left_scroll_button,
- right_scroll_button;
-
Optional<S32> min_width;
Params();
@@ -736,6 +751,11 @@ public:
/*virtual*/ BOOL postBuild();
/*
+ * Handler for the Voice Client's signal. Finds a corresponding chiclet and toggles its SpeakerControl
+ */
+ void onCurrentVoiceChannelChanged(const LLUUID& session_id);
+
+ /*
* Reshapes controls and rearranges chiclets if needed.
*/
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE );
@@ -812,6 +832,16 @@ protected:
void onRightScrollClick();
/*
+ * Callback for right scroll button held down event
+ */
+ void onLeftScrollHeldDown();
+
+ /*
+ * Callback for left scroll button held down event
+ */
+ void onRightScrollHeldDown();
+
+ /*
* Callback for mouse wheel scrolled, calls scrollRight() or scrollLeft()
*/
BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
@@ -851,6 +881,7 @@ protected:
S32 mScrollingOffset;
S32 mMinWidth;
bool mShowControls;
+ static const S32 s_scroll_ratio;
};
template<class T>