diff options
Diffstat (limited to 'indra/newview/llinventorylistitem.cpp')
-rw-r--r-- | indra/newview/llinventorylistitem.cpp | 56 |
1 files changed, 6 insertions, 50 deletions
diff --git a/indra/newview/llinventorylistitem.cpp b/indra/newview/llinventorylistitem.cpp index 5fb5b0f23f..e210975a5a 100644 --- a/indra/newview/llinventorylistitem.cpp +++ b/indra/newview/llinventorylistitem.cpp @@ -43,19 +43,7 @@ static LLWidgetNameRegistry::StaticRegistrar sRegisterPanelInventoryListItemBaseParams(&typeid(LLPanelInventoryListItemBase::Params), "inventory_list_item"); -constexpr S32 WIDGET_SPACING = 3; -constexpr S32 FAVORITE_IMAGE_SIZE = 14; -constexpr S32 FAVORITE_IMAGE_PAD = 3; - -bool get_is_item_favorite(const LLViewerInventoryItem* inv) -{ - if (inv->getIsLinkType()) - { - LLInventoryObject* obj = gInventory.getObject(inv->getLinkedUUID()); - return obj && obj->getIsFavorite(); - } - return inv->getIsFavorite(); -} +static const S32 WIDGET_SPACING = 3; LLPanelInventoryListItemBase::Params::Params() : default_style("default_style"), @@ -87,30 +75,19 @@ void LLPanelInventoryListItemBase::draw() LLViewerInventoryItem* inv_item = getItem(); if (inv_item) { - updateItem(inv_item->getName(), get_is_item_favorite(inv_item)); + updateItem(inv_item->getName()); } setNeedsRefresh(false); } - static LLUICachedControl<bool> draw_star("InventoryFavoritesUseStar", true); - - LLRect local_rect = getLocalRect(); if (mHovered && mHoverImage) { - mHoverImage->draw(local_rect); - } - else if (mIsFavorite && draw_star()) - { - - static LLPointer<LLUIImage> fav_img = LLRender2D::getInstance()->getUIImage("Inv_Favorite_Star_Full"); - gl_draw_scaled_image( - local_rect.getWidth() - FAVORITE_IMAGE_SIZE - FAVORITE_IMAGE_PAD, FAVORITE_IMAGE_PAD, - FAVORITE_IMAGE_SIZE, FAVORITE_IMAGE_SIZE, fav_img->getImage()); + mHoverImage->draw(getLocalRect()); } if (mSelected && mSelectedImage) { - mSelectedImage->draw(local_rect); + mSelectedImage->draw(getLocalRect()); } if (mSeparatorVisible && mSeparatorImage) @@ -118,7 +95,7 @@ void LLPanelInventoryListItemBase::draw() // place under bottom of listitem, using image height // item_pad in list using the item should be >= image height // to avoid cropping of top of the next item. - LLRect separator_rect = local_rect; + LLRect separator_rect = getLocalRect(); separator_rect.mTop = separator_rect.mBottom; separator_rect.mBottom -= mSeparatorImage->getHeight(); F32 alpha = getCurrentTransparency(); @@ -130,15 +107,9 @@ void LLPanelInventoryListItemBase::draw() // virtual void LLPanelInventoryListItemBase::updateItem(const std::string& name, - bool favorite, EItemState item_state) { setIconImage(mIconImage); - if (mIsFavorite != favorite) - { - mIsFavorite = favorite; - reshapeMiddleWidgets(); - } setTitle(name, mHighlightedText, item_state); } @@ -193,7 +164,7 @@ bool LLPanelInventoryListItemBase::postBuild() if (inv_item) { mIconImage = LLInventoryIcon::getIcon(inv_item->getType(), inv_item->getInventoryType(), inv_item->getFlags(), false); - updateItem(inv_item->getName(), get_is_item_favorite(inv_item)); + updateItem(inv_item->getName()); } setNeedsRefresh(true); @@ -319,7 +290,6 @@ LLPanelInventoryListItemBase::LLPanelInventoryListItemBase(LLViewerInventoryItem mHovered(false), mSelected(false), mSeparatorVisible(false), - mIsFavorite(false), mHoverImage(params.hover_image), mSelectedImage(params.selected_image), mSeparatorImage(params.separator_image) @@ -422,16 +392,6 @@ void LLPanelInventoryListItemBase::setTitle(const std::string& title, default:; } - if (mIsFavorite) - { - static LLUICachedControl<bool> use_color("InventoryFavoritesColorText", true); - if (use_color) - { - static const LLUIColor favorite_color = LLUIColorTable::instance().getColor("InventoryFavoriteColor", LLColor4::white); - style_params.color = favorite_color; - } - } - LLTextUtil::textboxSetHighlightedVal( mTitleCtrl, style_params, @@ -506,10 +466,6 @@ void LLPanelInventoryListItemBase::reshapeMiddleWidgets() S32 name_left = icon_rect.mRight + getWidgetSpacing(); S32 name_right = getLocalRect().getWidth() - mRightWidgetsWidth - getWidgetSpacing(); - if (mIsFavorite) - { - name_right -= FAVORITE_IMAGE_SIZE + FAVORITE_IMAGE_PAD; - } LLRect name_rect(mTitleCtrl->getRect()); name_rect.set(name_left, name_rect.mTop, name_right, name_rect.mBottom); mTitleCtrl->setShape(name_rect); |