Update readme, slash configs

This commit is contained in:
Luke D. Jones
2025-01-12 17:36:10 +13:00
parent 2123f369ad
commit 128bc3fce1
113 changed files with 1545 additions and 1305 deletions

View File

@@ -67,7 +67,7 @@ pub fn show_toast(
success: SharedString,
fail: SharedString,
handle: Weak<MainWindow>,
result: zbus::Result<()>,
result: zbus::Result<()>
) {
match result {
Ok(_) => {
@@ -77,7 +77,7 @@ pub fn show_toast(
log::warn!("{fail}: {e}");
handle.unwrap().invoke_show_toast(fail)
})
.ok(),
.ok()
};
}
@@ -102,9 +102,9 @@ pub fn setup_window(config: Arc<Mutex<Config>>) -> MainWindow {
available.contains(&"xyz.ljones.Anime".to_string()),
available.contains(&"xyz.ljones.FanCurves".to_string()),
true,
true,
true
]
.into(),
.into()
);
ui.on_exit_app(move || {

View File

@@ -52,9 +52,9 @@ pub fn setup_anime_page(ui: &MainWindow, _states: Arc<Mutex<Config>>) {
boot: boot.into(),
awake: awake.into(),
sleep: sleep.into(),
shutdown: shutdown.into(),
shutdown: shutdown.into()
})
.await,
.await
);
});
});

View File

@@ -9,7 +9,7 @@ use slint::{ComponentHandle, Model, RgbaColor, SharedString};
use crate::config::Config;
use crate::ui::show_toast;
use crate::{
set_ui_callbacks, set_ui_props_async, AuraPageData, MainWindow, PowerZones as SlintPowerZones,
set_ui_callbacks, set_ui_props_async, AuraPageData, MainWindow, PowerZones as SlintPowerZones
};
fn decode_hex(s: &str) -> RgbaColor<u8> {
@@ -19,7 +19,7 @@ fn decode_hex(s: &str) -> RgbaColor<u8> {
alpha: 255,
red: 0,
green: 0,
blue: 0,
blue: 0
};
}
let c: Vec<u8> = (0..s.len())
@@ -30,7 +30,7 @@ fn decode_hex(s: &str) -> RgbaColor<u8> {
alpha: 255,
red: *c.first().unwrap_or(&255),
green: *c.get(1).unwrap_or(&128),
blue: *c.get(2).unwrap_or(&32),
blue: *c.get(2).unwrap_or(&32)
}
}
@@ -198,7 +198,7 @@ pub fn setup_aura_page(ui: &MainWindow, _states: Arc<Mutex<Config>>) {
"Aura power settings changed".into(),
"Failed to set Aura power settings".into(),
handle_copy,
proxy_copy.set_led_power(power).await,
proxy_copy.set_led_power(power).await
);
});
});

View File

@@ -13,7 +13,7 @@ pub fn update_fan_data(
handle: Weak<MainWindow>,
bal: Vec<CurveData>,
perf: Vec<CurveData>,
quiet: Vec<CurveData>,
quiet: Vec<CurveData>
) {
handle
.upgrade_in_event_loop(move |handle| {
@@ -24,7 +24,7 @@ pub fn update_fan_data(
.zip(pwm.iter())
.map(|(x, y)| Node {
x: *x as f32,
y: *y as f32,
y: *y as f32
})
.collect();
tmp.as_slice().into()
@@ -199,6 +199,6 @@ fn fan_data_for(fan: FanType, enabled: bool, data: Vec<Node>) -> CurveData {
fan: fan.into(),
pwm,
temp,
enabled,
enabled
}
}

View File

@@ -15,7 +15,7 @@ use crate::{set_ui_props_async, AttrMinMax, MainWindow, SystemPageData};
const MINMAX: AttrMinMax = AttrMinMax {
min: 0,
max: 0,
val: -1.0,
val: -1.0
};
pub fn setup_system_page(ui: &MainWindow, _config: Arc<Mutex<Config>>) {