Fix icon position

This commit is contained in:
jpirnay
2026-05-19 10:11:57 +02:00
parent d4b2a24e2a
commit 010f94f25d
2 changed files with 5 additions and 3 deletions
@@ -586,14 +586,15 @@ void LyraCarouselTheme::drawList(const GfxRenderer& renderer, Rect rect, int ite
int textX = rect.x + LyraCarouselMetrics::values.contentSidePadding + hPad;
int textWidth = contentWidth - LyraCarouselMetrics::values.contentSidePadding * 2 - hPad * 2;
int iconSize = 0;
int iconY = 0;
if (rowIcon != nullptr) {
iconSize = (rowSubtitle != nullptr) ? mainMenuIconSz : listIconSz;
iconY = (rowHeight - iconSize) / 2;
textX += iconSize + hPad;
textWidth -= iconSize + hPad;
}
const auto pageStartIndex = selectedIndex / pageItems * pageItems;
const int iconY = (rowSubtitle != nullptr) ? 16 : 10;
for (int i = pageStartIndex; i < itemCount && i < pageStartIndex + pageItems; i++) {
const int itemY = rect.y + (i % pageItems) * rowHeight;
const bool sel = (i == selectedIndex);
+3 -2
View File
@@ -364,16 +364,17 @@ void LyraTheme::drawList(const GfxRenderer& renderer, Rect rect, int itemCount,
int textX = rect.x + LyraMetrics::values.contentSidePadding + hPaddingInSelection;
int textWidth = contentWidth - LyraMetrics::values.contentSidePadding * 2 - hPaddingInSelection * 2;
int iconSize;
int iconSize = 0;
int iconY = 0;
if (rowIcon != nullptr) {
iconSize = (rowSubtitle != nullptr) ? mainMenuIconSize : listIconSize;
iconY = (rowHeight - iconSize) / 2;
textX += iconSize + hPaddingInSelection;
textWidth -= iconSize + hPaddingInSelection;
}
// Draw all items
const auto pageStartIndex = selectedIndex / pageItems * pageItems;
int iconY = (rowSubtitle != nullptr) ? 16 : 10;
for (int i = pageStartIndex; i < itemCount && i < pageStartIndex + pageItems; i++) {
const int itemY = rect.y + (i % pageItems) * rowHeight;
int rowTextWidth = textWidth;