refactor: redesign on-screen keyboard with 10-col layout, symbol mode, long-press, visual improvements

This commit is contained in:
pablohc
2026-04-12 23:08:50 +02:00
committed by jpirnay
parent 4449b807a4
commit 53d621a91f
7 changed files with 380 additions and 249 deletions
+9 -3
View File
@@ -62,10 +62,13 @@ struct ThemeMetrics {
int keyboardKeySpacing;
bool keyboardBottomAligned;
bool keyboardCenteredText;
int keyboardVerticalOffset;
};
enum UIIcon { Folder, Text, Image, Book, File, Recent, Settings, Transfer, Library, Wifi, Hotspot, Weather };
enum class KeyboardKeyType { Normal, Shift, Mode, Space, Del, Ok };
// Default theme implementation (Classic Theme)
// Additional themes can inherit from this and override methods as needed
@@ -98,8 +101,9 @@ constexpr ThemeMetrics values = {.batteryWidth = 15,
.keyboardKeyWidth = 22,
.keyboardKeyHeight = 30,
.keyboardKeySpacing = 10,
.keyboardBottomAligned = false,
.keyboardCenteredText = false};
.keyboardBottomAligned = true,
.keyboardCenteredText = false,
.keyboardVerticalOffset = -10};
}
class BaseTheme {
@@ -142,7 +146,9 @@ class BaseTheme {
const int textYOffset = 0) const;
virtual void drawHelpText(const GfxRenderer& renderer, Rect rect, const char* label) const;
virtual void drawTextField(const GfxRenderer& renderer, Rect rect, const int textWidth) const;
virtual void drawKeyboardKey(const GfxRenderer& renderer, Rect rect, const char* label, const bool isSelected) const;
virtual void drawKeyboardKey(const GfxRenderer& renderer, Rect rect, const char* label, const bool isSelected,
const char* secondaryLabel = nullptr,
KeyboardKeyType keyType = KeyboardKeyType::Normal) const;
virtual bool showsFileIcons() const { return false; }
// Shared constants and helpers for battery drawing (used by all themes)