From 207ef20e9e7a42d15e553b6b2c22048bf0ef04d1 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 14 Apr 2025 19:02:29 +0300 Subject: #3897 Fix favorite's stars being hidden in some cases --- indra/llui/llfolderview.cpp | 5 +++++ indra/llui/llfolderview.h | 1 + indra/llui/llfolderviewitem.cpp | 8 +++++++- 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'indra') 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); } } -- cgit v1.2.3