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
+3 -4
View File
@@ -105,7 +105,6 @@ public:
static const int QUICK_MSGS_MAX = 10;
#include "KeyboardWidget.h"
#include "FullscreenMsgView.h"
#include "SensorPlaceholders.h"
#include "SettingsScreen.h"
@@ -1198,11 +1197,11 @@ void UITask::begin(DisplayDriver* display, SensorManager* sensors, NodePrefs* no
splash = new SplashScreen(this);
home = new HomeScreen(this, &rtc_clock, sensors, node_prefs);
settings = new SettingsScreen(this);
quick_msg = new QuickMsgScreen(this);
settings = new SettingsScreen(this, &_kb);
quick_msg = new QuickMsgScreen(this, &_kb);
tools_screen = new ToolsScreen(this);
ringtone_edit = new RingtoneEditorScreen(this, node_prefs);
bot_screen = new BotScreen(this, node_prefs);
bot_screen = new BotScreen(this, node_prefs, &_kb);
nearby_screen = new NearbyScreen(this);
dashboard_config = new DashboardConfigScreen(this, node_prefs);
auto_advert_screen = new AutoAdvertScreen(this, node_prefs);