mirror of
https://github.com/subhobhai943/SUB-OS.git
synced 2026-10-26 17:12:35 +00:00
fix(gui): make the Settings app actually apply changes
The Settings window rendered fine but its controls only mutated the app's local
settings_data_t -- nothing was ever wired to the running system, so toggling
options did nothing ("not working").
- Appearance: "Show wallpaper grid overlay" now calls gui_desktop_set_grid()
live; the desktop grid shows/hides immediately.
- Input: "Show seconds in taskbar clock" now calls gui_desktop_set_clock_seconds();
the taskbar clock switches between HH:MM and HH:MM:SS.
- Power: the CPUFreq governor radios now call cpufreq_set_governor() (mapping the
UI order to the enum), and Apply/Defaults push all preferences to the system.
- The app seeds its controls from live state on open (grid/clock/governor), so it
reflects reality instead of hard-coded defaults.
Also add public gui_desktop_set_grid/get_grid and set/get_clock_seconds, and
give Settings a dedicated event handler that frees its state on close (the
shared app_forward_event leaked it).
Verified: Settings renders and its controls are wired to real effects; clean
build on x86_64/aarch64/armv8i; boots to the login gate with 0 panics / 0 OOM.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Fh5z6V7nGPbHvqVG5p4CXX
This commit is contained in:
1 parent
0377726615
commit
ef6714a004
3 files changed
+75
-14
No files matched your search
+11
-1
@@ -78,6 +78,7 @@ static int g_context_x = 0, g_context_y = 0;
|
||||
static bool g_desktop_running = false;
|
||||
static bool g_prev_left = false, g_prev_right = false;
|
||||
static bool g_show_grid = true;
|
||||
static bool g_clock_seconds = true;
|
||||
static int g_selected_icon = -1;
|
||||
static int g_hover_menu_item = -1;
|
||||
static uint64_t g_frames = 0;
|
||||
@@ -359,10 +360,19 @@ void gui_desktop_render_taskbar(void) {
|
||||
|
||||
rtc_time_t now;
|
||||
rtc_get_time(&now);
|
||||
snprintf(buf, sizeof(buf), "%02u:%02u:%02u", now.hour, now.minute, now.second);
|
||||
if (g_clock_seconds) {
|
||||
snprintf(buf, sizeof(buf), "%02u:%02u:%02u", now.hour, now.minute, now.second);
|
||||
} else {
|
||||
snprintf(buf, sizeof(buf), "%02u:%02u", now.hour, now.minute);
|
||||
}
|
||||
gui_gfx_draw_string_16_shadow(sw - 84, ty + 8, buf, GUI_THEME_PRIMARY, GUI_COLOR_BLACK);
|
||||
}
|
||||
|
||||
void gui_desktop_set_grid(bool on) { g_show_grid = on; }
|
||||
bool gui_desktop_get_grid(void) { return g_show_grid; }
|
||||
void gui_desktop_set_clock_seconds(bool on) { g_clock_seconds = on; }
|
||||
bool gui_desktop_get_clock_seconds(void) { return g_clock_seconds; }
|
||||
|
||||
// ===========================================================================
|
||||
// Start menu
|
||||
// ===========================================================================
|
||||
|
||||
Reference in new issue
Block a user