summaryrefslogtreecommitdiff
path: root/indra/newview/llpersontabview.cpp
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2013-04-25 17:38:54 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2013-04-25 17:38:54 -0700
commit7902e05c9f52e16d3e505f9d7a8852743a212586 (patch)
tree9bea9a7c54528b01e4f7e2284155c3adb466e8e7 /indra/newview/llpersontabview.cpp
parent4562efdc7418923caa88bcf0c68a177f772c044b (diff)
ACME-252 Create AvatarFolderItemView: Now the sub items of the persontab are drawn with different highlights depending on if they are selected or moused over.
Diffstat (limited to 'indra/newview/llpersontabview.cpp')
-rw-r--r--indra/newview/llpersontabview.cpp63
1 files changed, 31 insertions, 32 deletions
diff --git a/indra/newview/llpersontabview.cpp b/indra/newview/llpersontabview.cpp
index 3556878b91..dc55f627d6 100644
--- a/indra/newview/llpersontabview.cpp
+++ b/indra/newview/llpersontabview.cpp
@@ -72,19 +72,12 @@ void LLPersonTabView::draw()
static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
static const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams<LLPersonTabView>();
- 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);
-
-
const LLFontGL * font = LLFontGL::getFontSansSerif();
F32 text_left = (F32)getLabelXPos();
F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;
LLColor4 color = sFgColor;
F32 right_x = 0;
- //drawHighlight(false, highlight, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
-
drawHighlight();
updateLabelRotation();
drawOpenFolderArrow(default_params, sFgColor);
@@ -101,41 +94,17 @@ void LLPersonTabView::drawHighlight()
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);
}
@@ -145,12 +114,15 @@ void LLPersonTabView::drawHighlight()
// LLPersonView
//
+static LLDefaultChildRegistry::Register<LLPersonView> r_person_view("person_view");
LLPersonView::Params::Params()
{}
LLPersonView::LLPersonView(const LLPersonView::Params& p) :
-LLFolderViewItem(p)
+LLFolderViewItem(p),
+mImageOver(LLUI::getUIImage("ListItem_Over")),
+mImageSelected(LLUI::getUIImage("ListItem_Select"))
{
}
@@ -183,7 +155,34 @@ void LLPersonView::draw()
LLColor4 color = mIsSelected ? sHighlightFgColor : sFgColor;
F32 right_x = 0;
+ drawHighlight();
drawLabel(font, text_left, y, color, right_x);
LLView::draw();
}
+
+void LLPersonView::drawHighlight()
+{
+ static LLUIColor outline_color = LLUIColorTable::instance().getColor("Green_80", DEFAULT_WHITE);
+
+ S32 width = getRect().getWidth();
+ S32 height = mItemHeight;
+ S32 x = 1;
+ S32 y = 0;
+
+ if(mIsSelected)
+ {
+ mImageSelected->draw(x, y, width, height);
+ //Need to find a better color that matches the outline in avatarlistitem
+ gl_rect_2d(x,
+ height,
+ width,
+ y,
+ outline_color, FALSE);
+ }
+
+ if(mIsMouseOverTitle)
+ {
+ mImageOver->draw(x, y, width, height);
+ }
+}