From 010f94f25d19addeaf85a0dfbf45bae6400f481a Mon Sep 17 00:00:00 2001 From: jpirnay Date: Tue, 19 May 2026 10:11:57 +0200 Subject: [PATCH] Fix icon position --- src/components/themes/lyra/LyraCarouselTheme.cpp | 3 ++- src/components/themes/lyra/LyraTheme.cpp | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/themes/lyra/LyraCarouselTheme.cpp b/src/components/themes/lyra/LyraCarouselTheme.cpp index ba7bfe93..603f7afd 100644 --- a/src/components/themes/lyra/LyraCarouselTheme.cpp +++ b/src/components/themes/lyra/LyraCarouselTheme.cpp @@ -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); diff --git a/src/components/themes/lyra/LyraTheme.cpp b/src/components/themes/lyra/LyraTheme.cpp index c233137d..99b6c3ff 100644 --- a/src/components/themes/lyra/LyraTheme.cpp +++ b/src/components/themes/lyra/LyraTheme.cpp @@ -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;