summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/llfolderview.cpp5
-rw-r--r--indra/llui/llfolderview.h1
-rw-r--r--indra/llui/llfolderviewitem.cpp8
3 files changed, 13 insertions, 1 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index b664065532..dc1b81666a 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -1693,6 +1693,11 @@ LLRect LLFolderView::getVisibleRect()
return visible_rect;
}
+S32 LLFolderView::getVisibleContentWidth()
+{
+ return (mScrollContainer ? mScrollContainer->getVisibleContentRect().getWidth() : 0);
+}
+
bool LLFolderView::getShowSelectionContext()
{
if (mShowSelectionContext)
diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h
index 7ed10d9223..d3d8f8daff 100644
--- a/indra/llui/llfolderview.h
+++ b/indra/llui/llfolderview.h
@@ -222,6 +222,7 @@ public:
void scrollToShowItem(LLFolderViewItem* item, const LLRect& constraint_rect);
void setScrollContainer( LLScrollContainer* parent ) { mScrollContainer = parent; }
LLRect getVisibleRect();
+ S32 getVisibleContentWidth();
bool search(LLFolderViewItem* first_item, const std::string &search_string, bool backward);
void setShowSelectionContext(bool show) { mShowSelectionContext = show; }
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 87eee6a9ae..3fbfefbdcd 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -828,8 +828,14 @@ void LLFolderViewItem::drawFavoriteIcon()
constexpr S32 PAD = 3;
constexpr S32 image_size = 14;
+ S32 width = mRoot->getVisibleContentWidth(); // star should stick to scroller's right side
+ if (width <= 0)
+ {
+ width = getRect().getWidth();
+ }
+
gl_draw_scaled_image(
- getRect().getWidth() - image_size - PAD, getRect().getHeight() - mItemHeight + PAD,
+ width - image_size - PAD, getRect().getHeight() - mItemHeight + PAD,
image_size, image_size, favorite_image->getImage(), sFgColor);
}
}