Unify the laptop aura power stuff

This commit is contained in:
Luke D. Jones
2024-04-08 21:33:28 +12:00
parent 635d0378ac
commit 91ca049298
14 changed files with 425 additions and 501 deletions

View File

@@ -46,6 +46,7 @@ impl From<crate::slint_generatedMainWindow::AuraEffect> for rog_aura::AuraEffect
}
}
use rog_aura::aura_detection::PowerZones;
use rog_aura::keyboard::{AuraPowerState, LaptopOldAuraPower, LaptopTufAuraPower};
use rog_aura::usb::AuraPowerDev;
use slint::{Model, ModelRc, RgbaColor};
@@ -102,11 +103,12 @@ use crate::slint_generatedMainWindow::PowerZones as SlintPowerZones;
impl From<rog_aura::aura_detection::PowerZones> for SlintPowerZones {
fn from(value: rog_aura::aura_detection::PowerZones) -> Self {
match value {
rog_aura::aura_detection::PowerZones::Logo => SlintPowerZones::Logo,
rog_aura::aura_detection::PowerZones::Keyboard => SlintPowerZones::Keyboard,
rog_aura::aura_detection::PowerZones::Lightbar => SlintPowerZones::Lightbar,
rog_aura::aura_detection::PowerZones::Lid => SlintPowerZones::Lid,
rog_aura::aura_detection::PowerZones::RearGlow => SlintPowerZones::RearGlow,
PowerZones::Logo => SlintPowerZones::Logo,
PowerZones::Keyboard => SlintPowerZones::Keyboard,
PowerZones::Lightbar => SlintPowerZones::Lightbar,
PowerZones::Lid => SlintPowerZones::Lid,
PowerZones::RearGlow => SlintPowerZones::RearGlow,
PowerZones::KeyboardAndLightbar => todo!(),
}
}
}

View File

@@ -1,6 +1,6 @@
use std::sync::{Arc, Mutex};
use rog_aura::usb::AuraPowerDev;
use rog_aura::keyboard::LaptopAuraPower;
use rog_dbus::zbus_aura::AuraProxy;
use slint::{ComponentHandle, Model, RgbaColor, SharedString};
@@ -166,7 +166,7 @@ pub fn setup_aura_page(ui: &MainWindow, _states: Arc<Mutex<Config>>) {
.on_set_led_power(move |power| {
let handle_copy = handle_copy.clone();
let proxy_copy = aura.clone();
let power: AuraPowerDev = power.into();
let power: LaptopAuraPower = power.into();
tokio::spawn(async move {
show_toast(
"Anime builtin animations changed".into(),

View File

@@ -2,7 +2,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-04-05 08:20+0000\n"
"POT-Creation-Date: 2024-04-08 09:19+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@@ -77,12 +77,12 @@ export component ColourSlider inherits VerticalLayout {
callback external_colour_change();
external_colour_change => {
if (root.final_colour.hue() < 0) {
c1.value = (root.base_colours.length - 1) * ((root.final_colour.hue() + 360) / 360);
if (root.final_colour.hue < 0) {
c1.value = (root.base_colours.length - 1) * ((root.final_colour.hue + 360) / 360);
} else {
c1.value = (root.base_colours.length - 1) * (root.final_colour.hue() / 360);
c1.value = (root.base_colours.length - 1) * (root.final_colour.hue / 360);
}
c2.value = root.base_shade.length - (root.base_shade.length * root.final_colour.brightness());
c2.value = root.base_shade.length - (root.base_shade.length * root.final_colour.value);
root.set_base_colour();
}
Rectangle {