diff --git a/Cargo.lock b/Cargo.lock index 3ce76bc7..7778ccd9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2605,7 +2605,6 @@ dependencies = [ "log", "nix 0.26.1", "notify-rust", - "once_cell", "png_pong", "rog_anime", "rog_aura", diff --git a/rog-control-center/Cargo.toml b/rog-control-center/Cargo.toml index 86eba31b..fed90f6b 100644 --- a/rog-control-center/Cargo.toml +++ b/rog-control-center/Cargo.toml @@ -40,5 +40,3 @@ png_pong.workspace = true nix = "^0.26.1" tempfile = "3.3.0" - -once_cell = "1.10.0" diff --git a/rog-control-center/src/update_and_notify.rs b/rog-control-center/src/update_and_notify.rs index 8c2664b7..7b64c3b3 100644 --- a/rog-control-center/src/update_and_notify.rs +++ b/rog-control-center/src/update_and_notify.rs @@ -54,7 +54,7 @@ impl Default for EnabledNotifications { receive_notify_charge_control_end_threshold: true, receive_notify_mains_online: false, receive_notify_profile: true, - receive_notify_led: false, + receive_notify_led: true, receive_power_states: false, receive_notify_gfx: false, receive_notify_gfx_status: false, diff --git a/rog-control-center/src/widgets/app_settings.rs b/rog-control-center/src/widgets/app_settings.rs index a8088d3c..bf1f3809 100644 --- a/rog-control-center/src/widgets/app_settings.rs +++ b/rog-control-center/src/widgets/app_settings.rs @@ -12,7 +12,8 @@ pub fn app_settings(config: &mut Config, states: &mut SystemState, ui: &mut Ui) Default::default() }; - if ui + ui.label("Application settings"); + let app_changed = ui .checkbox(&mut config.run_in_background, "Run in Background") .clicked() || ui @@ -23,11 +24,19 @@ pub fn app_settings(config: &mut Config, states: &mut SystemState, ui: &mut Ui) &mut enabled_notifications.all_enabled, "Enable Notifications", ) - .clicked() + .clicked(); + + ui.label("Notification settings"); + let notif_changed = ui + .checkbox( + &mut enabled_notifications.receive_notify_gfx_status, + "Enable dGPU status notification", + ) + .clicked() || ui .checkbox( - &mut enabled_notifications.receive_notify_gfx_status, - "Enable dGPU status notification", + &mut enabled_notifications.receive_notify_led, + "Enable LED mode change notification", ) .clicked() || ui @@ -71,8 +80,9 @@ pub fn app_settings(config: &mut Config, states: &mut SystemState, ui: &mut Ui) &mut enabled_notifications.receive_notify_post_boot_sound, "Enable BIOS post sound notification", ) - .clicked() - { + .clicked(); + + if app_changed || notif_changed { if let Ok(mut lock) = states.enabled_notifications.lock() { // Replace inner content before save *lock = enabled_notifications;