#3897 Fix favorite's stars being hidden in some cases

master
Andrey Kleshchev 2025-04-14 19:02:29 +03:00 committed by Andrey Lihatskiy
parent 1f17536cc8
commit 207ef20e9e
3 changed files with 13 additions and 1 deletions

View File

@ -1693,6 +1693,11 @@ LLRect LLFolderView::getVisibleRect()
return visible_rect;
}
S32 LLFolderView::getVisibleContentWidth()
{
return (mScrollContainer ? mScrollContainer->getVisibleContentRect().getWidth() : 0);
}
bool LLFolderView::getShowSelectionContext()
{
if (mShowSelectionContext)

View File

@ -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; }

View File

@ -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);
}
}