From 749bb57cd19d51090d64cd2261048b9a0654807b Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Fri, 18 Dec 2015 19:20:32 +0200 Subject: MAINT-5194 Visual Outfit Browser Visual selection of outfit implemented --- indra/newview/lloutfitgallery.cpp | 48 ++++++-------- indra/newview/lloutfitgallery.h | 3 + .../default/xui/en/panel_outfit_gallery_item.xml | 77 ++++++++++++++-------- 3 files changed, 72 insertions(+), 56 deletions(-) (limited to 'indra') diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index 2d8085e128..ec86e608f2 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -327,7 +327,8 @@ static LLDefaultChildRegistry::Register r("outfit_gallery_i LLOutfitGalleryItem::LLOutfitGalleryItem(const Params& p) : LLPanel(p), - mTexturep(NULL) + mTexturep(NULL), + mSelected(false) { buildFromFile("panel_outfit_gallery_item.xml"); } @@ -343,6 +344,8 @@ BOOL LLOutfitGalleryItem::postBuild() mOutfitNameText = getChild("outfit_name"); mOutfitWornText = getChild("outfit_worn_text"); + mFotoBgPanel = getChild("foto_bg_panel"); + mTextBgPanel = getChild("text_bg_panel"); setOutfitWorn(false); return TRUE; } @@ -351,35 +354,32 @@ void LLOutfitGalleryItem::draw() { LLPanel::draw(); - // In case texture is not set, don't draw it over default image - if (!mTexturep) - { - return; - } - - // Border + + // Draw border + LLUIColor border_color = LLUIColorTable::instance().getColor(mSelected ? "FrogGreen" : "MouseGray", LLColor4::white); LLRect border = getChildView("preview_outfit")->getRect(); - //gl_rect_2d(border, LLColor4::black, FALSE); - - - // Interior - LLRect interior = border; - //interior.stretch(-1); + border.mRight = border.mRight + 1; + gl_rect_2d(border, border_color.get(), FALSE); // If the floater is focused, don't apply its alpha to the texture (STORM-677). const F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); if (mTexturep) { - if (mTexturep->getComponents() == 4) - { - gl_rect_2d_checkerboard(interior, alpha); - } + //if (mTexturep->getComponents() == 4) + //{ + // gl_rect_2d_checkerboard(interior, alpha); + //} - gl_draw_scaled_image(interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha); + // Interior + LLRect interior = border; + interior.stretch(-1); + + gl_draw_scaled_image(interior.mLeft - 1, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha); // Pump the priority mTexturep->addTextureStats((F32)(interior.getWidth() * interior.getHeight())); } + } void LLOutfitGalleryItem::setOutfitName(std::string name) @@ -404,14 +404,8 @@ void LLOutfitGalleryItem::setOutfitWorn(bool value) void LLOutfitGalleryItem::setSelected(bool value) { - if (value) - { - mOutfitWornText->setValue("(selected)"); - } - else - { - mOutfitWornText->setValue(""); - } + mSelected = value; + mTextBgPanel->setBackgroundVisible(value); } BOOL LLOutfitGalleryItem::handleMouseDown(S32 x, S32 y, MASK mask) diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h index 93b9ba1e3f..61a2981a29 100644 --- a/indra/newview/lloutfitgallery.h +++ b/indra/newview/lloutfitgallery.h @@ -147,6 +147,9 @@ private: LLPointer mTexturep; LLTextBox* mOutfitNameText; LLTextBox* mOutfitWornText; + LLPanel* mTextBgPanel; + LLPanel* mFotoBgPanel; + bool mSelected; }; #endif // LL_LLOUTFITGALLERYCTRL_H diff --git a/indra/newview/skins/default/xui/en/panel_outfit_gallery_item.xml b/indra/newview/skins/default/xui/en/panel_outfit_gallery_item.xml index acb72402cc..535960502e 100644 --- a/indra/newview/skins/default/xui/en/panel_outfit_gallery_item.xml +++ b/indra/newview/skins/default/xui/en/panel_outfit_gallery_item.xml @@ -1,49 +1,68 @@ - - Summer hipster, Pierce - - - (worn) - + + + Summer hipster, Pierce + + + (worn) + + -- cgit v1.2.3