Slight layout changes

This commit is contained in:
jpirnay
2026-04-12 23:32:19 +02:00
parent bb9687d585
commit 5f82a28ac6
5 changed files with 22 additions and 11 deletions
+7 -3
View File
@@ -830,10 +830,14 @@ void LyraTheme::drawKeyboardKey(const GfxRenderer& renderer, Rect rect, const ch
const bool hasSecondary = secondaryLabel != nullptr && secondaryLabel[0] != '\0';
const int primaryOffset = 0;
const int textWidth = renderer.getTextWidth(UI_12_FONT_ID, label);
const int fontId = (keyType == KeyboardKeyType::Shift || keyType == KeyboardKeyType::Mode ||
keyType == KeyboardKeyType::Reveal || keyType == KeyboardKeyType::Ok)
? UI_10_FONT_ID
: UI_12_FONT_ID;
const int textWidth = renderer.getTextWidth(fontId, label);
const int textX = rect.x + (rect.width - textWidth) / 2;
const int textY = rect.y + (rect.height - renderer.getLineHeight(UI_12_FONT_ID)) / 2 + primaryOffset;
renderer.drawText(UI_12_FONT_ID, textX, textY, label, !invert);
const int textY = rect.y + (rect.height - renderer.getLineHeight(fontId)) / 2 + primaryOffset;
renderer.drawText(fontId, textX, textY, label, !invert);
if (hasSecondary) {
const int secWidth = renderer.getTextWidth(SMALL_FONT_ID, secondaryLabel);