summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-02 01:46:38 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-03-02 01:46:46 +0200
commitcf901b5abbe5c24da92c6c0320e3831a3798a539 (patch)
tree9cb548084794de46e44a7af3af344be67150dd9f /indra
parent4d2bdbb05ac24b4121f05107399fa7be33539f74 (diff)
SL-19282 Thumbnail adjustments
Follow links, fix outfts missing 'image' option, adjust inspector, recolor 'worn' in gallery
Diffstat (limited to 'indra')
-rw-r--r--indra/llinventory/llinventory.cpp9
-rw-r--r--indra/llinventory/llinventory.h1
-rw-r--r--indra/newview/llinspecttexture.cpp29
-rw-r--r--indra/newview/llinventorybridge.cpp1
-rw-r--r--indra/newview/lloutfitgallery.cpp5
-rw-r--r--indra/newview/llviewerinventory.cpp17
-rw-r--r--indra/newview/llviewerinventory.h1
7 files changed, 50 insertions, 13 deletions
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index e00f652622..abe1b4dbd3 100644
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -504,15 +504,6 @@ void LLInventoryItem::setSaleInfo(const LLSaleInfo& sale_info)
mSaleInfo = sale_info;
}
-const LLUUID& LLInventoryItem::getThumbnailUUID() const
-{
- if (mThumbnailUUID.isNull() && mType == LLAssetType::AT_TEXTURE)
- {
- return mAssetUUID;
- }
- return mThumbnailUUID;
-}
-
LLInventoryType::EType LLInventoryItem::getInventoryType() const
{
return mInventoryType;
diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h
index 7af542c49a..dfe8b7659b 100644
--- a/indra/llinventory/llinventory.h
+++ b/indra/llinventory/llinventory.h
@@ -162,7 +162,6 @@ public:
virtual const std::string& getDescription() const;
virtual const std::string& getActualDescription() const; // Does not follow links
virtual const LLSaleInfo& getSaleInfo() const;
- virtual const LLUUID& getThumbnailUUID() const;
virtual LLInventoryType::EType getInventoryType() const;
virtual U32 getFlags() const;
virtual time_t getCreationDate() const;
diff --git a/indra/newview/llinspecttexture.cpp b/indra/newview/llinspecttexture.cpp
index 4ec0767c4e..843b4da757 100644
--- a/indra/newview/llinspecttexture.cpp
+++ b/indra/newview/llinspecttexture.cpp
@@ -59,6 +59,7 @@ LLToolTip* LLInspectTextureUtil::createInventoryToolTip(LLToolTip::Params p)
if (sdTooltip.has("thumbnail_id") && sdTooltip["thumbnail_id"].asUUID().notNull())
{
// go straight for thumbnail regardless of type
+ // TODO: make a tooltip factory?
return LLUICtrlFactory::create<LLTextureToolTip>(p);
}
@@ -147,12 +148,12 @@ LLTexturePreviewView::~LLTexturePreviewView()
void LLTexturePreviewView::draw()
{
+ LLView::draw();
+
if (m_Image)
{
LLRect rctClient = getLocalRect();
- gl_rect_2d(rctClient, LLColor4::black);
- rctClient.stretch(-2);
if (4 == m_Image->getComponents())
gl_rect_2d_checkerboard(rctClient);
gl_draw_scaled_image(rctClient.mLeft, rctClient.mBottom, rctClient.getWidth(), rctClient.getHeight(), m_Image);
@@ -199,6 +200,11 @@ LLTextureToolTip::LLTextureToolTip(const LLToolTip::Params& p)
, mPreviewSize(256)
{
mMaxWidth = llmax(mMaxWidth, mPreviewSize);
+
+ // Currently has to share params with LLToolTip, override values
+ setBackgroundColor(LLColor4::black);
+ setTransparentColor(LLColor4::black);
+ setBorderVisible(true);
}
LLTextureToolTip::~LLTextureToolTip()
@@ -229,6 +235,25 @@ void LLTextureToolTip::initFromParams(const LLToolTip::Params& p)
mPreviewView->setImageFromItemId(sdTextureParams["item_id"].asUUID());
}
+ // Currently has to share params with LLToolTip, override values manually
+ // Todo: provide from own params instead, may be like object inspector does it
+ LLViewBorder::Params border_params;
+ border_params.border_thickness(LLPANEL_BORDER_WIDTH);
+ border_params.highlight_light_color(LLColor4::white);
+ border_params.highlight_dark_color(LLColor4::white);
+ border_params.shadow_light_color(LLColor4::white);
+ border_params.shadow_dark_color(LLColor4::white);
+ addBorder(border_params);
+ setBorderVisible(true);
+
+ setBackgroundColor(LLColor4::black);
+ setBackgroundVisible(true);
+ setBackgroundOpaque(true);
+ setBackgroundImage(nullptr);
+ setTransparentImage(nullptr);
+
+ mTextBox->setColor(LLColor4::white);
+
snapToChildren();
}
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 5f1db0895c..0c7f237415 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -4240,6 +4240,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
if (cat && (cat->getPreferredType() == LLFolderType::FT_OUTFIT))
{
items.push_back(std::string("Rename"));
+ items.push_back(std::string("thumbnail"));
addDeleteContextMenuOptions(items, disabled_items);
// EXT-4030: disallow deletion of currently worn outfit
diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp
index 6ef8080d8c..a275af1565 100644
--- a/indra/newview/lloutfitgallery.cpp
+++ b/indra/newview/lloutfitgallery.cpp
@@ -741,10 +741,13 @@ void LLOutfitGalleryItem::setOutfitWorn(bool value)
mWorn = value;
LLStringUtil::format_map_t worn_string_args;
std::string worn_string = getString("worn_string", worn_string_args);
- LLUIColor text_color = LLUIColorTable::instance().getColor(mSelected ? "White" : (mWorn ? "OutfitGalleryItemWorn" : "White"), LLColor4::white);
+ LLUIColor text_color = LLUIColorTable::instance().getColor("White", LLColor4::white);
mOutfitWornText->setReadOnlyColor(text_color.get());
mOutfitNameText->setReadOnlyColor(text_color.get());
+ mOutfitWornText->setFont(value ? LLFontGL::getFontSansSerifBold() : LLFontGL::getFontSansSerifSmall());
+ mOutfitNameText->setFont(value ? LLFontGL::getFontSansSerifBold() : LLFontGL::getFontSansSerifSmall());
mOutfitWornText->setValue(value ? worn_string : "");
+ mOutfitNameText->setText(mOutfitName); // refresh LLTextViewModel to pick up font changes
}
void LLOutfitGalleryItem::setSelected(bool value)
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index 50252556de..27f57bda81 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -1893,6 +1893,23 @@ const LLSaleInfo& LLViewerInventoryItem::getSaleInfo() const
return LLInventoryItem::getSaleInfo();
}
+const LLUUID& LLViewerInventoryItem::getThumbnailUUID() const
+{
+ if (mThumbnailUUID.isNull() && mType == LLAssetType::AT_TEXTURE)
+ {
+ return mAssetUUID;
+ }
+ if (mThumbnailUUID.isNull() && mType == LLAssetType::AT_LINK)
+ {
+ return gInventory.getItem(getLinkedUUID())->getThumbnailUUID();
+ }
+ if (mThumbnailUUID.isNull() && mType == LLAssetType::AT_LINK_FOLDER)
+ {
+ return gInventory.getCategory(getLinkedUUID())->getThumbnailUUID();
+ }
+ return mThumbnailUUID;
+}
+
LLInventoryType::EType LLViewerInventoryItem::getInventoryType() const
{
if (const LLViewerInventoryItem *linked_item = getLinkedItem())
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h
index 24b632632b..3914dae343 100644
--- a/indra/newview/llviewerinventory.h
+++ b/indra/newview/llviewerinventory.h
@@ -72,6 +72,7 @@ public:
virtual const LLUUID& getCreatorUUID() const;
virtual const std::string& getDescription() const;
virtual const LLSaleInfo& getSaleInfo() const;
+ virtual const LLUUID& getThumbnailUUID() const;
virtual LLInventoryType::EType getInventoryType() const;
virtual bool isWearableType() const;
virtual LLWearableType::EType getWearableType() const;