summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorSeth ProductEngine <slitovchuk@productengine.com>2012-09-28 20:48:24 +0300
committerSeth ProductEngine <slitovchuk@productengine.com>2012-09-28 20:48:24 +0300
commitd54eded93ba270402349f5f337bbe12339255ece (patch)
tree2b54bf634d259a09b076fc9e7854487d26814438 /indra
parent14307b099bdb0e7c5b56d052a55e010ecd69b5c3 (diff)
CHUI-357 FIXED moved conversation icon to prevent it being obscured when conversations list is minimized.
Added minimized mode for LLConversationViewSession: this mode is used to move the conversation icon within the item when the conversations panel is minimized.
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llconversationview.cpp39
-rwxr-xr-xindra/newview/llconversationview.h6
-rw-r--r--indra/newview/llimfloatercontainer.cpp20
3 files changed, 59 insertions, 6 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index c2898d9a47..d4eb551f7a 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -80,7 +80,8 @@ LLConversationViewSession::LLConversationViewSession(const LLConversationViewSes
mCallIconLayoutPanel(NULL),
mSessionTitle(NULL),
mSpeakingIndicator(NULL),
- mVoiceClientObserver(NULL)
+ mVoiceClientObserver(NULL),
+ mMinimizedMode(false)
{
}
@@ -168,15 +169,18 @@ void LLConversationViewSession::draw()
const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams<LLFolderViewItem>();
const BOOL show_context = (getRoot() ? getRoot()->getShowSelectionContext() : FALSE);
- // update the rotation angle of open folder arrow
- updateLabelRotation();
+ // we don't draw the open folder arrow in minimized mode
+ if (!mMinimizedMode)
+ {
+ // update the rotation angle of open folder arrow
+ updateLabelRotation();
- drawOpenFolderArrow(default_params, sFgColor);
+ drawOpenFolderArrow(default_params, sFgColor);
+ }
// draw highlight for selected items
drawHighlight(show_context, true, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor);
-
// draw children if root folder, or any other folder that is open or animating to closed state
bool draw_children = getRoot() == static_cast<LLFolderViewFolder*>(this)
|| isOpen()
@@ -201,7 +205,8 @@ void LLConversationViewSession::draw()
// virtual
S32 LLConversationViewSession::arrange(S32* width, S32* height)
{
- LLRect rect(getIndentation() + mArrowSize,
+ S32 h_pad = getIndentation() + mArrowSize;
+ LLRect rect(mMinimizedMode ? getLocalRect().mLeft : h_pad,
getLocalRect().mTop,
getLocalRect().mRight,
getLocalRect().mTop - getItemHeight());
@@ -210,6 +215,16 @@ S32 LLConversationViewSession::arrange(S32* width, S32* height)
return LLFolderViewFolder::arrange(width, height);
}
+// virtual
+void LLConversationViewSession::toggleOpen()
+{
+ // conversations should not be opened while in minimized mode
+ if (!mMinimizedMode)
+ {
+ LLFolderViewFolder::toggleOpen();
+ }
+}
+
void LLConversationViewSession::selectItem()
{
@@ -231,6 +246,18 @@ void LLConversationViewSession::selectItem()
LLFolderViewItem::selectItem();
}
+void LLConversationViewSession::toggleMinimizedMode(bool is_minimized)
+{
+ mMinimizedMode = is_minimized;
+
+ // hide the layout stack which contains all item's child widgets
+ // except for the icon which we display in minimized mode
+ getChild<LLView>("conversation_item_stack")->setVisible(!mMinimizedMode);
+
+ S32 h_pad = getIndentation() + mArrowSize;
+ mItemPanel->translate(mMinimizedMode ? -h_pad : h_pad, 0);
+}
+
void LLConversationViewSession::setVisibleIfDetached(BOOL visible)
{
// Do this only if the conversation floater has been torn off (i.e. no multi floater host) and is not minimized
diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h
index 064239eeb1..c81c70b456 100755
--- a/indra/newview/llconversationview.h
+++ b/indra/newview/llconversationview.h
@@ -67,6 +67,10 @@ public:
/*virtual*/ S32 arrange(S32* width, S32* height);
+ /*virtual*/ void toggleOpen();
+
+ void toggleMinimizedMode(bool is_minimized);
+
void setVisibleIfDetached(BOOL visible);
LLConversationViewParticipant* findParticipant(const LLUUID& participant_id);
@@ -83,6 +87,8 @@ private:
LLTextBox* mSessionTitle;
LLOutputMonitorCtrl* mSpeakingIndicator;
+ bool mMinimizedMode;
+
LLVoiceClientStatusObserver* mVoiceClientObserver;
boost::signals2::connection mActiveVoiceChannelConnection;
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index c6f0607b35..6f7eb7822a 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -133,6 +133,7 @@ BOOL LLIMFloaterContainer::postBuild()
p.listener = base_item;
p.view_model = &mConversationViewModel;
p.root = NULL;
+ p.use_ellipses = true;
mConversationsRoot = LLUICtrlFactory::create<LLFolderView>(p);
// a scroller for folder view
@@ -532,6 +533,22 @@ void LLIMFloaterContainer::collapseConversationsPane(bool collapse)
S32 collapsed_width = mConversationsPane->getMinDim();
updateState(collapse, gSavedPerAccountSettings.getS32("ConversationsListPaneWidth") - collapsed_width);
+
+ for (conversations_widgets_map::iterator widget_it = mConversationsWidgets.begin();
+ widget_it != mConversationsWidgets.end(); ++widget_it)
+ {
+ LLConversationViewSession* widget = dynamic_cast<LLConversationViewSession*>(widget_it->second);
+ if (widget)
+ {
+ widget->toggleMinimizedMode(collapse);
+
+ // force closing all open conversations when collapsing to minimized state
+ if (collapse)
+ {
+ widget->setOpen(false);
+ }
+ }
+ }
}
void LLIMFloaterContainer::updateState(bool collapse, S32 delta_width)
@@ -806,6 +823,9 @@ void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid)
setConvItemSelect(uuid);
+ // set the widget to minimized mode if conversations pane is collapsed
+ widget->toggleMinimizedMode(mConversationsPane->isCollapsed());
+
return;
}