summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-07-21 00:47:14 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-07-21 00:48:29 +0300
commit0941fcd5a48e9d4d95fb88750db3b964aa983486 (patch)
tree993ee26823fa7082de4814106d9353135729788d
parent4fb9a3f469c2cb0197d686acb68827f0fa32b451 (diff)
SL-20047 Indicate when gallery items are being cut
-rw-r--r--indra/newview/llinventorygallery.cpp40
-rw-r--r--indra/newview/llinventorygallery.h4
2 files changed, 37 insertions, 7 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index ca1b2eb09e..99bd772773 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -2230,7 +2230,9 @@ LLInventoryGalleryItem::LLInventoryGalleryItem(const Params& p)
mHidden(false),
mGallery(NULL),
mType(LLAssetType::AT_NONE),
- mSortGroup(SG_ITEM)
+ mSortGroup(SG_ITEM),
+ mCutGeneration(0),
+ mSelectedForCut(false)
{
buildFromFile("panel_inventory_gallery_item.xml");
}
@@ -2328,13 +2330,24 @@ void LLInventoryGalleryItem::setThumbnail(LLUUID id)
void LLInventoryGalleryItem::draw()
{
- LLPanel::draw();
+ if (isFadeItem())
+ {
+ // Fade out to indicate it's being cut
+ LLViewDrawContext context(0.5f);
+ LLPanel::draw();
+ }
+ else
+ {
+ LLPanel::draw();
+
+ // Draw border
+ LLUIColor border_color = LLUIColorTable::instance().getColor(mSelected ? "MenuItemHighlightBgColor" : "TextFgTentativeColor", LLColor4::white);
+ LLRect border = getChildView("preview_thumbnail")->getRect();
+ border.mRight = border.mRight + 1;
+ gl_rect_2d(border, border_color.get(), FALSE);
+ }
+
- // Draw border
- LLUIColor border_color = LLUIColorTable::instance().getColor(mSelected ? "MenuItemHighlightBgColor" : "TextFgTentativeColor", LLColor4::white);
- LLRect border = getChildView("preview_thumbnail")->getRect();
- border.mRight = border.mRight + 1;
- gl_rect_2d(border, border_color.get(), FALSE);
}
void LLInventoryGalleryItem::setItemName(std::string name)
@@ -2543,6 +2556,19 @@ void LLInventoryGalleryItem::updateNameText()
getChild<LLThumbnailCtrl>("preview_thumbnail")->setToolTip(mItemName + mPermSuffix + mWornSuffix);
}
+bool LLInventoryGalleryItem::isFadeItem()
+{
+ LLClipboard& clipboard = LLClipboard::instance();
+ if (mCutGeneration == clipboard.getGeneration())
+ {
+ return mSelectedForCut;
+ }
+
+ mCutGeneration = clipboard.getGeneration();
+ mSelectedForCut = clipboard.isCutMode() && clipboard.isOnClipboard(mUUID);
+ return mSelectedForCut;
+}
+
//-----------------------------
// LLThumbnailsObserver
//-----------------------------
diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h
index 42bda59c5a..f2e5e38940 100644
--- a/indra/newview/llinventorygallery.h
+++ b/indra/newview/llinventorygallery.h
@@ -335,6 +335,8 @@ public:
void updateNameText();
private:
+ bool isFadeItem();
+
LLUUID mUUID;
LLTextBox* mNameText;
LLPanel* mTextBgPanel;
@@ -344,6 +346,8 @@ private:
bool mHidden;
bool mIsFolder;
bool mIsLink;
+ S32 mCutGeneration;
+ bool mSelectedForCut;
std::string mAssetIDStr;
std::string mDesc;