refactor(ui): share single KeyboardWidget instance across screens

Moves KeyboardWidget from a per-screen value member to a single instance
owned by UITask, passed to SettingsScreen, QuickMsgScreen, and BotScreen
as a pointer. Only one screen is ever active at a time, so the shared
state is safe. Saves ~1.5 KB of always-resident heap.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-06-08 20:42:18 +02:00
co-authored by Claude Sonnet 4.6
parent 2d6d35192b
commit c339dc7d97
5 changed files with 34 additions and 33 deletions
+2
View File
@@ -24,6 +24,7 @@
#include "../NodePrefs.h"
#include "../Trail.h"
#include "../Waypoint.h"
#include "KeyboardWidget.h"
class UITask : public AbstractUITask {
DisplayDriver* _display;
@@ -43,6 +44,7 @@ class UITask : public AbstractUITask {
bool _lock_seq_used; // true = suppress next back_btn CLICK (post-sequence release)
char _alert[80];
char _notif_mel_buf[220]; // persistent RTTTL buffer for custom notification melodies
KeyboardWidget _kb; // shared across all screens — only one active at a time
unsigned long _alert_expiry;
int _msgcount;
int _room_unread;