mirror of
https://github.com/ratspeak/ratdeck.git
synced 2026-07-18 17:56:12 +00:00
ui: light/dark theme toggle
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "input/InputManager.h"
|
||||
#include "input/HotkeyManager.h"
|
||||
#include "ui/UIManager.h"
|
||||
#include "ui/Theme.h"
|
||||
#include "ui/LvTabBar.h"
|
||||
#include "ui/LvInput.h"
|
||||
#include "ui/screens/LvBootScreen.h"
|
||||
@@ -1106,6 +1107,8 @@ void setup() {
|
||||
} else {
|
||||
Serial.println("[BOOT] Early flash mount failed; using default radio config");
|
||||
}
|
||||
// Select palette before any LVGL styles are built
|
||||
Theme::setScheme(userConfig.settings().themeLight ? Theme::Scheme::LIGHT : Theme::Scheme::DARK);
|
||||
|
||||
// Step 4: Radio + SD init BEFORE display
|
||||
// Radio and SD must init while SPIClass exclusively owns SPI2_HOST.
|
||||
@@ -1250,6 +1253,11 @@ void setup() {
|
||||
|
||||
lvBootScreen.setProgress(0.64f, "Loading config...");
|
||||
userConfig.load(sdStore, flash);
|
||||
// SD config may override the early flash-only load; re-sync palette
|
||||
{
|
||||
Theme::Scheme want = userConfig.settings().themeLight ? Theme::Scheme::LIGHT : Theme::Scheme::DARK;
|
||||
if (want != Theme::scheme()) { Theme::setScheme(want); ui.applyTheme(); }
|
||||
}
|
||||
inputManager.setTrackballSpeed(userConfig.settings().trackballSpeed);
|
||||
applyRadioSettingsToHardware(userConfig.settings(), "BOOT PRE-RNS");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user