Formulate slint patterns

This commit is contained in:
Luke D. Jones
2024-02-25 19:24:20 +13:00
parent c3b02a2bb0
commit 91b1456d06
4 changed files with 79 additions and 10 deletions

View File

@@ -16,8 +16,8 @@ use rog_control_center::system_state::{AuraCreation, SystemState};
use rog_control_center::tray::init_tray;
use rog_control_center::update_and_notify::{start_notifications, EnabledNotifications};
use rog_control_center::{
get_ipc_file, on_tmp_dir_exists, print_versions, MainWindow, RogDbusClientBlocking, QUIT_APP,
SHOWING_GUI, SHOW_GUI,
get_ipc_file, on_tmp_dir_exists, print_versions, AvailableSystemProperties, MainWindow,
RogDbusClientBlocking, SystemPage, QUIT_APP, SHOWING_GUI, SHOW_GUI,
};
use tokio::runtime::Runtime;
// use winit::monitor::VideoMode;
@@ -200,6 +200,31 @@ fn setup_window(_states: Arc<Mutex<SystemState>>) -> MainWindow {
.ok();
});
ui.global::<SystemPage>().on_set_charge(|v1, v2| {
if v1 != v2 {
dbg!(v1);
dbg!(v2);
}
});
let props = AvailableSystemProperties {
ac_command: true,
bat_command: true,
charge_limit: true,
disable_nvidia_powerd_on_battery: true,
mini_led_mode: true,
nv_dynamic_boost: true,
nv_temp_target: true,
panel_od: true,
ppt_apu_sppt: true,
ppt_fppt: true,
ppt_pl1_spl: true,
ppt_pl2_sppt: true,
ppt_platform_sppt: true,
throttle_policy: true,
};
ui.global::<SystemPage>().set_available(props);
ui.on_exit_app(move || {
slint::quit_event_loop().unwrap();
});

View File

@@ -359,7 +359,7 @@ impl SystemState {
aura,
anime: AnimeState::new(&asus_dbus)
.map_err(|e| {
let e = format!("Could not get AanimeState state: {e}");
let e = format!("Could not get AnimeState state: {e}");
error!("{e}");
})
.unwrap_or_default(),