mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Temporary fix of old keyboard+lightbar
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use crate::slint_generatedMainWindow::{
|
||||
AuraPowerState as SlintAuraPowerState, LaptopAuraPower as SlintLaptopAuraPower,
|
||||
AuraDevType as SlintDeviceType, AuraPowerState as SlintAuraPowerState,
|
||||
LaptopAuraPower as SlintLaptopAuraPower,
|
||||
};
|
||||
|
||||
impl From<rog_aura::AuraEffect> for crate::slint_generatedMainWindow::AuraEffect {
|
||||
@@ -51,7 +52,7 @@ impl From<crate::slint_generatedMainWindow::AuraEffect> for rog_aura::AuraEffect
|
||||
}
|
||||
|
||||
use rog_aura::keyboard::{AuraPowerState, LaptopAuraPower};
|
||||
use rog_aura::PowerZones;
|
||||
use rog_aura::{AuraDeviceType, PowerZones};
|
||||
use slint::{Model, ModelRc, RgbaColor};
|
||||
|
||||
use crate::slint_generatedMainWindow::PowerZones as SlintPowerZones;
|
||||
@@ -63,6 +64,7 @@ impl From<PowerZones> for SlintPowerZones {
|
||||
PowerZones::Lightbar => SlintPowerZones::Lightbar,
|
||||
PowerZones::Lid => SlintPowerZones::Lid,
|
||||
PowerZones::RearGlow => SlintPowerZones::RearGlow,
|
||||
PowerZones::KeyboardAndLightbar => SlintPowerZones::KeyboardAndLightbar,
|
||||
PowerZones::None => SlintPowerZones::Keyboard,
|
||||
}
|
||||
}
|
||||
@@ -76,6 +78,7 @@ impl From<SlintPowerZones> for PowerZones {
|
||||
SlintPowerZones::Lightbar => PowerZones::Lightbar,
|
||||
SlintPowerZones::Lid => PowerZones::Lid,
|
||||
SlintPowerZones::RearGlow => PowerZones::RearGlow,
|
||||
SlintPowerZones::KeyboardAndLightbar => PowerZones::KeyboardAndLightbar,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,3 +142,27 @@ impl From<LaptopAuraPower> for SlintLaptopAuraPower {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<SlintDeviceType> for AuraDeviceType {
|
||||
fn from(value: SlintDeviceType) -> Self {
|
||||
match value {
|
||||
SlintDeviceType::New => Self::LaptopPost2021,
|
||||
SlintDeviceType::Old => Self::LaptopPre2021,
|
||||
SlintDeviceType::Tuf => Self::LaptopTuf,
|
||||
SlintDeviceType::ScsiExtDisk => Self::ScsiExtDisk,
|
||||
SlintDeviceType::Unknown => Self::Unknown,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<AuraDeviceType> for SlintDeviceType {
|
||||
fn from(value: AuraDeviceType) -> Self {
|
||||
match value {
|
||||
AuraDeviceType::LaptopPost2021 => SlintDeviceType::New,
|
||||
AuraDeviceType::LaptopPre2021 => SlintDeviceType::Old,
|
||||
AuraDeviceType::LaptopTuf => SlintDeviceType::Tuf,
|
||||
AuraDeviceType::ScsiExtDisk => SlintDeviceType::ScsiExtDisk,
|
||||
AuraDeviceType::Unknown => SlintDeviceType::Unknown,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ pub fn setup_aura_page(ui: &MainWindow, _states: Arc<Mutex<Config>>) {
|
||||
set_ui_props_async!(handle, aura, AuraPageData, led_mode);
|
||||
set_ui_props_async!(handle, aura, AuraPageData, led_mode_data);
|
||||
set_ui_props_async!(handle, aura, AuraPageData, led_power);
|
||||
set_ui_props_async!(handle, aura, AuraPageData, device_type);
|
||||
|
||||
if let Ok(power) = aura.supported_power_zones().await {
|
||||
log::debug!("Available LED power modes {power:?}");
|
||||
|
||||
Reference in New Issue
Block a user