diff options
| author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-04-25 17:38:54 -0700 | 
|---|---|---|
| committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-04-25 17:38:54 -0700 | 
| commit | 7902e05c9f52e16d3e505f9d7a8852743a212586 (patch) | |
| tree | 9bea9a7c54528b01e4f7e2284155c3adb466e8e7 | |
| parent | 4562efdc7418923caa88bcf0c68a177f772c044b (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.
| -rw-r--r-- | indra/newview/llpersontabview.cpp | 63 | ||||
| -rw-r--r-- | indra/newview/llpersontabview.h | 4 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/widgets/person_tab_view.xml | 2 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/widgets/person_view.xml | 13 | 
4 files changed, 49 insertions, 33 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); +	} +} diff --git a/indra/newview/llpersontabview.h b/indra/newview/llpersontabview.h index 35cb219ce2..b246be288a 100644 --- a/indra/newview/llpersontabview.h +++ b/indra/newview/llpersontabview.h @@ -79,9 +79,13 @@ public:  protected:	  	void draw(); +	void drawHighlight();  private: +	LLPointer<LLUIImage> mImageOver; +	LLPointer<LLUIImage> mImageSelected; +  	LLAvatarIconCtrl* mAvatarIcon;  	LLButton * mInfoBtn; 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 b36011763a..d46938d3b7 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 @@ -6,7 +6,7 @@    item_top_pad="3"    mouse_opaque="true"    follows="left|top|right" -  text_pad="5" +  text_pad="6"    text_pad_left="4"    text_pad_right="4"    arrow_size="10" diff --git a/indra/newview/skins/default/xui/en/widgets/person_view.xml b/indra/newview/skins/default/xui/en/widgets/person_view.xml new file mode 100644 index 0000000000..d46938d3b7 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/person_view.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<conversation_view_session +  folder_arrow_image="Folder_Arrow" +  folder_indentation="5" +  item_height="24"  +  item_top_pad="3" +  mouse_opaque="true" +  follows="left|top|right" +  text_pad="6" +  text_pad_left="4" +  text_pad_right="4" +  arrow_size="10" +  max_folder_item_overlap="2"/> | 
