From d54eded93ba270402349f5f337bbe12339255ece Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Fri, 28 Sep 2012 20:48:24 +0300 Subject: 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. --- indra/newview/llconversationview.cpp | 39 ++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) (limited to 'indra/newview/llconversationview.cpp') 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(); 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(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("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 -- cgit v1.2.3