From 5dc8738076d158aa74a93f7f3630a17d9102fdc4 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 10 Sep 2012 07:40:13 -0700 Subject: CHUI-283: Basic Implementation, just have hard coded avatar icon appearing and profile/info buttons visible. profile/info buttons do not have proper positioning or mouseclick events. --- indra/llcommon/llfoldertype.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 indra/llcommon/llfoldertype.h (limited to 'indra/llcommon/llfoldertype.h') diff --git a/indra/llcommon/llfoldertype.h b/indra/llcommon/llfoldertype.h old mode 100644 new mode 100755 index a0c847914f..6b5ae572a9 --- a/indra/llcommon/llfoldertype.h +++ b/indra/llcommon/llfoldertype.h @@ -89,7 +89,9 @@ public: FT_COUNT, - FT_NONE = -1 + FT_NONE = -1, + + FT_PROFILE = 58 }; static EType lookup(const std::string& type_name); -- cgit v1.3 From c6863d18d7c981756c57bbcd52baa06af00d1551 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 13 Sep 2012 19:10:28 -0700 Subject: CHUI-283: Now upon the information icon and speaker icon do not overlap the username text. Instead the username text will be truncated with an ellipse to prevent the overlap. Also did a code cleanup. --- indra/llcommon/llfoldertype.h | 2 +- indra/llui/llfolderviewitem.cpp | 31 +++++++------- indra/llui/llfolderviewitem.h | 4 +- indra/newview/llconversationmodel.h | 2 +- indra/newview/llconversationview.cpp | 78 ++++++++++++++++++++++++++++++++-- indra/newview/llconversationview.h | 20 +++++---- indra/newview/llimfloatercontainer.cpp | 2 + indra/newview/llviewerfoldertype.cpp | 2 +- 8 files changed, 110 insertions(+), 31 deletions(-) (limited to 'indra/llcommon/llfoldertype.h') diff --git a/indra/llcommon/llfoldertype.h b/indra/llcommon/llfoldertype.h index 6b5ae572a9..609b550900 100755 --- a/indra/llcommon/llfoldertype.h +++ b/indra/llcommon/llfoldertype.h @@ -91,7 +91,7 @@ public: FT_NONE = -1, - FT_PROFILE = 58 + FT_PROFILEXXXGGG = 58 }; static EType lookup(const std::string& type_name); diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 155a605c3b..7ca02b726a 100755 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -98,6 +98,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) : LLView(p), mLabelWidth(0), mLabelWidthDirty(false), + mLabelPaddingRight(DEFAULT_TEXT_PADDING_RIGHT), mParentFolder( NULL ), mIsSelected( FALSE ), mIsCurSelection( FALSE ), @@ -291,7 +292,7 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height ) : 0; if (mLabelWidthDirty) { - mLabelWidth = ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + getLabelFontForStyle(mLabelStyle)->getWidth(mLabel) + getLabelFontForStyle(mLabelStyle)->getWidth(mLabelSuffix) + TEXT_PAD_RIGHT; + mLabelWidth = ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + getLabelFontForStyle(mLabelStyle)->getWidth(mLabel) + getLabelFontForStyle(mLabelStyle)->getWidth(mLabelSuffix) + mLabelPaddingRight; mLabelWidthDirty = false; } @@ -610,13 +611,13 @@ void LLFolderViewItem::draw() static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE); - getViewModelItem()->update(); - const Params& default_params = LLUICtrlFactory::getDefaultParams(); const S32 TOP_PAD = default_params.item_top_pad; const S32 FOCUS_LEFT = 1; const LLFontGL* font = getLabelFontForStyle(mLabelStyle); + getViewModelItem()->update(); + //--------------------------------------------------------------------------------// // Draw open folder arrow // @@ -771,7 +772,7 @@ void LLFolderViewItem::draw() // font->renderUTF8(mLabel, 0, text_left, y, color, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, - S32_MAX, getRect().getWidth() - (S32) text_left - TEXT_PAD_RIGHT, &right_x, TRUE); + S32_MAX, getRect().getWidth() - (S32) text_left - mLabelPaddingRight, &right_x, TRUE); //--------------------------------------------------------------------------------// // Draw label suffix @@ -786,18 +787,18 @@ void LLFolderViewItem::draw() //--------------------------------------------------------------------------------// // Highlight string match // - if (filter_string_length > 0) - { - F32 match_string_left = text_left + font->getWidthF32(combined_string, 0, mViewModelItem->getFilterStringOffset()); - F32 yy = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD - (F32)TOP_PAD; - font->renderUTF8( combined_string, mViewModelItem->getFilterStringOffset(), match_string_left, yy, - sFilterTextColor, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, - filter_string_length, S32_MAX, &right_x, FALSE ); - } + if (filter_string_length > 0) + { + F32 match_string_left = text_left + font->getWidthF32(combined_string, 0, mViewModelItem->getFilterStringOffset()); + F32 yy = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD - (F32)TOP_PAD; + font->renderUTF8( combined_string, mViewModelItem->getFilterStringOffset(), match_string_left, yy, + sFilterTextColor, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, + filter_string_length, S32_MAX, &right_x, FALSE ); + } - - LLView::draw(); - } + + LLView::draw(); +} const LLFolderViewModelInterface* LLFolderViewItem::getFolderViewModel( void ) const { diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index 766d9b3fe3..fab24e52d1 100755 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -68,7 +68,7 @@ public: ICON_PAD = 2, ICON_WIDTH = 16, TEXT_PAD = 1, - TEXT_PAD_RIGHT = 4, + DEFAULT_TEXT_PADDING_RIGHT = 4, ARROW_SIZE = 12, MAX_FOLDER_ITEM_OVERLAP = 2; @@ -85,6 +85,7 @@ protected: std::string mLabel; S32 mLabelWidth; bool mLabelWidthDirty; + S32 mLabelPaddingRight; LLFolderViewFolder* mParentFolder; LLFolderViewModelItem* mViewModelItem; LLFontGL::StyleFlags mLabelStyle; @@ -243,6 +244,7 @@ public: private: static std::map sFonts; // map of styles to fonts + }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 4f13d3d3a1..e1713f9db7 100755 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -57,7 +57,7 @@ public: virtual const std::string& getSearchableName() const { return mName; } virtual const LLUUID& getUUID() const { return mUUID; } virtual time_t getCreationDate() const { return 0; } - virtual LLPointer getIcon() const { return LLUI::getUIImage(LLViewerFolderType::lookupIconName(LLFolderType::FT_PROFILE, FALSE)); } + virtual LLPointer getIcon() const { return LLUI::getUIImage(LLViewerFolderType::lookupIconName(LLFolderType::FT_PROFILEXXXGGG, FALSE)); } virtual LLPointer getOpenIcon() const { return getIcon(); } virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } virtual std::string getLabelSuffix() const { return LLStringUtil::null; } diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 7b1c9ef912..bc85cd68bc 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -28,13 +28,13 @@ #include "llviewerprecompiledheaders.h" #include "llconversationview.h" + +#include #include "llconversationmodel.h" #include "llimconversation.h" #include "llimfloatercontainer.h" #include "llfloaterreg.h" - #include "lluictrlfactory.h" -#include "llavatariconctrl.h" // // Implementation of conversations list session widgets @@ -120,6 +120,8 @@ void LLConversationViewSession::refresh() // static LLDefaultChildRegistry::Register r("conversation_view_participant"); +bool LLConversationViewParticipant::sStaticInitialized = false; +S32 LLConversationViewParticipant::sChildrenWidths[LLConversationViewParticipant::ALIC_COUNT]; LLConversationViewParticipant::Params::Params() : container(), @@ -130,6 +132,8 @@ output_monitor("output_monitor") LLConversationViewParticipant::LLConversationViewParticipant( const LLConversationViewParticipant::Params& p ): LLFolderViewItem(p), + mInfoBtn(NULL), + mSpeakingIndicator(NULL), mUUID(p.participant_id) { @@ -156,8 +160,16 @@ BOOL LLConversationViewParticipant::postBuild() mSpeakingIndicator = getChild("speaking_indicator"); - LLFolderViewItem::postBuild(); - return TRUE; + if (!sStaticInitialized) + { + // Remember children widths including their padding from the next sibling, + // so that we can hide and show them again later. + initChildrenWidths(this); + sStaticInitialized = true; + } + + computeLabelRightPadding(); + return LLFolderViewItem::postBuild(); } void LLConversationViewParticipant::refresh() @@ -194,14 +206,72 @@ void LLConversationViewParticipant::onInfoBtnClick() void LLConversationViewParticipant::onMouseEnter(S32 x, S32 y, MASK mask) { mInfoBtn->setVisible(true); + computeLabelRightPadding(); LLFolderViewItem::onMouseEnter(x, y, mask); } void LLConversationViewParticipant::onMouseLeave(S32 x, S32 y, MASK mask) { mInfoBtn->setVisible(false); + computeLabelRightPadding(); LLFolderViewItem::onMouseEnter(x, y, mask); } +// static +void LLConversationViewParticipant::initChildrenWidths(LLConversationViewParticipant* self) +{ + //speaking indicator width + padding + S32 speaking_indicator_width = self->getRect().getWidth() - self->mSpeakingIndicator->getRect().mLeft; + + //info btn width + padding + S32 info_btn_width = self->mSpeakingIndicator->getRect().mLeft - self->mInfoBtn->getRect().mLeft; + + S32 index = ALIC_COUNT; + sChildrenWidths[--index] = info_btn_width; + sChildrenWidths[--index] = speaking_indicator_width; + llassert(index == 0); +} + +void LLConversationViewParticipant::computeLabelRightPadding() +{ + mLabelPaddingRight = DEFAULT_TEXT_PADDING_RIGHT; + LLView* control; + S32 ctrl_width; + + for (S32 i = 0; i < ALIC_COUNT; ++i) + { + control = getItemChildView((EAvatarListItemChildIndex)i); + + // skip invisible views + if (!control->getVisible()) continue; + + ctrl_width = sChildrenWidths[i]; // including space between current & left controls + // accumulate the amount of space taken by the controls + mLabelPaddingRight += ctrl_width; + } +} + +LLView* LLConversationViewParticipant::getItemChildView(EAvatarListItemChildIndex child_view_index) +{ + LLView* child_view = NULL; + + switch (child_view_index) + { + case ALIC_SPEAKER_INDICATOR: + child_view = mSpeakingIndicator; + break; + case ALIC_INFO_BUTTON: + child_view = mInfoBtn; + break; + default: + LL_WARNS("AvatarItemReshape") << "Unexpected child view index is passed: " << child_view_index << LL_ENDL; + llassert(0); + break; + // leave child_view untouched + } + + return child_view; +} + // EOF diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h index 0dcf6542a3..686a79ad39 100755 --- a/indra/newview/llconversationview.h +++ b/indra/newview/llconversationview.h @@ -29,12 +29,6 @@ #include "llfolderviewitem.h" - - - -#include "llstyle.h" -#include "llcallbackmap.h" -#include "lltextbox.h" #include "llbutton.h" #include "lloutputmonitorctrl.h" @@ -71,8 +65,6 @@ public: // Implementation of conversations list participant (avatar) widgets -class LLAvatarIconCtrl; - class LLConversationViewParticipant : public LLFolderViewItem { @@ -108,6 +100,18 @@ private: LLButton * mInfoBtn; LLOutputMonitorCtrl* mSpeakingIndicator; LLUUID mUUID; // UUID of the participant + + typedef enum e_avatar_item_child { + ALIC_SPEAKER_INDICATOR, + ALIC_INFO_BUTTON, + ALIC_COUNT, + } EAvatarListItemChildIndex; + + static bool sStaticInitialized; // this variable is introduced to improve code readability + static S32 sChildrenWidths[ALIC_COUNT]; + static void initChildrenWidths(LLConversationViewParticipant* self); + void computeLabelRightPadding(); + LLView* getItemChildView(EAvatarListItemChildIndex child_view_index); }; #endif // LL_LLCONVERSATIONVIEW_H diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 9320117eb5..299d38298e 100755 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -724,6 +724,8 @@ LLConversationViewParticipant* LLIMFloaterContainer::createConversationViewParti //params.creation_date = bridge->getCreationDate(); params.root = mConversationsRoot; params.listener = item; + + //16 and panel_rect.getWidth() are used since that is currently the values used in repositioningWidgets() params.rect = LLRect (0, 16, panel_rect.getWidth(), 0); params.tool_tip = params.name; params.participant_id = item->getUUID(); diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index d470abb8c5..0a402d8c42 100755 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -148,7 +148,7 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() } #endif - addEntry(LLFolderType::FT_PROFILE, new ViewerFolderEntry("Profile", "Generic_Person", "Generic_Person", FALSE, false, "default")); + addEntry(LLFolderType::FT_PROFILEXXXGGG, new ViewerFolderEntry("Profile", "Generic_Person", "Generic_Person", FALSE, false, "default")); } bool LLViewerFolderDictionary::initEnsemblesFromFile() -- cgit v1.3 From 3c8407f32cf947ee1631ed66bba7a676e8b3b670 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 18 Sep 2012 12:15:51 -0700 Subject: CHUI-283: Now the avatar icon loads in the user's avatar image.Also the avatar image is of proper size. The participant of the conversation is offset correctly as well. --- indra/llcommon/llfoldertype.h | 4 +- indra/llui/llfolderviewitem.cpp | 230 +++++++++++---------- indra/llui/llfolderviewitem.h | 3 + indra/newview/llconversationmodel.h | 2 +- indra/newview/llconversationview.cpp | 50 ++++- indra/newview/llconversationview.h | 6 +- indra/newview/llviewerfoldertype.cpp | 2 - .../default/xui/en/floater_pathfinding_console.xml | 2 +- .../en/widgets/conversation_view_participant.xml | 8 +- 9 files changed, 185 insertions(+), 122 deletions(-) (limited to 'indra/llcommon/llfoldertype.h') diff --git a/indra/llcommon/llfoldertype.h b/indra/llcommon/llfoldertype.h index 609b550900..a0c847914f 100755 --- a/indra/llcommon/llfoldertype.h +++ b/indra/llcommon/llfoldertype.h @@ -89,9 +89,7 @@ public: FT_COUNT, - FT_NONE = -1, - - FT_PROFILEXXXGGG = 58 + FT_NONE = -1 }; static EType lookup(const std::string& type_name); diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index 7ca02b726a..5fcb1f51d1 100755 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -105,6 +105,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mSelectPending(FALSE), mLabelStyle( LLFontGL::NORMAL ), mHasVisibleChildren(FALSE), + mLocalIndentation(p.folder_indentation), mIndentation(0), mItemHeight(p.item_height), mControlLabelRotation(0.f), @@ -284,11 +285,9 @@ void LLFolderViewItem::addToFolder(LLFolderViewFolder* folder) // makes sure that this view and its children are the right size. S32 LLFolderViewItem::arrange( S32* width, S32* height ) { - const Params& p = LLUICtrlFactory::getDefaultParams(); - S32 indentation = p.folder_indentation(); // Only indent deeper items in hierarchy mIndentation = (getParentFolder()) - ? getParentFolder()->getIndentation() + indentation + ? getParentFolder()->getIndentation() + mLocalIndentation : 0; if (mLabelWidthDirty) { @@ -596,24 +595,134 @@ BOOL LLFolderViewItem::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, return handled; } +void LLFolderViewItem::drawHighlight(const BOOL showContent, const BOOL hasKeyboardFocus, const LLUIColor &bgColor, + const LLUIColor &focusOutlineColor, const LLUIColor &mouseOverColor) +{ + + //--------------------------------------------------------------------------------// + // Draw highlight for selected items + // + + const S32 focus_top = getRect().getHeight(); + const S32 focus_bottom = getRect().getHeight() - mItemHeight; + const bool folder_open = (getRect().getHeight() > mItemHeight + 4); + const S32 FOCUS_LEFT = 1; + + if (mIsSelected) // always render "current" item. Only render other selected items if mShowSingleSelection is FALSE + { + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + LLColor4 bg_color = bgColor; + if (!mIsCurSelection) + { + // do time-based fade of extra objects + F32 fade_time = (getRoot() ? getRoot()->getSelectionFadeElapsedTime() : 0.0f); + if (getRoot() && getRoot()->getShowSingleSelection()) + { + // fading out + bg_color.mV[VALPHA] = clamp_rescale(fade_time, 0.f, 0.4f, bg_color.mV[VALPHA], 0.f); + } + else + { + // fading in + bg_color.mV[VALPHA] = clamp_rescale(fade_time, 0.f, 0.4f, 0.f, bg_color.mV[VALPHA]); + } + } + gl_rect_2d(FOCUS_LEFT, + focus_top, + getRect().getWidth() - 2, + focus_bottom, + bg_color, hasKeyboardFocus); + if (mIsCurSelection) + { + gl_rect_2d(FOCUS_LEFT, + focus_top, + getRect().getWidth() - 2, + focus_bottom, + focusOutlineColor, FALSE); + } + if (folder_open) + { + gl_rect_2d(FOCUS_LEFT, + focus_bottom + 1, // overlap with bottom edge of above rect + getRect().getWidth() - 2, + 0, + focusOutlineColor, FALSE); + if (showContent) + { + gl_rect_2d(FOCUS_LEFT, + focus_bottom + 1, + getRect().getWidth() - 2, + 0, + bgColor, TRUE); + } + } + } + else if (mIsMouseOverTitle) + { + gl_rect_2d(FOCUS_LEFT, + focus_top, + getRect().getWidth() - 2, + focus_bottom, + mouseOverColor, FALSE); + } + + //--------------------------------------------------------------------------------// + // Draw DragNDrop highlight + // + if (mDragAndDropTarget) + { + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + gl_rect_2d(FOCUS_LEFT, + focus_top, + getRect().getWidth() - 2, + focus_bottom, + bgColor, FALSE); + if (folder_open) + { + gl_rect_2d(FOCUS_LEFT, + focus_bottom + 1, // overlap with bottom edge of above rect + getRect().getWidth() - 2, + 0, + bgColor, FALSE); + } + mDragAndDropTarget = FALSE; + } +} + +void LLFolderViewItem::drawLabel(const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 right_x) +{ + //TODO RN: implement this in terms of getColor() + //if (highlight_link) color = sLinkColor; + //if (gInventory.isObjectDescendentOf(getViewModelItem()->getUUID(), gInventory.getLibraryRootFolderID())) color = sLibraryColor; + + //--------------------------------------------------------------------------------// + // Draw the actual label text + // + font->renderUTF8(mLabel, 0, x, y, color, + LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, + S32_MAX, getRect().getWidth() - (S32) x - mLabelPaddingRight, &right_x, TRUE); +} + void LLFolderViewItem::draw() { static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); - static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); - static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE); - static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE); + static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); + static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE); + static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE); + static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE); static LLUIColor sFilterBGColor = LLUIColorTable::instance().getColor("FilterBackgroundColor", DEFAULT_WHITE); static LLUIColor sFilterTextColor = LLUIColorTable::instance().getColor("FilterTextColor", DEFAULT_WHITE); static LLUIColor sSuffixColor = LLUIColorTable::instance().getColor("InventoryItemColor", DEFAULT_WHITE); static LLUIColor sLibraryColor = LLUIColorTable::instance().getColor("InventoryItemLibraryColor", DEFAULT_WHITE); static LLUIColor sLinkColor = LLUIColorTable::instance().getColor("InventoryItemLinkColor", DEFAULT_WHITE); static LLUIColor sSearchStatusColor = LLUIColorTable::instance().getColor("InventorySearchStatusColor", DEFAULT_WHITE); - 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 Params& default_params = LLUICtrlFactory::getDefaultParams(); const S32 TOP_PAD = default_params.item_top_pad; - const S32 FOCUS_LEFT = 1; + const LLFontGL* font = getLabelFontForStyle(mLabelStyle); getViewModelItem()->update(); @@ -630,93 +739,7 @@ void LLFolderViewItem::draw() } - //--------------------------------------------------------------------------------// - // Draw highlight for selected items - // - 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 S32 focus_top = getRect().getHeight(); - const S32 focus_bottom = getRect().getHeight() - mItemHeight; - const bool folder_open = (getRect().getHeight() > mItemHeight + 4); - if (mIsSelected) // always render "current" item. Only render other selected items if mShowSingleSelection is FALSE - { - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - LLColor4 bg_color = sHighlightBgColor; - if (!mIsCurSelection) - { - // do time-based fade of extra objects - F32 fade_time = (getRoot() ? getRoot()->getSelectionFadeElapsedTime() : 0.0f); - if (getRoot() && getRoot()->getShowSingleSelection()) - { - // fading out - bg_color.mV[VALPHA] = clamp_rescale(fade_time, 0.f, 0.4f, bg_color.mV[VALPHA], 0.f); - } - else - { - // fading in - bg_color.mV[VALPHA] = clamp_rescale(fade_time, 0.f, 0.4f, 0.f, bg_color.mV[VALPHA]); - } - } - gl_rect_2d(FOCUS_LEFT, - focus_top, - getRect().getWidth() - 2, - focus_bottom, - bg_color, filled); - if (mIsCurSelection) - { - gl_rect_2d(FOCUS_LEFT, - focus_top, - getRect().getWidth() - 2, - focus_bottom, - sFocusOutlineColor, FALSE); - } - if (folder_open) - { - gl_rect_2d(FOCUS_LEFT, - focus_bottom + 1, // overlap with bottom edge of above rect - getRect().getWidth() - 2, - 0, - sFocusOutlineColor, FALSE); - if (show_context) - { - gl_rect_2d(FOCUS_LEFT, - focus_bottom + 1, - getRect().getWidth() - 2, - 0, - sHighlightBgColor, TRUE); - } - } - } - else if (mIsMouseOverTitle) - { - gl_rect_2d(FOCUS_LEFT, - focus_top, - getRect().getWidth() - 2, - focus_bottom, - sMouseOverColor, FALSE); - } - - //--------------------------------------------------------------------------------// - // Draw DragNDrop highlight - // - if (mDragAndDropTarget) - { - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gl_rect_2d(FOCUS_LEFT, - focus_top, - getRect().getWidth() - 2, - focus_bottom, - sHighlightBgColor, FALSE); - if (folder_open) - { - gl_rect_2d(FOCUS_LEFT, - focus_bottom + 1, // overlap with bottom edge of above rect - getRect().getWidth() - 2, - 0, - sHighlightBgColor, FALSE); - } - mDragAndDropTarget = FALSE; - } + drawHighlight(show_context, filled, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor); //--------------------------------------------------------------------------------// // Draw open icon @@ -760,19 +783,10 @@ void LLFolderViewItem::draw() LLUIImage* box_image = default_params.selection_image; LLRect box_rect(left, top, right, bottom); box_image->draw(box_rect, sFilterBGColor); - } + } - LLColor4 color = (mIsSelected && filled) ? sHighlightFgColor : sFgColor; - //TODO RN: implement this in terms of getColor() - //if (highlight_link) color = sLinkColor; - //if (gInventory.isObjectDescendentOf(getViewModelItem()->getUUID(), gInventory.getLibraryRootFolderID())) color = sLibraryColor; - - //--------------------------------------------------------------------------------// - // Draw the actual label text - // - font->renderUTF8(mLabel, 0, text_left, y, color, - LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, - S32_MAX, getRect().getWidth() - (S32) text_left - mLabelPaddingRight, &right_x, TRUE); + LLColor4 color = (mIsSelected && filled) ? sHighlightFgColor : sFgColor; + drawLabel(font, text_left, y, color, right_x); //--------------------------------------------------------------------------------// // Draw label suffix diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index 7025b94a9a..a9e10c92c9 100755 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -93,6 +93,7 @@ protected: LLUIImagePtr mIcon, mIconOpen, mIconOverlay; + S32 mLocalIndentation; S32 mIndentation; S32 mItemHeight; S32 mDragStartX, @@ -235,6 +236,8 @@ public: // virtual void handleDropped(); virtual void draw(); + 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, EDragAndDropType cargo_type, void* cargo_data, diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index ef1903ab19..49af927acf 100755 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -57,7 +57,7 @@ public: virtual const std::string& getSearchableName() const { return mName; } virtual const LLUUID& getUUID() const { return mUUID; } virtual time_t getCreationDate() const { return 0; } - virtual LLPointer getIcon() const { return LLUI::getUIImage(LLViewerFolderType::lookupIconName(LLFolderType::FT_PROFILEXXXGGG, FALSE)); } + virtual LLPointer getIcon() const { return NULL; } virtual LLPointer getOpenIcon() const { return getIcon(); } virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } virtual std::string getLabelSuffix() const { return LLStringUtil::null; } diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index d5d4fc13da..721abd5892 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -41,7 +41,7 @@ // static LLDefaultChildRegistry::Register r_conversation_view_session("conversation_view_session"); - +const LLColor4U DEFAULT_WHITE(255, 255, 255); LLConversationViewSession::Params::Params() : container() @@ -90,7 +90,6 @@ void LLConversationViewSession::draw() // *TODO Seth PE: remove the code duplicated from LLFolderViewItem::draw() // ***** LLFolderViewItem::draw() code begin ***** - const LLColor4U DEFAULT_WHITE(255, 255, 255); static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); @@ -317,21 +316,27 @@ S32 LLConversationViewParticipant::sChildrenWidths[LLConversationViewParticipant LLConversationViewParticipant::Params::Params() : container(), participant_id(), +avatar_icon("avatar_icon"), info_button("info_button"), output_monitor("output_monitor") {} LLConversationViewParticipant::LLConversationViewParticipant( const LLConversationViewParticipant::Params& p ): LLFolderViewItem(p), + mAvatarIcon(NULL), mInfoBtn(NULL), mSpeakingIndicator(NULL), mUUID(p.participant_id) { - } void LLConversationViewParticipant::initFromParams(const LLConversationViewParticipant::Params& params) { + LLAvatarIconCtrl::Params avatar_icon_params(params.avatar_icon()); + applyXUILayout(avatar_icon_params, this); + LLAvatarIconCtrl * avatarIcon = LLUICtrlFactory::create(avatar_icon_params); + addChild(avatarIcon); + LLButton::Params info_button_params(params.info_button()); applyXUILayout(info_button_params, this); LLButton * button = LLUICtrlFactory::create(info_button_params); @@ -345,6 +350,8 @@ void LLConversationViewParticipant::initFromParams(const LLConversationViewParti BOOL LLConversationViewParticipant::postBuild() { + mAvatarIcon = getChild("avatar_icon"); + mInfoBtn = getChild("info_btn"); mInfoBtn->setClickedCallback(boost::bind(&LLConversationViewParticipant::onInfoBtnClick, this)); mInfoBtn->setVisible(false); @@ -363,6 +370,36 @@ BOOL LLConversationViewParticipant::postBuild() return LLFolderViewItem::postBuild(); } +void LLConversationViewParticipant::draw() +{ + static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); + static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE); + static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); + static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE); + 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 LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams(); + const S32 TOP_PAD = default_params.item_top_pad; + + const LLFontGL* font = getLabelFontForStyle(mLabelStyle); + F32 right_x = 0; + + //TEXT_PAD, TOP_PAD, ICON_PAD and mIndentation are temporary values and will non-const eventually since they don't + //apply to every single layout + F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD - (F32)TOP_PAD; + F32 text_left = (F32)(mAvatarIcon->getRect().mRight + ICON_PAD + mIndentation); + LLColor4 color = (mIsSelected && filled) ? sHighlightFgColor : sFgColor; + + drawHighlight(show_context, filled, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor); + drawLabel(font, text_left, y, color, right_x); + + LLView::draw(); +} + + void LLConversationViewParticipant::refresh() { // Refresh the participant view from its model data @@ -384,8 +421,11 @@ void LLConversationViewParticipant::addToFolder(LLFolderViewFolder* folder) LLConversationItem* vmi = this->getParentFolder() ? dynamic_cast(this->getParentFolder()->getViewModelItem()) : NULL; if(vmi) { - mSpeakingIndicator->setSpeakerId(mUUID, - vmi->getUUID()); //set the session id + //Allows speaking icon image to be loaded based on mUUID + mAvatarIcon->setValue(mUUID); + + //Allows the speaker indicator to be activated based on the user and conversation + mSpeakingIndicator->setSpeakerId(mUUID, vmi->getUUID()); } } diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h index 3dbc36e811..075ad09d5b 100755 --- a/indra/newview/llconversationview.h +++ b/indra/newview/llconversationview.h @@ -29,6 +29,7 @@ #include "llfolderviewitem.h" +#include "llavatariconctrl.h" #include "llbutton.h" #include "lloutputmonitorctrl.h" @@ -84,7 +85,8 @@ public: struct Params : public LLInitParam::Block { Optional container; - Optional participant_id; + Optional participant_id; + Optional avatar_icon; Optional info_button; Optional output_monitor; @@ -104,10 +106,12 @@ protected: LLConversationViewParticipant( const Params& p ); void initFromParams(const Params& params); BOOL postBuild(); + /*virtual*/ void draw(); void onInfoBtnClick(); private: + LLAvatarIconCtrl* mAvatarIcon; LLButton * mInfoBtn; LLOutputMonitorCtrl* mSpeakingIndicator; LLUUID mUUID; // UUID of the participant diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index 0a402d8c42..a179b61cff 100755 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -147,8 +147,6 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() addEntry((LLFolderType::EType)type, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, false)); } #endif - - addEntry(LLFolderType::FT_PROFILEXXXGGG, new ViewerFolderEntry("Profile", "Generic_Person", "Generic_Person", FALSE, false, "default")); } bool LLViewerFolderDictionary::initEnsemblesFromFile() diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml index 2629313069..79f2027c31 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml @@ -152,7 +152,7 @@ +