Fix icon position
This commit is contained in:
@@ -586,14 +586,15 @@ void LyraCarouselTheme::drawList(const GfxRenderer& renderer, Rect rect, int ite
|
|||||||
int textX = rect.x + LyraCarouselMetrics::values.contentSidePadding + hPad;
|
int textX = rect.x + LyraCarouselMetrics::values.contentSidePadding + hPad;
|
||||||
int textWidth = contentWidth - LyraCarouselMetrics::values.contentSidePadding * 2 - hPad * 2;
|
int textWidth = contentWidth - LyraCarouselMetrics::values.contentSidePadding * 2 - hPad * 2;
|
||||||
int iconSize = 0;
|
int iconSize = 0;
|
||||||
|
int iconY = 0;
|
||||||
if (rowIcon != nullptr) {
|
if (rowIcon != nullptr) {
|
||||||
iconSize = (rowSubtitle != nullptr) ? mainMenuIconSz : listIconSz;
|
iconSize = (rowSubtitle != nullptr) ? mainMenuIconSz : listIconSz;
|
||||||
|
iconY = (rowHeight - iconSize) / 2;
|
||||||
textX += iconSize + hPad;
|
textX += iconSize + hPad;
|
||||||
textWidth -= iconSize + hPad;
|
textWidth -= iconSize + hPad;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto pageStartIndex = selectedIndex / pageItems * pageItems;
|
const auto pageStartIndex = selectedIndex / pageItems * pageItems;
|
||||||
const int iconY = (rowSubtitle != nullptr) ? 16 : 10;
|
|
||||||
for (int i = pageStartIndex; i < itemCount && i < pageStartIndex + pageItems; i++) {
|
for (int i = pageStartIndex; i < itemCount && i < pageStartIndex + pageItems; i++) {
|
||||||
const int itemY = rect.y + (i % pageItems) * rowHeight;
|
const int itemY = rect.y + (i % pageItems) * rowHeight;
|
||||||
const bool sel = (i == selectedIndex);
|
const bool sel = (i == selectedIndex);
|
||||||
|
|||||||
@@ -364,16 +364,17 @@ void LyraTheme::drawList(const GfxRenderer& renderer, Rect rect, int itemCount,
|
|||||||
|
|
||||||
int textX = rect.x + LyraMetrics::values.contentSidePadding + hPaddingInSelection;
|
int textX = rect.x + LyraMetrics::values.contentSidePadding + hPaddingInSelection;
|
||||||
int textWidth = contentWidth - LyraMetrics::values.contentSidePadding * 2 - hPaddingInSelection * 2;
|
int textWidth = contentWidth - LyraMetrics::values.contentSidePadding * 2 - hPaddingInSelection * 2;
|
||||||
int iconSize;
|
int iconSize = 0;
|
||||||
|
int iconY = 0;
|
||||||
if (rowIcon != nullptr) {
|
if (rowIcon != nullptr) {
|
||||||
iconSize = (rowSubtitle != nullptr) ? mainMenuIconSize : listIconSize;
|
iconSize = (rowSubtitle != nullptr) ? mainMenuIconSize : listIconSize;
|
||||||
|
iconY = (rowHeight - iconSize) / 2;
|
||||||
textX += iconSize + hPaddingInSelection;
|
textX += iconSize + hPaddingInSelection;
|
||||||
textWidth -= iconSize + hPaddingInSelection;
|
textWidth -= iconSize + hPaddingInSelection;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw all items
|
// Draw all items
|
||||||
const auto pageStartIndex = selectedIndex / pageItems * pageItems;
|
const auto pageStartIndex = selectedIndex / pageItems * pageItems;
|
||||||
int iconY = (rowSubtitle != nullptr) ? 16 : 10;
|
|
||||||
for (int i = pageStartIndex; i < itemCount && i < pageStartIndex + pageItems; i++) {
|
for (int i = pageStartIndex; i < itemCount && i < pageStartIndex + pageItems; i++) {
|
||||||
const int itemY = rect.y + (i % pageItems) * rowHeight;
|
const int itemY = rect.y + (i % pageItems) * rowHeight;
|
||||||
int rowTextWidth = textWidth;
|
int rowTextWidth = textWidth;
|
||||||
|
|||||||
Reference in New Issue
Block a user