CHUI-548: Now a p2p conversation is aligned with the nearby chat arrow. Just had to check for a p2p conversation type and then adjust then decrease the indentation. Also made LLFolderViewItem::drawOpenFolderArrow() a non-virtual function and adjusted code accordingly.
parent
a77a49af45
commit
80f8a465eb
|
|
@ -264,7 +264,7 @@ public:
|
|||
|
||||
// virtual void handleDropped();
|
||||
virtual void draw();
|
||||
virtual void drawOpenFolderArrow(const Params& default_params, const LLUIColor& fg_color);
|
||||
void drawOpenFolderArrow(const Params& default_params, const LLUIColor& fg_color);
|
||||
void drawHighlight(const BOOL showContent, const BOOL hasKeyboardFocus, const LLUIColor &bgColor, const LLUIColor &outlineColor, const LLUIColor &mouseOverColor);
|
||||
void drawLabel(const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x);
|
||||
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@ LLConversationViewSession::LLConversationViewSession(const LLConversationViewSes
|
|||
mSessionTitle(NULL),
|
||||
mSpeakingIndicator(NULL),
|
||||
mVoiceClientObserver(NULL),
|
||||
mMinimizedMode(false)
|
||||
mMinimizedMode(false),
|
||||
mHasArrow(true)
|
||||
{
|
||||
mFlashTimer = new LLFlashTimer();
|
||||
}
|
||||
|
|
@ -135,6 +136,7 @@ BOOL LLConversationViewSession::postBuild()
|
|||
icon->setVisible(true);
|
||||
icon->setValue(session->mOtherParticipantID);
|
||||
mSpeakingIndicator->setSpeakerId(gAgentID, session->mSessionID, true);
|
||||
mHasArrow = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -183,11 +185,10 @@ void LLConversationViewSession::draw()
|
|||
const BOOL show_context = (getRoot() ? getRoot()->getShowSelectionContext() : FALSE);
|
||||
|
||||
// we don't draw the open folder arrow in minimized mode
|
||||
if (!mMinimizedMode)
|
||||
if (mHasArrow && !mMinimizedMode)
|
||||
{
|
||||
// update the rotation angle of open folder arrow
|
||||
updateLabelRotation();
|
||||
|
||||
drawOpenFolderArrow(default_params, sFgColor);
|
||||
}
|
||||
|
||||
|
|
@ -227,14 +228,18 @@ BOOL LLConversationViewSession::handleMouseDown( S32 x, S32 y, MASK mask )
|
|||
// virtual
|
||||
S32 LLConversationViewSession::arrange(S32* width, S32* height)
|
||||
{
|
||||
S32 h_pad = getIndentation() + mArrowSize;
|
||||
//LLFolderViewFolder::arrange computes value for getIndentation() function below
|
||||
S32 arranged = LLFolderViewFolder::arrange(width, height);
|
||||
|
||||
S32 h_pad = mHasArrow ? getIndentation() + mArrowSize : getIndentation();
|
||||
|
||||
LLRect rect(mMinimizedMode ? getLocalRect().mLeft : h_pad,
|
||||
getLocalRect().mTop,
|
||||
getLocalRect().mRight,
|
||||
getLocalRect().mTop - getItemHeight());
|
||||
mItemPanel->setShape(rect);
|
||||
|
||||
return LLFolderViewFolder::arrange(width, height);
|
||||
return arranged;
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
|
@ -262,7 +267,8 @@ void LLConversationViewSession::toggleMinimizedMode(bool is_minimized)
|
|||
// except for the icon which we display in minimized mode
|
||||
getChild<LLView>("conversation_item_stack")->setVisible(!mMinimizedMode);
|
||||
|
||||
S32 h_pad = getIndentation() + mArrowSize;
|
||||
S32 h_pad = mHasArrow ? getIndentation() + mArrowSize : getIndentation();
|
||||
|
||||
mItemPanel->translate(mMinimizedMode ? -h_pad : h_pad, 0);
|
||||
}
|
||||
|
||||
|
|
@ -340,15 +346,6 @@ void LLConversationViewSession::onCurrentVoiceSessionChanged(const LLUUID& sessi
|
|||
}
|
||||
}
|
||||
|
||||
void LLConversationViewSession::drawOpenFolderArrow(const LLFolderViewItem::Params& default_params, const LLUIColor& fg_color)
|
||||
{
|
||||
LLConversationItem * itemp = dynamic_cast<LLConversationItem*>(getViewModelItem());
|
||||
if (itemp && itemp->getType() != LLConversationItem::CONV_SESSION_1_ON_1)
|
||||
{
|
||||
LLFolderViewFolder::drawOpenFolderArrow(default_params, fg_color);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Implementation of conversations list participant (avatar) widgets
|
||||
//
|
||||
|
|
|
|||
|
|
@ -74,8 +74,6 @@ public:
|
|||
|
||||
/*virtual*/ bool isMinimized() { return mMinimizedMode; }
|
||||
|
||||
/*virtual*/ void drawOpenFolderArrow(const LLFolderViewItem::Params& default_params, const LLUIColor& fg_color);
|
||||
|
||||
void toggleMinimizedMode(bool is_minimized);
|
||||
|
||||
void setVisibleIfDetached(BOOL visible);
|
||||
|
|
@ -98,6 +96,7 @@ private:
|
|||
LLFlashTimer* mFlashTimer;
|
||||
|
||||
bool mMinimizedMode;
|
||||
bool mHasArrow;
|
||||
|
||||
LLVoiceClientStatusObserver* mVoiceClientObserver;
|
||||
|
||||
|
|
|
|||
|
|
@ -1383,6 +1383,12 @@ LLConversationViewSession* LLFloaterIMContainer::createConversationItemWidget(LL
|
|||
params.tool_tip = params.name;
|
||||
params.container = this;
|
||||
|
||||
//Indentation for aligning the p2p converstation image with the nearby chat arrow
|
||||
if(item->getType() == LLConversationItem::CONV_SESSION_1_ON_1)
|
||||
{
|
||||
params.folder_indentation = 3;
|
||||
}
|
||||
|
||||
return LLUICtrlFactory::create<LLConversationViewSession>(params);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue