ACME-251: This should be final commit for this task, now the peopletab looks like the accordion tab.

meow-7.2.2
Gilbert Gonzales 2013-04-25 16:29:02 -07:00
parent 06e1b03362
commit 4562efdc74
4 changed files with 77 additions and 17 deletions

View File

@ -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<LLPersonTabView *>(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<LLPersonTabView *>(item);
if(person_tab)
{
person_tab->highlight = false;
}
else
{
person_tab = dynamic_cast<LLPersonTabView *>(item->getParent());
person_tab->highlight = false;
}
}
return selected_item;
return LLFolderView::handleMouseDown(x, y, mask);
}
bool LLPersonFolderView::onConversationModelEvent(const LLSD &event)

View File

@ -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
//

View File

@ -50,8 +50,15 @@ public:
protected:
void draw();
void drawHighlight();
private:
// Background images
LLPointer<LLUIImage> mImageHeader;
LLPointer<LLUIImage> mImageHeaderOver;
LLPointer<LLUIImage> mImageHeaderFocused;
};
class LLPersonView : public LLFolderViewItem

View File

@ -2,11 +2,11 @@
<conversation_view_session
folder_arrow_image="Folder_Arrow"
folder_indentation="5"
item_height="20"
item_height="24"
item_top_pad="3"
mouse_opaque="true"
follows="left|top|right"
text_pad="4"
text_pad="5"
text_pad_left="4"
text_pad_right="4"
arrow_size="10"