feat(keyboard): add bottom row spacing, vertical offset, and gap adjustments
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user