From 17bbd8aabb0172d4147fedc4070b900be72bb156 Mon Sep 17 00:00:00 2001 From: mihai2mn Date: Sat, 24 Jan 2026 17:47:27 +0100 Subject: [PATCH] fix(ci): Resolve compilation errors in asusd and control-center --- Cargo.lock | 3 ++ asusd/Cargo.toml | 1 + rog-control-center/Cargo.toml | 2 +- rog-control-center/ui/pages/aura.slint | 52 ++++++++++++++++---- rog-control-center/ui/types/aura_types.slint | 15 ++++-- 5 files changed, 59 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a07baee2..48aea3d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4502,7 +4502,10 @@ dependencies = [ "rog_dbus", "rog_platform", "rog_profiles", + "rog_slash", + "ron", "serde", + "serde_json", "slint", "slint-build", "supergfxctl", diff --git a/asusd/Cargo.toml b/asusd/Cargo.toml index 2e12a2e9..4ab06781 100644 --- a/asusd/Cargo.toml +++ b/asusd/Cargo.toml @@ -40,6 +40,7 @@ logind-zbus.workspace = true # serialisation serde.workspace = true +serde_json = "1.0" concat-idents.workspace = true diff --git a/rog-control-center/Cargo.toml b/rog-control-center/Cargo.toml index 5c1613b9..497329f8 100644 --- a/rog-control-center/Cargo.toml +++ b/rog-control-center/Cargo.toml @@ -37,7 +37,7 @@ gumdrop.workspace = true log.workspace = true env_logger.workspace = true -tokio.workspace = true +tokio = { workspace = true, features = ["fs"] } serde.workspace = true zbus.workspace = true ron.workspace = true diff --git a/rog-control-center/ui/pages/aura.slint b/rog-control-center/ui/pages/aura.slint index a6882888..76417f60 100644 --- a/rog-control-center/ui/pages/aura.slint +++ b/rog-control-center/ui/pages/aura.slint @@ -86,13 +86,18 @@ export component PageAura inherits Rectangle { vertical-alignment: TextVerticalAlignment.center; horizontal-alignment: TextHorizontalAlignment.center; } + HorizontalBox { c1 := ColourSlider { enabled: AuraPageData.colour1_enabled; final_colour <=> AuraPageData.color1; colourbox <=> AuraPageData.colorbox1; - set_hex_from_colour(c) => { return AuraPageData.cb_hex_from_colour(c); } - hex_to_colour(s) => { return AuraPageData.cb_hex_to_colour(s); } + set_hex_from_colour(c) => { + return AuraPageData.cb_hex_from_colour(c); + } + hex_to_colour(s) => { + return AuraPageData.cb_hex_to_colour(s); + } released => { AuraPageData.apply_effect({ mode: AuraPageData.led_mode_data.mode, @@ -106,15 +111,25 @@ export component PageAura inherits Rectangle { } } } + VerticalBox { - Text { text: @tr("Colour 2"); vertical-alignment: TextVerticalAlignment.center; horizontal-alignment: TextHorizontalAlignment.center; } + Text { + text: @tr("Colour 2"); + vertical-alignment: TextVerticalAlignment.center; + horizontal-alignment: TextHorizontalAlignment.center; + } + HorizontalBox { c2 := ColourSlider { enabled: AuraPageData.colour2_enabled; final_colour <=> AuraPageData.color2; colourbox <=> AuraPageData.colorbox2; - set_hex_from_colour(c) => { return AuraPageData.cb_hex_from_colour(c); } - hex_to_colour(s) => { return AuraPageData.cb_hex_to_colour(s); } + set_hex_from_colour(c) => { + return AuraPageData.cb_hex_from_colour(c); + } + hex_to_colour(s) => { + return AuraPageData.cb_hex_to_colour(s); + } released => { AuraPageData.apply_effect({ mode: AuraPageData.led_mode_data.mode, @@ -137,7 +152,12 @@ export component PageAura inherits Rectangle { max-height: 90px; RogItem { VerticalBox { - Text { text: @tr("Zone"); vertical-alignment: TextVerticalAlignment.center; horizontal-alignment: TextHorizontalAlignment.center; } + Text { + text: @tr("Zone"); + vertical-alignment: TextVerticalAlignment.center; + horizontal-alignment: TextHorizontalAlignment.center; + } + ComboBox { enabled: false; current_index <=> AuraPageData.zone; @@ -156,9 +176,15 @@ export component PageAura inherits Rectangle { } } } + RogItem { VerticalBox { - Text { text: @tr("Direction"); vertical-alignment: TextVerticalAlignment.center; horizontal-alignment: TextHorizontalAlignment.center; } + Text { + text: @tr("Direction"); + vertical-alignment: TextVerticalAlignment.center; + horizontal-alignment: TextHorizontalAlignment.center; + } + ComboBox { enabled: AuraPageData.direction_enabled; current_index <=> AuraPageData.direction; @@ -177,9 +203,15 @@ export component PageAura inherits Rectangle { } } } + RogItem { VerticalBox { - Text { text: @tr("Speed"); vertical-alignment: TextVerticalAlignment.center; horizontal-alignment: TextHorizontalAlignment.center; } + Text { + text: @tr("Speed"); + vertical-alignment: TextVerticalAlignment.center; + horizontal-alignment: TextHorizontalAlignment.center; + } + ComboBox { enabled: AuraPageData.speed_enabled; current_index <=> AuraPageData.speed; @@ -260,7 +292,7 @@ export component PageAura inherits Rectangle { } if root.show_aura_power && AuraPageData.device_type == AuraDevType.New: Rectangle { - background: Palette.background; + background: RogPalette.background; width: 100%; height: 100%; opacity: 1; @@ -311,7 +343,7 @@ export component PageAura inherits Rectangle { } if root.show_aura_power && AuraPageData.device_type == AuraDevType.Old: Rectangle { - background: Palette.background; + background: RogPalette.background; width: 100%; height: 100%; opacity: 1; diff --git a/rog-control-center/ui/types/aura_types.slint b/rog-control-center/ui/types/aura_types.slint index 52f1041a..28a9e2c4 100644 --- a/rog-control-center/ui/types/aura_types.slint +++ b/rog-control-center/ui/types/aura_types.slint @@ -96,7 +96,11 @@ export global AuraPageData { @tr("Basic aura mode" => "Comet"), @tr("Basic aura mode" => "Flash"), ]; - in-out property <[string]> available_mode_names: [ @tr("Basic aura mode" => "Static"), @tr("Basic aura mode" => "Breathe"), @tr("Basic aura mode" => "Strobe") ]; + in-out property <[string]> available_mode_names: [ + @tr("Basic aura mode" => "Static"), + @tr("Basic aura mode" => "Breathe"), + @tr("Basic aura mode" => "Strobe") + ]; in-out property current_available_mode: 0; in-out property <[int]> supported_basic_modes: [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12]; in-out property <[string]> zone_names: [ @@ -129,6 +133,8 @@ export global AuraPageData { speed: 0, direction: 0, }; + in-out property led_mode; + callback cb_led_mode(int); in-out property color1; in-out property colorbox1; in-out property color2; @@ -139,9 +145,12 @@ export global AuraPageData { out property speed_enabled: led_mode_data.mode == 1 || led_mode_data.mode == 2 || led_mode_data.mode == 3 || led_mode_data.mode == 4 || led_mode_data.mode == 5 || led_mode_data.mode == 6 || led_mode_data.mode == 7 || led_mode_data.mode == 8; out property direction_enabled: led_mode_data.mode == 3; - callback apply_led_mode_data(); + callback cb_led_mode_data(AuraEffect); callback apply_effect(AuraEffect); - apply_effect(e) => { led_mode_data = e; apply_led_mode_data(); } + apply_effect(e) => { + led_mode_data = e; + cb_led_mode_data(e); + } in-out property zone; in-out property speed; in-out property direction;