diff options
Diffstat (limited to 'indra/newview/llconversationview.cpp')
-rwxr-xr-x | indra/newview/llconversationview.cpp | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index d4eb551f7a..b7ebb70e86 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -32,6 +32,8 @@ #include <boost/bind.hpp> #include "llagentdata.h" #include "llconversationmodel.h" +#include "llimfloater.h" +#include "llnearbychat.h" #include "llimconversation.h" #include "llimfloatercontainer.h" #include "llfloaterreg.h" @@ -181,10 +183,8 @@ void LLConversationViewSession::draw() // 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() - || mCurHeight != mTargetHeight; + // Draw children if root folder, or any other folder that is open. Do not draw children when animating to closed state or you get rendering overlap. + bool draw_children = getRoot() == static_cast<LLFolderViewFolder*>(this) || isOpen(); for (folders_t::iterator iter = mFolders.begin(); iter != mFolders.end();) @@ -407,21 +407,50 @@ void LLConversationViewParticipant::draw() static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE); const BOOL show_context = (getRoot() ? getRoot()->getShowSelectionContext() : FALSE); - const BOOL filled = show_context || (getRoot() ? getRoot()->getParentPanel()->hasFocus() : FALSE); // If we have keyboard focus, draw selection filled const LLFontGL* font = getLabelFontForStyle(mLabelStyle); F32 right_x = 0; F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; F32 text_left = (F32)getLabelXPos(); - LLColor4 color = (mIsSelected && filled) ? sHighlightFgColor : sFgColor; + LLColor4 color = mIsSelected ? sHighlightFgColor : sFgColor; - drawHighlight(show_context, filled, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor); + drawHighlight(show_context, mIsSelected, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor); drawLabel(font, text_left, y, color, right_x); LLView::draw(); } +void LLConversationViewParticipant::selectItem() +{ + LLConversationItem* vmi = this->getParentFolder() ? static_cast<LLConversationItem*>(this->getParentFolder()->getViewModelItem()) : NULL; + LLIMFloaterContainer* container = LLIMFloaterContainer::getInstance(); + LLFloater* session_floater; + + //Only execute when switching floaters (conversations) + if(vmi && vmi->getUUID() != container->getSelectedSession()) + { + //When null, show the nearby chat conversation floater + if(vmi->getUUID().isNull()) + { + LLNearbyChat* nearbyChat = LLFloaterReg::findTypedInstance<LLNearbyChat>("nearby_chat"); + nearbyChat->show(); + } + //Otherwise, show the IM conversation floater + else + { + LLIMFloater::show(vmi->getUUID()); + } + } + //Focus the current conversation floater (it is already visible so just focus it) + else + { + session_floater = LLIMConversation::getConversation(vmi->getUUID()); + session_floater->setFocus(TRUE); + } + + LLFolderViewItem::selectItem(); +} void LLConversationViewParticipant::refresh() { |