From 4562efdc7418923caa88bcf0c68a177f772c044b Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 25 Apr 2013 16:29:02 -0700 Subject: ACME-251: This should be final commit for this task, now the peopletab looks like the accordion tab. --- indra/newview/llpersonfolderview.cpp | 25 ++++++---- indra/newview/llpersontabview.cpp | 58 ++++++++++++++++++++-- indra/newview/llpersontabview.h | 7 +++ .../default/xui/en/widgets/person_tab_view.xml | 4 +- 4 files changed, 77 insertions(+), 17 deletions(-) diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index 97f5d5a03a..8141eecc35 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -47,21 +47,24 @@ LLPersonFolderView::~LLPersonFolderView() BOOL LLPersonFolderView::handleMouseDown( S32 x, S32 y, MASK mask ) { - LLFolderViewItem * prior_item = getCurSelectedItem(); - LLFolderViewItem * current_item; + LLFolderViewItem * item = getCurSelectedItem(); - bool selected_item = LLFolderView::handleMouseDown(x, y, mask); - - current_item = getCurSelectedItem(); - - LLPersonTabView * prior_folder = dynamic_cast(prior_item); - - if(prior_folder && current_item != prior_folder) + //Will disable highlight on tab + if(item) { - prior_folder->highlight = false; + LLPersonTabView * person_tab= dynamic_cast(item); + if(person_tab) + { + person_tab->highlight = false; + } + else + { + person_tab = dynamic_cast(item->getParent()); + person_tab->highlight = false; + } } - return selected_item; + return LLFolderView::handleMouseDown(x, y, mask); } bool LLPersonFolderView::onConversationModelEvent(const LLSD &event) diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp index 20db0572fc..3556878b91 100644 --- a/indra/newview/llpersontabview.cpp +++ b/indra/newview/llpersontabview.cpp @@ -38,9 +38,11 @@ LLPersonTabView::Params::Params() LLPersonTabView::LLPersonTabView(const LLPersonTabView::Params& p) : LLFolderViewFolder(p), -highlight(false) +highlight(false), +mImageHeader(LLUI::getUIImage("Accordion_Off")), +mImageHeaderOver(LLUI::getUIImage("Accordion_Over")), +mImageHeaderFocused(LLUI::getUIImage("Accordion_Selected")) { - } S32 LLPersonTabView::getLabelXPos() @@ -73,7 +75,7 @@ void LLPersonTabView::draw() static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE); static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); - static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("DkGray", DEFAULT_WHITE); + const LLFontGL * font = LLFontGL::getFontSansSerif(); F32 text_left = (F32)getLabelXPos(); @@ -81,8 +83,9 @@ void LLPersonTabView::draw() LLColor4 color = sFgColor; F32 right_x = 0; - drawHighlight(false, highlight, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); + //drawHighlight(false, highlight, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); + drawHighlight(); updateLabelRotation(); drawOpenFolderArrow(default_params, sFgColor); @@ -91,6 +94,53 @@ void LLPersonTabView::draw() LLView::draw(); } +void LLPersonTabView::drawHighlight() +{ + S32 width = getRect().getWidth(); + S32 height = mItemHeight; + S32 x = 1; + S32 y = getRect().getHeight() - mItemHeight; + + //const S32 FOCUS_LEFT = 1; + //const S32 focus_top = getRect().getHeight(); + //const S32 focus_bottom = getRect().getHeight() - mItemHeight; + //static LLUIColor bgColor = LLUIColorTable::instance().getColor("DkGray2", DEFAULT_WHITE); + //static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); + + if(highlight) + { + //reference will remove + /*gl_rect_2d(FOCUS_LEFT, + focus_top, + getRect().getWidth() - 2, + focus_bottom, + sMouseOverColor, TRUE);*/ + mImageHeaderFocused->draw(x,y,width,height); + } + else + { + //reference will remove + /*gl_rect_2d(FOCUS_LEFT, + focus_top, + getRect().getWidth() - 2, + focus_bottom, + bgColor, TRUE);*/ + mImageHeader->draw(x,y,width,height); + } + + if(mIsMouseOverTitle) + { + //reference will remove + /*gl_rect_2d(FOCUS_LEFT, + focus_top, + getRect().getWidth() - 2, + focus_bottom, + sMouseOverColor, TRUE);*/ + mImageHeaderOver->draw(x,y,width,height); + } + +} + // // LLPersonView // diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index df3f786c69..35cb219ce2 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -50,8 +50,15 @@ public: protected: void draw(); + void drawHighlight(); private: + + // Background images + LLPointer mImageHeader; + LLPointer mImageHeaderOver; + LLPointer mImageHeaderFocused; + }; class LLPersonView : public LLFolderViewItem diff --git a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml index 46857ac700..b36011763a 100644 --- a/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/person_tab_view.xml @@ -2,11 +2,11 @@