diff --git a/CHANGELOG.md b/CHANGELOG.md index ee68ccc3..afbe3ae4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Allow X11 GUI. This is *not* supported. - Fixes to some GUI widget layouts and sizing - Do a backup HID raw write fro brightness if the read-back value does not match. This is a temporary solve for some G14 and G16 until the kernel patch is ready. -- Reimplement the older 0x1866 MCU keyboard control power bits +- Reimplement the older 0x1866 MCU keyboard control power bits plus UI control for it ## [v6.0.6] diff --git a/rog-control-center/src/ui/setup_aura.rs b/rog-control-center/src/ui/setup_aura.rs index 5eb54a51..b7ab999a 100644 --- a/rog-control-center/src/ui/setup_aura.rs +++ b/rog-control-center/src/ui/setup_aura.rs @@ -84,14 +84,24 @@ pub fn setup_aura_page(ui: &MainWindow, _states: Arc>) { 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:?}"); - let power: Vec = power.iter().map(|p| (*p).into()).collect(); + if let Ok(pow3r) = aura.supported_power_zones().await { + log::debug!("Available LED power modes {pow3r:?}"); handle .upgrade_in_event_loop(move |handle| { + let power: Vec = pow3r.iter().map(|p| (*p).into()).collect(); + let names: Vec = handle + .global::() + .get_power_zone_names() + .iter() + .collect(); + let names: Vec = + pow3r.iter().map(|n| names[(*n) as usize].clone()).collect(); handle .global::() .set_supported_power_zones(power.as_slice().into()); + handle + .global::() + .set_power_zone_names_old(names.as_slice().into()); }) .ok(); } diff --git a/rog-control-center/translations/en/rog-control-center.po b/rog-control-center/translations/en/rog-control-center.po index ed7f2e0f..0cbaaeb6 100644 --- a/rog-control-center/translations/en/rog-control-center.po +++ b/rog-control-center/translations/en/rog-control-center.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2024-05-13 04:18+0000\n" +"POT-Creation-Date: 2024-05-13 11:53+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -252,6 +252,11 @@ msgctxt "PageAura" msgid "Power Settings" msgstr "" +#: rog-control-center/ui/pages/aura.slint:270 +msgctxt "PageAura" +msgid "Power Zones" +msgstr "" + #: rog-control-center/ui/pages/system.slint:26 msgctxt "SystemPageData" msgid "Balanced" @@ -407,216 +412,236 @@ msgctxt "PageSystem" msgid "Throttle Policy on AC" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:45 +#: rog-control-center/ui/types/aura_types.slint:49 msgctxt "Aura power zone" msgid "Logo" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:46 +#: rog-control-center/ui/types/aura_types.slint:50 msgctxt "Aura power zone" msgid "Keyboard" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:47 +#: rog-control-center/ui/types/aura_types.slint:51 msgctxt "Aura power zone" msgid "Lightbar" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:48 +#: rog-control-center/ui/types/aura_types.slint:52 msgctxt "Aura power zone" msgid "Lid" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:49 +#: rog-control-center/ui/types/aura_types.slint:53 msgctxt "Aura power zone" msgid "Rear Glow" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:50 +#: rog-control-center/ui/types/aura_types.slint:54 msgctxt "Aura power zone" msgid "Keyboard and Lightbar" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:53 +#: rog-control-center/ui/types/aura_types.slint:57 msgctxt "Aura brightness" msgid "Off" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:54 +#: rog-control-center/ui/types/aura_types.slint:58 msgctxt "Aura brightness" msgid "Low" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:55 +#: rog-control-center/ui/types/aura_types.slint:59 msgctxt "Aura brightness" msgid "Med" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:56 +#: rog-control-center/ui/types/aura_types.slint:60 msgctxt "Aura brightness" msgid "High" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:61 rog-control-center/ui/types/aura_types.slint:76 +#: rog-control-center/ui/types/aura_types.slint:65 rog-control-center/ui/types/aura_types.slint:80 msgctxt "Basic aura mode" msgid "Static" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:62 rog-control-center/ui/types/aura_types.slint:77 +#: rog-control-center/ui/types/aura_types.slint:66 rog-control-center/ui/types/aura_types.slint:81 msgctxt "Basic aura mode" msgid "Breathe" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:63 rog-control-center/ui/types/aura_types.slint:78 +#: rog-control-center/ui/types/aura_types.slint:67 rog-control-center/ui/types/aura_types.slint:82 msgctxt "Basic aura mode" msgid "Strobe" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:64 +#: rog-control-center/ui/types/aura_types.slint:68 msgctxt "Basic aura mode" msgid "Rainbow" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:65 +#: rog-control-center/ui/types/aura_types.slint:69 msgctxt "Basic aura mode" msgid "Star" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:66 +#: rog-control-center/ui/types/aura_types.slint:70 msgctxt "Basic aura mode" msgid "Rain" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:67 +#: rog-control-center/ui/types/aura_types.slint:71 msgctxt "Basic aura mode" msgid "Highlight" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:68 +#: rog-control-center/ui/types/aura_types.slint:72 msgctxt "Basic aura mode" msgid "Laser" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:69 +#: rog-control-center/ui/types/aura_types.slint:73 msgctxt "Basic aura mode" msgid "Ripple" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:70 +#: rog-control-center/ui/types/aura_types.slint:74 msgctxt "Basic aura mode" msgid "Nothing" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:71 +#: rog-control-center/ui/types/aura_types.slint:75 msgctxt "Basic aura mode" msgid "Pulse" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:72 +#: rog-control-center/ui/types/aura_types.slint:76 msgctxt "Basic aura mode" msgid "Comet" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:73 +#: rog-control-center/ui/types/aura_types.slint:77 msgctxt "Basic aura mode" msgid "Flash" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:85 +#: rog-control-center/ui/types/aura_types.slint:89 msgctxt "Aura zone" msgid "None" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:86 +#: rog-control-center/ui/types/aura_types.slint:90 msgctxt "Aura zone" msgid "Key1" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:87 +#: rog-control-center/ui/types/aura_types.slint:91 msgctxt "Aura zone" msgid "Key2" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:88 +#: rog-control-center/ui/types/aura_types.slint:92 msgctxt "Aura zone" msgid "Key3" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:89 +#: rog-control-center/ui/types/aura_types.slint:93 msgctxt "Aura zone" msgid "Key4" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:90 +#: rog-control-center/ui/types/aura_types.slint:94 msgctxt "Aura zone" msgid "Logo" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:91 +#: rog-control-center/ui/types/aura_types.slint:95 msgctxt "Aura zone" msgid "Lightbar Left" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:92 +#: rog-control-center/ui/types/aura_types.slint:96 msgctxt "Aura zone" msgid "Lightbar Right" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:96 +#: rog-control-center/ui/types/aura_types.slint:100 msgctxt "Aura direction" msgid "Right" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:97 +#: rog-control-center/ui/types/aura_types.slint:101 msgctxt "Aura direction" msgid "Left" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:98 +#: rog-control-center/ui/types/aura_types.slint:102 msgctxt "Aura direction" msgid "Up" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:99 +#: rog-control-center/ui/types/aura_types.slint:103 msgctxt "Aura direction" msgid "Down" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:103 +#: rog-control-center/ui/types/aura_types.slint:107 msgctxt "Aura speed" msgid "Low" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:104 +#: rog-control-center/ui/types/aura_types.slint:108 msgctxt "Aura speed" msgid "Medium" msgstr "" -#: rog-control-center/ui/types/aura_types.slint:105 +#: rog-control-center/ui/types/aura_types.slint:109 msgctxt "Aura speed" msgid "High" msgstr "" -#: rog-control-center/ui/widgets/aura_power.slint:32 +#: rog-control-center/ui/widgets/aura_power.slint:33 msgctxt "AuraPowerGroup" msgid "Boot" msgstr "" -#: rog-control-center/ui/widgets/aura_power.slint:42 +#: rog-control-center/ui/widgets/aura_power.slint:43 msgctxt "AuraPowerGroup" msgid "Awake" msgstr "" -#: rog-control-center/ui/widgets/aura_power.slint:52 +#: rog-control-center/ui/widgets/aura_power.slint:53 msgctxt "AuraPowerGroup" msgid "Sleep" msgstr "" -#: rog-control-center/ui/widgets/aura_power.slint:62 +#: rog-control-center/ui/widgets/aura_power.slint:63 msgctxt "AuraPowerGroup" msgid "Shutdown" msgstr "" +#: rog-control-center/ui/widgets/aura_power.slint:102 +msgctxt "AuraPowerGroupOld" +msgid "Zone Selection" +msgstr "" + +#: rog-control-center/ui/widgets/aura_power.slint:114 +msgctxt "AuraPowerGroupOld" +msgid "Boot" +msgstr "" + +#: rog-control-center/ui/widgets/aura_power.slint:124 +msgctxt "AuraPowerGroupOld" +msgid "Awake" +msgstr "" + +#: rog-control-center/ui/widgets/aura_power.slint:134 +msgctxt "AuraPowerGroupOld" +msgid "Sleep" +msgstr "" + #: rog-control-center/ui/main_window.slint:50 msgctxt "MainWindow" msgid "ROG" diff --git a/rog-control-center/ui/pages/aura.slint b/rog-control-center/ui/pages/aura.slint index 5e62701a..3cedec58 100644 --- a/rog-control-center/ui/pages/aura.slint +++ b/rog-control-center/ui/pages/aura.slint @@ -268,7 +268,7 @@ export component PageAura inherits Rectangle { for state[idx] in AuraPageData.led_power.states: old_zone := AuraPowerGroupOld { group-title: @tr("Power Zones"); - zone_strings <=> AuraPageData.power_zone_names; + zone_strings <=> AuraPageData.power_zone_names_old; selected_zone => { AuraPageData.led_power.states[idx].zone = AuraPageData.supported_power_zones[old_zone.current_zone]; AuraPageData.set_led_power(AuraPageData.led_power); diff --git a/rog-control-center/ui/types/aura_types.slint b/rog-control-center/ui/types/aura_types.slint index 38703c94..afd1c141 100644 --- a/rog-control-center/ui/types/aura_types.slint +++ b/rog-control-center/ui/types/aura_types.slint @@ -53,6 +53,13 @@ export global AuraPageData { @tr("Aura power zone" => "Rear Glow"), @tr("Aura power zone" => "Keyboard and Lightbar"), ]; + // Exists only for the older 0x1866 keybaords. On page setup it must + // be set to match the supported_power_zones + in-out property <[string]> power_zone_names_old: [ + @tr("Aura power zone" => "Keyboard"), + @tr("Aura power zone" => "Lightbar"), + @tr("Aura power zone" => "Keyboard and Lightbar"), + ]; in-out property <[string]> brightness_names: [ @tr("Aura brightness" => "Off"), @tr("Aura brightness" => "Low"), @@ -138,14 +145,11 @@ export global AuraPageData { } callback set_hex_from_colour(color) -> string; callback set_hex_to_colour(string) -> color; - in-out property device_type: AuraDevType.New; + in-out property device_type: AuraDevType.Old; // List of indexes to power_zone_names. Must correspond to rog-aura crate in-out property <[PowerZones]> supported_power_zones: [ PowerZones.Keyboard, - PowerZones.RearGlow, - PowerZones.Lid, PowerZones.Lightbar, - PowerZones.Logo, PowerZones.KeyboardAndLightbar, ]; in-out property led_power: {