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.
meow-7.2.2
Seth ProductEngine 2012-09-28 20:48:24 +03:00
parent 14307b099b
commit d54eded93b
3 changed files with 59 additions and 6 deletions

View File

@ -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

View File

@ -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;

View File

@ -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;
}