fix: add default switch case, remove duplicate fillRect, suppress unused textWidth, rename bottomSelectedRow

This commit is contained in:
pablohc
2026-04-12 23:08:50 +02:00
committed by jpirnay
parent 74a3fbd5db
commit bc0205df79
2 changed files with 5 additions and 6 deletions
@@ -82,6 +82,8 @@ bool KeyboardEntryActivity::handleKeyPress() {
case SpecOk:
onComplete(text);
return false;
default:
return true;
}
}
@@ -254,7 +256,7 @@ void KeyboardEntryActivity::render(RenderLock&&) {
const int bkSpacing = metrics.keyboardBottomKeySpacing;
const int contentTotalWidth = COLS * keyWidth + (COLS - 1) * keySpacing;
const int bottomKeyWidth = (contentTotalWidth - (BOTTOM_KEY_COUNT - 1) * bkSpacing) / BOTTOM_KEY_COUNT;
const int bottomSelectedRow = isBottomRow(selectedRow);
const bool bottomSelected = isBottomRow(selectedRow);
struct BottomKeyInfo {
KeyboardKeyType themeType;
@@ -270,7 +272,7 @@ void KeyboardEntryActivity::render(RenderLock&&) {
for (int i = 0; i < BOTTOM_KEY_COUNT; i++) {
const int keyX = leftMargin + i * (bottomKeyWidth + bkSpacing);
const bool isSelected = bottomSelectedRow && i == selectedCol;
const bool isSelected = bottomSelected && i == selectedCol;
GUI.drawKeyboardKey(renderer, Rect{keyX, bottomRowY, bottomKeyWidth, keyHeight}, bottomKeys[i].label, isSelected,
nullptr, bottomKeys[i].themeType);