feat(keyboard): add bottom row spacing, vertical offset, and gap adjustments

This commit is contained in:
pablohc
2026-04-12 23:08:50 +02:00
committed by jpirnay
parent 53d621a91f
commit 1d2584465d
4 changed files with 11 additions and 4 deletions
@@ -249,8 +249,11 @@ void KeyboardEntryActivity::render(RenderLock&&) {
}
}
const int bottomRowY = keyboardStartY + contentRows * (keyHeight + keySpacing);
const int bottomKeyWidth = 2 * keyWidth + keySpacing;
const int bottomRowGap = metrics.keyboardBottomKeySpacing > 0 ? 4 : 0;
const int bottomRowY = keyboardStartY + contentRows * (keyHeight + keySpacing) + bottomRowGap;
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);
struct BottomKeyInfo {
@@ -267,7 +270,7 @@ void KeyboardEntryActivity::render(RenderLock&&) {
};
for (int i = 0; i < BOTTOM_KEY_COUNT; i++) {
const int keyX = leftMargin + (2 * i) * (keyWidth + keySpacing);
const int keyX = leftMargin + i * (bottomKeyWidth + bkSpacing);
const bool isSelected = bottomSelectedRow && i == selectedCol;
GUI.drawKeyboardKey(renderer, Rect{keyX, bottomRowY, bottomKeyWidth, keyHeight}, bottomKeys[i].label, isSelected,