From 9725062fb9ab70b6d20b4f3ac1432b50de0ae4f2 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Mon, 11 Mar 2024 22:26:26 +1300 Subject: [PATCH] Refactor and cleanup theming --- CHANGELOG.md | 336 +++++++++++++++--- rog-control-center/src/cli_options.rs | 8 + rog-control-center/src/config.rs | 10 + rog-control-center/src/main.rs | 13 + rog-control-center/src/ui_setup.rs | 23 +- .../translations/en/rog-control-center.po | 166 ++++----- rog-control-center/ui/globals.slint | 31 -- rog-control-center/ui/main_window.slint | 48 +-- rog-control-center/ui/pages/about.slint | 33 +- rog-control-center/ui/pages/anime.slint | 13 +- .../ui/pages/app_settings.slint | 2 +- rog-control-center/ui/pages/aura.slint | 29 +- rog-control-center/ui/pages/fans.slint | 2 - rog-control-center/ui/pages/system.slint | 23 +- rog-control-center/ui/types/aura_types.slint | 11 +- .../ui/widgets/aura_power.slint | 25 +- .../ui/widgets/colour_picker.slint | 19 +- rog-control-center/ui/widgets/common.slint | 111 ++---- 18 files changed, 570 insertions(+), 333 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 230109b9..aabc14e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,22 @@ # Changelog + All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + ### Changed + - Upgrade to zbus 4.0.1 - Switch UI over to slint +- Add ability to start rog-control-center fullscreen with a width and height. This should be useful for devices like the ROG Ally. ## [v5.0.8] + ### Changed + - Reintroduce persisting dark/light mode in config file - Added ability to change what EPP is linked with each throttle profile - Don't change EPP or thermal profile if the battery/ac state hasn't actually changed on resume @@ -21,30 +27,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Remove the use of bytes in zbus signatures (another cause of broken pipe) ### Added + - Support for G614J LED modes ## [v5.0.7] + ### Changed + - Fix to suspend process in anime thread to let custom anims run on wake. - Fix to reload the fan curves correctly on boot. - Add new config option `platform_policy_linked_epp` to set if energy_performance_preference should be paired with platform_profile/throttle_thermal_policy - Small fixes to rog-control-center ## [v5.0.6] + - Revert egui update due to a lot of issues arising from window closing. ## [v5.0.5] + - Resync. A release was made that was missing some commits. ## [v5.0.4] + ### Changed + - Added G834JZ led config - Fix in ROGCC to apply the actual effect changed - Re-enable all fan curves (available) in ROGCC - Update smithay-client-toolkit ## [v5.0.3] + ### Changed + - Fix and error in platform ppt value gets - Fix to asusctl CLI where an incorrect enum variant was used in throttle check - Turn some error messages in to warning or info to prevent confusion @@ -52,18 +67,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add two new aura dbus properties for providing some basic info on aura modes/power ## [v5.0.2] + ### Changed + - Fan-curves: nuke a few async deadlocks - Anime: force power/wakeup disabled to prevent idiotic random wakes ## [v5.0.1] + ### Changed + - Fix setting next fan profile - Fix the assud.service - Fix dbus signature of some power setting types for some keyboards ## [v5.0.0] + ### Added + - Gnome 45 plugin - Support for G513RW LED modes - Support Rog Ally LED modes (basic) @@ -74,10 +95,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - SetOffWhenLidClosed, also add asusctl CLI option - Anime: add brightness_on_battery config option - Platform: add `post_animation_sound`, kernel 6.7+ requires patch -- Add changing of CPU energy perfromance preference in relation to throttle_thermal_policy. This means that the CPU correctly behaves according to throttle_thermal_policy (and platform profile use is *removed*) +- Add changing of CPU energy perfromance preference in relation to throttle_thermal_policy. This means that the CPU correctly behaves according to throttle_thermal_policy (and platform profile use is _removed_) - Add setting of throttle_thermal_policy on power plug/unplug ### Changed + - asusd: remove set_image_brightness for anime - asusd: refactor how certain things like display enable/builtins are toggled - Refactor sleep/shutdown tasks @@ -90,18 +112,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Ensure builtin animations run instead of custom animations if option is set ### Breaking + - DBUS stuff. Again. All of it. ## [v4.7.2] + ### Added + - Support for G733PZ LED modes - Support for G713RC LED modes ### Changed + - Fix loading of fan curves from stored settings ## [v4.7.1] + ### Changed + - Fixes to asusctl CLI tool to show fan curves - Fixes to asusd to ensure fan curve defaults are loaded if the config file fails - Further refine the asusctl CLI for fan-curve control @@ -109,10 +137,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixes to aura config creation/loading ### Added + - Support for GV601V LED modes ## [v4.7.0] + ### Added + - Support for FX507Z LED modes - Support for GL503V LED modes - Support for G733C LED modes @@ -135,10 +166,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add generation of introspection XML from asusd dbus - Add a reworked gnome extension to the main repo under `desktop-extensions/gnome/`. This was done to better keep the extension in sync with work done on asusd, especially around breaking dbus - Add support for the mid fan custom curves on some laptops + ### Changed + - Move FX506HC to FX506H in arua DB to catch full series of this range - Move FX506LH to FX506L in arua DB to catch full series of this range -- Move G513I* to G513I in arua DB to catch full series of this range +- Move G513I\* to G513I in arua DB to catch full series of this range - Remove notification handle tracking limit, fixes KDE issue with profile notif - Rename daemon and daemon-user crates to asusd and asusd-user to not be confusing in workspace naming - Prevent the multiple notifications from a profile change from occuring (too many functions with side effects!) @@ -150,15 +183,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added button to fully quit app (exits from background) - Moved application settings to new page - Aura LED power refactor is now taken advantage of in RCC, exposing all settings + ### BREAKING + - All Anime related DBUS methods/notifs are changed - All dbus interfaces that handled an enum have now been forced to use the enum as String type, not uint or similar, this unfortunately breaks a heap of stuff but has the benefit of allowing asusctl to use crates to generate a typescript (or other) binding to the types being used by zbus for the proxies. The implication here is that there will be an eventual tighter integration with the gnome extension and maybe KDE also. ## [v4.6.2] + - Fix rog-control-center not reopening if `startup_in_background` is set ## [v4.6.1] + ### Added + - Support for G733Z LED modes - Support for GU604V LED modes - Support for GX650P LED modes @@ -168,7 +206,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Support for GV301VIC LED modes - Add device code for the plain Z13 keyboard (requires kernel patch, in progress) - Support for GV301V LED modes + ### Changed + - Adjustments to Anime system events thread - Add "sleep" animetion config options to anime config - rog-control-center dark/light mode persistency @@ -180,10 +220,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add support for Logout/Reboot in notification for KDE ## [v4.6.0] + ### Added + - Support for GL703GE keyboard layout - Support for G533Z modes and keyboard layout + ### Changed + - Better handling of `/etc/asusd` not existing - Better handling of non-existant config files - Move all config handling to generic traits for better consistency @@ -194,64 +238,80 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ROGCC: Don't notify user if changing to same mux mode - ROGCC: Add CLI opt for loading a keyboard layout for testing, with live-reload on file change - ROGCC: Add CLI opt for viewing all layout files + filenames to help find a layout matching your laptop - + Both of these options would hopefully be temporary and replaced with a "wizard" GUI helper + - Both of these options would hopefully be temporary and replaced with a "wizard" GUI helper - Fix profile controller not detecting if platform_profile is changed - Fix remove the leftover initial config writes on `new()` for some controllers to prevent resetting settings on startup - + refactor the loading of systemd curve defaults and config file + - refactor the loading of systemd curve defaults and config file + ### BREAKING + - Rename aura dbus method from `per_key_raw` to `direct_addressing_raw` and add doc comment - Changes to aura.conf: - Changes to asusd-ledmodes.toml: - + Rename `standard` to `basic_modes` - + Rename `multizone` to `basic_zones` - + Raname `per_key` to `advanced` and change type from `bool` to `AdvancedAuraType` - + Removed `prod_family` - + Split all entries to `board_name` (separating `board_names`) (now a huge file) - + removed `asusd-ledmodes.toml` in favour of `aura_support.ron` due to an unsupported type in toml + - Rename `standard` to `basic_modes` + - Rename `multizone` to `basic_zones` + - Raname `per_key` to `advanced` and change type from `bool` to `AdvancedAuraType` + - Removed `prod_family` + - Split all entries to `board_name` (separating `board_names`) (now a huge file) + - removed `asusd-ledmodes.toml` in favour of `aura_support.ron` due to an unsupported type in toml - Rename and adjust `LedSupportedFunctions` to closely match the above ## [v4.5.8] + ### Changed + - Fix incorrect stop/start order of nvidia-powerd on AC plug/unplug ## [v4.5.7] + ### Changed + - ROGCC: Don't notify user if changing to same mux mode - ## [v4.5.7] + ### Changed + - ROGCC: Don't notify user if changing to same mux mode - asusd: don't block on systemd-unit change: removes all shoddy external command calls in favour of async dbus calls ## [v4.5.6] + ### Changed + - Fix tasks not always running correctly on boot/sleep/wake/shutdown by finishing the move to async - Change how the profile/fan change task monitors changes due to TUF laptops behaving slightly different - ROGCC: Better handle the use of GPU MUX without supergfxd - ROGCC: Track if reboot required when not using supergfxd - Add env var for logging levels to daemon and gui (`RUST_LOG=`) - ROGCC: Very basic support for running a command on AC/Battery switching, this is in config at `~/.config/rog/rog-control-center.cfg`, and for now must be edited by hand and ROGCC restarted (run ROGCC in BG to use effectively) - + Run ROGCC from terminal to see errors of the AC/Battery command - + Support for editing via ROGCC GUI will come in future - + This is ideal for userspace tasks + - Run ROGCC from terminal to see errors of the AC/Battery command + - Support for editing via ROGCC GUI will come in future + - This is ideal for userspace tasks - asusd: Very basic support for running a command on AC/Battery switching, this is in config at `/etc/asusd/asusd.conf`. A restart of asusd is not required if edited. - + This is ideal for tasks that require root access (BE SAFE!) + - This is ideal for tasks that require root access (BE SAFE!) - The above AC/Battery commands are probably best set to run a script for more complex tasks - asusd: check if nvidia-powerd enabled before toggling ## [v4.5.5] + ### Changed + - remove an unwrap() causing panic on main ROGCC thread ## [v4.5.4] + ### Changed + - ROGCC:: Allow ROGCC to run without supergfxd - ROGCC: Tray/notifs now reads dGPU status directly via supergfx crate (supergfxd not required) - Add rust-toolchain to force minimum rust version ## [v4.5.3] + ### Changed + - Adjust how fan graph in ROGCC works, deny incorrect graphs - Fix to apply the fan curve change in ROGCC to the correct profile - Support for G713RS LED modes (Author: Peter Ivanov) @@ -260,13 +320,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update dependencies to get latest winit crate (fixes various small issues) ## [v4.5.2] + ### Changed + - Update dependencies and bump version ## [v4.5.1] + ### Added + - Support for FA506IE LED modes (Author: Herohtar) + ### Changed + - Add a basic system tray with dGPU status and gpu mode switch actions - Fixup some notifications in ROGCC - Add config options for notifications for ROGCC @@ -274,7 +340,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Share tates with tray process in ROGCC ## [v4.5.0] + ### Added + - intofy watches on: - `charge_control_end_threshold` - `panel_od` @@ -296,11 +364,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 problematic when on battery, not allowing the dgpu to suspend within decent time and sometimes blocking it completely. - Notification to rog-control-center of dGPU state change + ### Changed + - Use loops to ensure that mutex is gained for LED changes. - asusctl now uses tokio for async runtime. This helps simplify some code. - Properly fix notifs used in rog-control-center + ### Breaking + - DBUS: all charge control methods renamed to: - `ChargeControlEndThreshold` - `SetChargeControlEndThreshold` @@ -312,50 +384,66 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Path `/org/asuslinux/Charge` changed to `/org/asuslinux/Power` ## [v4.4.0] - 2022-08-29 + ### Added + - Support for per-key config has been added to `asusd-user`. At the moment it is basic with only a few effects done. Please see the manual for more information. -- Support for unzoned and per-zone effects on some laptops. As above. +- Support for unzoned and per-zone effects on some laptops. As above. - Added three effects to use with Zoned or Per-Key: - + Static, Breathe, Flicker. More to come. + - Static, Breathe, Flicker. More to come. - Support for G713RS LED modes - Support for TUF laptop RGB (kernel patches required, these are submitted upstream) + ### Changed + - Create new rog-platform crate to manage all i/o in a universal way - + kbd-led handling (requires kernel patches, TUF specific) - + platform handling (asus-nb-wmi) - + power (basic, can be extended in future) - + hidraw - + usbraw + - kbd-led handling (requires kernel patches, TUF specific) + - platform handling (asus-nb-wmi) + - power (basic, can be extended in future) + - hidraw + - usbraw - Refactor how ROGCC handles IPC for background open, run-in-bg - Refactor daemon task creation to be simpler (for development) - Rename dpu_only to gpu_mux. Update all related messages and info. + ### Breaking + - DBUS: rename path `/org/asuslinux/RogBios` to `/org/asuslinux/Platform` - DBUS: renamed `dedicated_graphic_mode` to `gpu_mux_mode` (`GpuMuxMode`) - DBUS: renamed `set_dedicated_graphic_mode` to `set_gpu_mux_mode` (`SetGpuMuxMode`) - + The methods above take an enum: 0 = Discrete, 1 = Optimus + - The methods above take an enum: 0 = Discrete, 1 = Optimus ## [4.3.4] - 2022-08-03 + ### Bugfix + - ROGCC: Remove power setting from correct array ## [4.3.3] - 2022-08-02 + ### Added + - `rog-control-center` has now been moved in to the main workspace due to the heavy dependencies on most of the rog crates - Preliminary support of TUF RGB keyboards + power states - Support for G713RW LED modes (Author: jarvis2709) - Support for G713IC LED modes + ### Changed + - The udev rules have been changed to make asusd load with all gamer variants when asus-nb-wmi is loaded - TUF, ROG, Zephyrus, Strix ## [4.3.0] - 2022-07-21 + ### Added + - Clear command for anime `asusctl anime --clear` will clear the display - Re-added support for LED power states on `0x1866` type keyboards + ### Changed + - Make rog-anime more error tolerent. Remove various asserts and return errors instead - Return error if a pixel-gif is larger than the anime-display dimensions - Both Anime and Aura dbus interfaces are changed a little @@ -364,45 +452,62 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - /org/asuslinux/Led renamed to /org/asuslinux/Aura ## [4.2.1] - 2022-07-18 + ### Added + - Add panel overdrive support (autodetects if supported) - Add detection of dgpu_disable and egpu_enable for diagnostic + ### Changed + - Fixed save and restore of multizone LED settings - Create defaults for multizone ## [4.2.0] - 2022-07-16 + ### Added + - Support for GA402 Anime Matrix display (Author: I-Al-Istannen & Luke Jones) - Support for power-config of all LED zones. See `asusctrl led-power --help` (Author: Luke Jones, With much help from: @MNS26) - Full support for multizone LED (Author: Luke Jones, With much help from: @MNS26) - Add ability to load extra data from `/etc/asusd/asusd-user-ledmodes.toml` for LED support if file exits - Support for G513IM LED modes - Support for GX703HS LED modes + ### Changed + - Dbus interface for Aura config has been changed, all power control is done with `SetLedsEnabled` and `SetLedsDisabled` - Data for anime-matrix now requires passing the laptop model as enum - Extra unit tests for anime stuff to help verify things ### Added + - Support for GA503R LED modes + ### Changed + - Refactor LED and AniMe tasks - Reload keyboard brightness on resume from sleep/hiber ## [4.1.1] - 2022-06-21 + ### Changed + - Fixes to anime matrix system thread cancelation ## [4.1.0] - 2022-06-20 + ### Changed + - Huge refactor to use zbus 2.2 + zvariant 3.0 in system-daemon. - Daemons with tasks now use `smol` for async ops. - Fixes to fan-curve settings from CLI (Author: Armas Span) - Add brightness to anime zbus notification - Adjust how threads in AniMe matrix controller work - Use proper power-state packet for keyboard LED's (Author: Martin Piffault) + ### Added + - Support for GA402R LED modes - Support for GU502LV LED modes - Support for G512 LED modes @@ -414,27 +519,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Support running AniMe animation blocks on wake/sleep and boot/shutdown events # [4.0.7] - 2021-12-19 + ### Changed + - Fix incorrect power-profile validation - Update asusd-ledmodes.toml to support Asus Rog Strix G15 G513QE (@LordVicky) - Update patch notes and links # [4.0.6] - 2021-11-01 + ### Changed + - Fix CLI for bios toggles + ### Added + - Extra commands for AniMe: pixel-image, gif, pixel-gif # [4.0.5] - 2021-10-27 + ### Changed + - Convert fan curve percentage to 0-255 expected by kernel driver only if '%' char is used, otherwise the expected range for fan power is 0-255 - Use correct error in daemon for invalid charging limit - Enforce charging limit values in range 20-100 + ### Added + - LED modes for G513QR # [4.0.4] - 2021-10-02 + ### Changed + - Add missing Profile commands - Spawn tasks on individual threads to prevent blocking - Don't force fan-curve default on reload @@ -442,83 +559,107 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Slim down the notification daemon to pure ASUS notifications # [4.0.3] - 2021-09-16 + ### Changed + - Don't show fan-curve warning if fan-curve available - Add G713QR to Strix led-modes - Fix part of CLI fan-curve control # [4.0.2] - 2021-09-14 + ### Changed -- Backup old configs to *-old if parse fails + +- Backup old configs to \*-old if parse fails - Prevent some types of crashes related to unpatched kernels - Add better help for graphics errors - Add better help for asusctl general errors - Implement fan-curve dbus API - Implement partial fan-curve control via CLI tool - + Set fan curve for profile + fan gpu/cpu + - Set fan curve for profile + fan gpu/cpu # [4.0.1] - 2021-09-11 + ### Changed + - Fix asusd-ledmodes.toml # [4.0.0] - 2021-09-10 + ### Added + - AniMe: - + Support 8bit RGB, RGBA, 16bit Greyscalw, RGB, RGBA - + add `AsusImage` type for slanted-template pixel-perfect images - + `BREAKING:` plain `Image` with time period is changed and old anime configs break as a result (sorry) + - Support 8bit RGB, RGBA, 16bit Greyscalw, RGB, RGBA + - add `AsusImage` type for slanted-template pixel-perfect images + - `BREAKING:` plain `Image` with time period is changed and old anime configs break as a result (sorry) - LED: - + By popular request LED prev/next cycle is added - + Add led modes for GX551Q + - By popular request LED prev/next cycle is added + - Add led modes for GX551Q + ### BREAKING CHANGES + - Graphics control: - + graphics control is pulled out of asusd and moved to new package; https://gitlab.com/asus-linux/supergfxctl + - graphics control is pulled out of asusd and moved to new package; https://gitlab.com/asus-linux/supergfxctl - Proflies: - + profiles now depend on power-profile-daemon plus kernel patches for support of platform_profile + - profiles now depend on power-profile-daemon plus kernel patches for support of platform_profile - if your system supports fan-curves you will also require upcoming kernel patches for this - + profiles are now moved to a new file - + fan-curves are only partially completed due to this release needing to be done sooner + - profiles are now moved to a new file + - fan-curves are only partially completed due to this release needing to be done sooner # [3.7.2] - 2021-08-02 + ### Added + - Enable multizone support on Strix 513IH - Add G513QY ledmodes + ### Changed + - Fix missing CLI command help for some supported options - Fix incorrectly selecting profile by name, where the active profile was being copied to the selected profile - Add `asusd` version back to `asusctl -v` report - Fix various clippy warnings # [3.7.1] - 2021-06-11 + ### Changed + - Refine graphics mode switching: - + Disallow switching to compute or vfio mode unless existing mode is "Integrated" + - Disallow switching to compute or vfio mode unless existing mode is "Integrated" # [3.7.0] - 2021-06-06 + ### Changed + - Set PM to auto for Nvidia always - Extra info output for gfx dev scan - Extra info in log for G-Sync to help prevent user confusion around gfx switching - Add GA503Q led modes - Added ability to fade in/out gifs and images for anime. This does break anime configs. See manual for details. - Added task to CtrlLed to set the keyboard LED brightness on wake from suspend - + requires a kernel patch which will be upstreamed and in fedora rog kernel + - requires a kernel patch which will be upstreamed and in fedora rog kernel - Make gfx change from nvidia to vfio/compute also force-change to integrated _then_ to requested mode - Fix invalid gfx status when switching from some modes - Fix copy over of serde skipped config values on config reload # [3.6.1] - 2021-05-25 + ### Changed + - Bugfix: write correct fan modes for profiles - Bugfix: apply created profiles # [3.6.1] - 2021-05-25 + ### Changed + - Bugfix for cycling through profiles # [3.6.0] - 2021-05-24 + ### Changed + - Add GX550L led modes - Don't save compute/vfio modes. Option in config for this is removed. - Store a temporary non-serialised option in config for if compute/vfio is active @@ -533,49 +674,61 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix some dbus Supported issues # [3.5.2] - 2021-05-15 + ### Changed + - Bugfix: prevent the hang on compute/integrated mode change # [3.5.1] - 2021-04-25 + ### Changed -+ Anime: + +- Anime: - Fix using multiple configs # [3.5.0] - 2021-04-25 + ### Changed -+ Keyboard: + +- Keyboard: - Split out all aura functionality that isn't dependent on the daemon in to a new crate `rog-aura` (incomplete) - Keyboard LED control now includes: - + Enable/disable LED's while laptop is awake - + Enable/disable LED animation while laptop is suspended and AC plugged in + - Enable/disable LED's while laptop is awake + - Enable/disable LED animation while laptop is suspended and AC plugged in - Properly reload the last used keyboard mode on boot -+ Graphics: +- Graphics: - Correctly enable compute mode for nvidia plus no-reboot or logout if switching from vfio/integrated/compute. - Add asusd config option to not save compute/vfio mode switch. -+ Anime: +- Anime: - Enable basic multiple user anime configs (asusd-user must still be restarted) -+ Profiles: +- Profiles: - Enable dbus methods for freq min/max, fan curve, fan preset, CPU turbo enable. These options will apply to the active profile if no profile name is specified. # [3.4.1] - 2021-04-11 + ### Changed + - Fix anime init sequence # [3.4.0] - 2021-04-11 + ### Changed + - Revert zbus to 1.9.1 - Use enum to show power states, and catch missing pci path for nvidia. - Partial user-daemon for anime/per-key done, `asusd-user`. Includes asusd-user systemd unit. - user-daemon provides dbus emthods to insert anime actions, remove from index, set leds on/off - + Config file is stored in `~/.config/rog/rog-user.cfg` + - Config file is stored in `~/.config/rog/rog-user.cfg` - AniMe display parts split out to individual crate in preparation for publishing on crates.io # [3.3.0] - 2021-04-3 + ### Changed + - Add ledmodes for G733QS - Add ledmodes for GA401Q - Default to vfio disabled in configuration. Will now hard-error if enabled and @@ -583,91 +736,126 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 must be changed to `true` in `/etc/asusd/asusd.conf` # [3.2.4] - 2021-03-24 + ### Changed + - Ignore vfio-builtin error if switching to integrated # [3.2.3] - 2021-03-24 + ### Changed + - Better handling of session tracking + ### Added + - List all profile data - Get active profile name - Get active profile data # [3.2.2] - 2021-03-23 + ### Changed + - Fix brightness control, again, for non-RGB keyboards # [3.2.1] - 2021-03-21 + ### Changed + - Fix brightness control - Large cleanup of code relating to LED controls # [3.2.0] - 2021-03-21 + ### Changed + - Refactor keyboard LED handling - Added --list for profiles (Thanks @aqez) - Added --remove for profiles (Thanks @aqez) - Added a graphics mode: vfio. This attaches Nvidia devices to vfio module. + ### Broken + - Per-key LED modes, which need thinking about how to go ahead with for future # [3.1.7] - 2021-03-11 + ### Changed + - Refactor many parts of daemon - Switch out session monitoring to logind-zbus # [3.1.6] - 2021-03-11 + ### Changed + - Graphics switching will now wait until all users logged out before switching ### Changed + - Further tweaks to gfx switching - More logging on gfx switching - Filter bios help according to supported modes - Prevent gfx mode switching if in dedicated/G-Sync mode # [3.1.4] - 2021-03-10 + ### Changed + - Notify through dbus if user changes profile manually - Better help on CLI, show help only for supported items - Bugfix to gfx switcher # [3.1.3] - 2021-03-10 + ### Changed + - Hotfix: gracefully handle removing modules in use caused by display-manager not fully shutdown at the time of trying to remove modules. It will now retry every 250ms per module # [3.1.2] - 2021-03-10 + ### Changed + - Test and create /etc/X11/xorg.conf.d/ if it doesn't exist - Hotfix to better report module issues # [3.1.1] - 2021-03-10 + ### Changed + - Add missing nvidia module nvidia_uvm to gfx ctrl list # [3.1.0] - 2021-03-09 + ### Added + - GU502LU led-modes + ### Changed + - Graphics switching is now rebootless, the daemon will now restart the display-manager to switch modes instead. Caveats are: - + There is no confirmation from the daemon, the program issuing the command + - There is no confirmation from the daemon, the program issuing the command must confirm the request. - + systemd only + - systemd only - Laptops with dedicated Nvidia mode: - + You still must reboot for the bios to switch modes - + On boot if dedicated mode is active then asusd will update the required configs + - You still must reboot for the bios to switch modes + - On boot if dedicated mode is active then asusd will update the required configs to put display-manager in nvidia mode # [3.0.0] - 2021-02-22 + ### Added + - G531GD led modes # [3.0.0] - 2021-02-14 + ### Changed + - Write set+apply after each array in multizone - Remove misc bad logic - Use same code path as 0x1866 device to configure led support for 0x1854 device @@ -679,14 +867,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Cleanup fan and cpu control + configs # [2.2.2] - 2021-01-31 + ### Changed + - Fix for dedicated gfx capable laptops in integrated mode - Fix for 0x1854 device # [2.2.1] - 2021-01-27 + ### Added + - Add ROG Zephyrus M15 LED config + ### Changed + - Bugfixes - Fix reboot/restartx status for GFX switching - Update readme @@ -694,29 +888,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Make dracut include the nvidia modules in initramfs # [2.2.0] - 2021-01-26 + ### Added + - Dbus command to fetch all supported functions of the laptop. That is, all the functions that asusd supports for the currently running laptop. - Bios setting toggles for: - + Dedicated gfx toggle (support depends on the laptop) - + Bios boot POST sound toggle + - Dedicated gfx toggle (support depends on the laptop) + - Bios boot POST sound toggle + ### Changed + - added config option for dedicated gfx mode on laptops with it to enable switching directly to dedicated using `asusctl graphics -m nvidia` # [2.1.2] - 2021-01-10 + ### Changed + - Adjust gfx controller to assume that the graphics driver is loaded if the mode is set for nvidia/hybrid # [2.1.1] - 2021-01-09 + ### Changed + - Updates to dependencies # [2.1.0] - 2020-10-25 + ### Added + - Option to turn off AniMe display (@asere) + ### Changed + - Change option -k to show current LED bright (@asere) - Correctly disable GFX control via config - Panic and exit if config can't be parsed @@ -724,57 +930,77 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add DBUS method to toggle to next/prev Aura mode # [2.0.5] - 2020-09-29 + ### Changed + - Bugfixes # [2.0.4] - 2020-09-24 + ### Changed + - Better and more verbose error handling and logging in many places. - Fix timeout for client waiting on reply for graphics switching # [2.0.2] - 2020-09-21 + ### Changed + - graphics options via CLI are now a command block: - + `asusctl graphics` - + -m Mode - + -g Get current mode - + -f Force reboot or restart display manager without confirmation + - `asusctl graphics` + - -m Mode + - -g Get current mode + - -f Force reboot or restart display manager without confirmation # [2.0.0] - 2020-09-21 + ### Changed + - Code refactor to spawn less tasks. Main loop will run only as fast as it receives events - No-longer using tokio or async, reducing resource use + ### Added + - A basic user daemon has been added for user notifications over dbus (XDG spec) - Added a user systemd service for notifications (asus-notify) - Graphics mode handling , see asusctl --help + ### BREAKING CHANGES + - asusd.conf has changed slightly and will overwrite old configs - All DBUS methods/signals/paths etc, are all updated and changed # [1.1.2] - 2020-09-10 + ### Changed + - Bump rog-fan-curve to new versiont o support GA401IV # [1.1.1] - 2020-09-10 + ### Changed + - Correction to AMD turbo setting # [1.1.0] - 2020-09-10 + ### Changed + - Uses string instead of debug print for some errors - Add interface num arg for LED controller (should help support - older laptops better) + older laptops better) - Some slightly better error messages -- Fix an idiotic mistake in `for i in 0..2.. if i > 0` -_- +- Fix an idiotic mistake in `for i in 0..2.. if i > 0` -\_- - Remove "unsupported" warning on laptop ctrl - Silence warning about AniMe not existing - Adjust the turbo-toggle CLI arg - Version bump for new release with fancurves ## [1.0.2] - 2020-08-13 + ### Changed + - Bugfixes to led brightness watcher - Bufixes to await/async tasks diff --git a/rog-control-center/src/cli_options.rs b/rog-control-center/src/cli_options.rs index d6040eba..d7bde2d4 100644 --- a/rog-control-center/src/cli_options.rs +++ b/rog-control-center/src/cli_options.rs @@ -4,6 +4,14 @@ use gumdrop::Options; pub struct CliStart { #[options(help_flag, help = "print help message")] pub help: bool, + #[options(help = "start fullscreen, if used the option is saved")] + pub fullscreen: bool, + #[options(help = "fullscreen width")] + pub width_fullscreen: u32, + #[options(help = "fullscreen height")] + pub height_fullscreen: u32, + #[options(help = "start windowed, if used the option is saved")] + pub windowed: bool, #[options(help = "show program version number")] pub version: bool, #[options( diff --git a/rog-control-center/src/config.rs b/rog-control-center/src/config.rs index 59e4211e..c8a52d47 100644 --- a/rog-control-center/src/config.rs +++ b/rog-control-center/src/config.rs @@ -17,6 +17,10 @@ pub struct Config { pub bat_command: String, pub enable_notifications: bool, pub dark_mode: bool, + // intended for use with devices like the ROG Ally + pub start_fullscreen: bool, + pub fullscreen_width: u32, + pub fullscreen_height: u32, // This field must be last pub enabled_notifications: EnabledNotifications, } @@ -29,6 +33,9 @@ impl Default for Config { enable_notifications: true, enable_tray_icon: true, dark_mode: true, + start_fullscreen: false, + fullscreen_width: 1920, + fullscreen_height: 1080, enabled_notifications: EnabledNotifications::default(), ac_command: String::new(), bat_command: String::new(), @@ -84,6 +91,9 @@ impl From for Config { ac_command: c.ac_command, bat_command: c.bat_command, dark_mode: true, + start_fullscreen: false, + fullscreen_width: 1920, + fullscreen_height: 1080, enable_notifications: c.enable_notifications, enabled_notifications: c.enabled_notifications, } diff --git a/rog-control-center/src/main.rs b/rog-control-center/src/main.rs index 28a27ba8..106c4d7a 100644 --- a/rog-control-center/src/main.rs +++ b/rog-control-center/src/main.rs @@ -79,6 +79,19 @@ fn main() -> Result<()> { // Startup let mut config = Config::new().load(); + if cli_parsed.fullscreen { + config.start_fullscreen = true; + if cli_parsed.width_fullscreen != 0 { + config.fullscreen_width = cli_parsed.width_fullscreen; + } + if cli_parsed.height_fullscreen != 0 { + config.fullscreen_height = cli_parsed.height_fullscreen; + } + config.write(); + } else if cli_parsed.windowed { + config.start_fullscreen = false; + config.write(); + } if config.startup_in_background { config.run_in_background = true; diff --git a/rog-control-center/src/ui_setup.rs b/rog-control-center/src/ui_setup.rs index bc60841f..1b8a9c5e 100644 --- a/rog-control-center/src/ui_setup.rs +++ b/rog-control-center/src/ui_setup.rs @@ -7,7 +7,7 @@ use rog_dbus::zbus_anime::AnimeProxy; use rog_dbus::zbus_aura::AuraProxy; use rog_dbus::zbus_platform::{PlatformProxy, PlatformProxyBlocking}; use rog_platform::platform::Properties; -use slint::{ComponentHandle, Model, RgbaColor, SharedString, Weak}; +use slint::{ComponentHandle, Model, PhysicalSize, RgbaColor, SharedString, Weak}; use zbus::proxy::CacheProperties; use crate::config::Config; @@ -76,8 +76,17 @@ macro_rules! set_ui_callbacks { }; } -pub fn setup_window(_config: Arc>) -> MainWindow { +pub fn setup_window(config: Arc>) -> MainWindow { let ui = MainWindow::new().unwrap(); + if let Ok(lock) = config.try_lock() { + let fullscreen = lock.start_fullscreen; + let width = lock.fullscreen_width; + let height = lock.fullscreen_height; + if fullscreen { + ui.window().set_fullscreen(fullscreen); + ui.window().set_size(PhysicalSize { width, height }); + } + }; let conn = zbus::blocking::Connection::system().unwrap(); let platform = PlatformProxyBlocking::new(&conn).unwrap(); @@ -102,11 +111,11 @@ pub fn setup_window(_config: Arc>) -> MainWindow { slint::quit_event_loop().unwrap(); }); - setup_app_settings_page(&ui, _config.clone()); - setup_system_page(&ui, _config.clone()); - setup_system_page_callbacks(&ui, _config.clone()); - setup_aura_page(&ui, _config.clone()); - setup_anime_page(&ui, _config); + setup_app_settings_page(&ui, config.clone()); + setup_system_page(&ui, config.clone()); + setup_system_page_callbacks(&ui, config.clone()); + setup_aura_page(&ui, config.clone()); + setup_anime_page(&ui, config); ui } diff --git a/rog-control-center/translations/en/rog-control-center.po b/rog-control-center/translations/en/rog-control-center.po index 7216c5c9..d5e9a38e 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-03-10 10:29+0000\n" +"POT-Creation-Date: 2024-03-11 09:25+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -12,127 +12,127 @@ msgstr "" "Language: \n" "Plural-Forms: nplurals=1; plural=0;\n" -#: rog-control-center/ui/pages/anime.slint:7 +#: rog-control-center/ui/pages/anime.slint:6 msgctxt "Anime Brightness" msgid "Off" msgstr "" -#: rog-control-center/ui/pages/anime.slint:8 +#: rog-control-center/ui/pages/anime.slint:7 msgctxt "Anime Brightness" msgid "Low" msgstr "" -#: rog-control-center/ui/pages/anime.slint:9 +#: rog-control-center/ui/pages/anime.slint:8 msgctxt "Anime Brightness" msgid "Med" msgstr "" -#: rog-control-center/ui/pages/anime.slint:10 +#: rog-control-center/ui/pages/anime.slint:9 msgctxt "Anime Brightness" msgid "High" msgstr "" -#: rog-control-center/ui/pages/anime.slint:24 +#: rog-control-center/ui/pages/anime.slint:23 msgctxt "AnimePageData" msgid "Glitch Construction" msgstr "" -#: rog-control-center/ui/pages/anime.slint:24 +#: rog-control-center/ui/pages/anime.slint:23 msgctxt "AnimePageData" msgid "Static Emergence" msgstr "" -#: rog-control-center/ui/pages/anime.slint:26 +#: rog-control-center/ui/pages/anime.slint:25 msgctxt "AnimePageData" msgid "Binary Banner Scroll" msgstr "" -#: rog-control-center/ui/pages/anime.slint:26 +#: rog-control-center/ui/pages/anime.slint:25 msgctxt "AnimePageData" msgid "Rog Logo Glitch" msgstr "" -#: rog-control-center/ui/pages/anime.slint:28 +#: rog-control-center/ui/pages/anime.slint:27 msgctxt "AnimePageData" msgid "Banner Swipe" msgstr "" -#: rog-control-center/ui/pages/anime.slint:28 +#: rog-control-center/ui/pages/anime.slint:27 msgctxt "AnimePageData" msgid "Starfield" msgstr "" -#: rog-control-center/ui/pages/anime.slint:30 +#: rog-control-center/ui/pages/anime.slint:29 msgctxt "AnimePageData" msgid "Glitch Out" msgstr "" -#: rog-control-center/ui/pages/anime.slint:30 +#: rog-control-center/ui/pages/anime.slint:29 msgctxt "AnimePageData" msgid "See Ya" msgstr "" -#: rog-control-center/ui/pages/anime.slint:51 +#: rog-control-center/ui/pages/anime.slint:50 msgctxt "Anime Brightness" msgid "Brightness" msgstr "" -#: rog-control-center/ui/pages/anime.slint:67 +#: rog-control-center/ui/pages/anime.slint:66 msgctxt "PageAnime" msgid "Enable display" msgstr "" -#: rog-control-center/ui/pages/anime.slint:75 rog-control-center/ui/pages/anime.slint:98 +#: rog-control-center/ui/pages/anime.slint:74 rog-control-center/ui/pages/anime.slint:97 msgctxt "PageAnime" msgid "Advanced" msgstr "" -#: rog-control-center/ui/pages/anime.slint:90 +#: rog-control-center/ui/pages/anime.slint:89 msgctxt "PageAnime" msgid "Use built-in animations" msgstr "" -#: rog-control-center/ui/pages/anime.slint:147 +#: rog-control-center/ui/pages/anime.slint:146 msgctxt "PageAnime" -msgid "Advanced Anime Display : TODO!" +msgid "Set which builtin animations are played" msgstr "" -#: rog-control-center/ui/pages/anime.slint:151 +#: rog-control-center/ui/pages/anime.slint:150 msgctxt "Anime built-in selection" msgid "Boot Animation" msgstr "" -#: rog-control-center/ui/pages/anime.slint:161 +#: rog-control-center/ui/pages/anime.slint:160 msgctxt "Anime built-in selection" msgid "Running Animation" msgstr "" -#: rog-control-center/ui/pages/anime.slint:171 +#: rog-control-center/ui/pages/anime.slint:170 msgctxt "Anime built-in selection" msgid "Sleep Animation" msgstr "" -#: rog-control-center/ui/pages/anime.slint:181 +#: rog-control-center/ui/pages/anime.slint:180 msgctxt "Anime built-in selection" msgid "Shutdown Animation" msgstr "" -#: rog-control-center/ui/pages/anime.slint:221 +#: rog-control-center/ui/pages/anime.slint:220 msgctxt "PageAnime" msgid "Advanced Display Settings" msgstr "" -#: rog-control-center/ui/pages/anime.slint:226 +#: rog-control-center/ui/pages/anime.slint:225 msgctxt "PageAnime" msgid "Off when lid closed" msgstr "" -#: rog-control-center/ui/pages/anime.slint:235 +#: rog-control-center/ui/pages/anime.slint:234 msgctxt "PageAnime" msgid "Off when suspended" msgstr "" -#: rog-control-center/ui/pages/anime.slint:244 +#: rog-control-center/ui/pages/anime.slint:243 msgctxt "PageAnime" msgid "Off when on battery" msgstr "" @@ -157,62 +157,62 @@ msgctxt "PageAppSettings" msgid "Enable change notifications" msgstr "" -#: rog-control-center/ui/pages/aura.slint:30 +#: rog-control-center/ui/pages/aura.slint:27 msgctxt "PageAura" msgid "Brightness" msgstr "" -#: rog-control-center/ui/pages/aura.slint:41 +#: rog-control-center/ui/pages/aura.slint:38 msgctxt "PageAura" msgid "Aura mode" msgstr "" -#: rog-control-center/ui/pages/aura.slint:58 +#: rog-control-center/ui/pages/aura.slint:55 msgctxt "PageAura" msgid "Colour 1" msgstr "" -#: rog-control-center/ui/pages/aura.slint:79 +#: rog-control-center/ui/pages/aura.slint:76 msgctxt "PageAura" msgid "Colour 2" msgstr "" -#: rog-control-center/ui/pages/aura.slint:106 +#: rog-control-center/ui/pages/aura.slint:103 msgctxt "PageAura" msgid "Zone" msgstr "" -#: rog-control-center/ui/pages/aura.slint:126 +#: rog-control-center/ui/pages/aura.slint:123 msgctxt "PageAura" msgid "Direction" msgstr "" -#: rog-control-center/ui/pages/aura.slint:146 +#: rog-control-center/ui/pages/aura.slint:143 msgctxt "PageAura" msgid "Speed" msgstr "" -#: rog-control-center/ui/pages/aura.slint:165 +#: rog-control-center/ui/pages/aura.slint:162 msgctxt "PageAura" msgid "Power Settings" msgstr "" -#: rog-control-center/ui/pages/aura.slint:173 +#: rog-control-center/ui/pages/aura.slint:170 msgctxt "PageAura" msgid "Apply Aura" msgstr "" -#: rog-control-center/ui/pages/aura.slint:206 rog-control-center/ui/pages/aura.slint:355 rog-control-center/ui/pages/aura.slint:415 +#: rog-control-center/ui/pages/aura.slint:203 rog-control-center/ui/pages/aura.slint:356 rog-control-center/ui/pages/aura.slint:416 msgctxt "PageAura" msgid "Keyboard" msgstr "" -#: rog-control-center/ui/pages/aura.slint:229 +#: rog-control-center/ui/pages/aura.slint:227 msgctxt "PageAura" msgid "Lid Logo" msgstr "" -#: rog-control-center/ui/pages/aura.slint:252 +#: rog-control-center/ui/pages/aura.slint:251 msgctxt "PageAura" msgid "Lightbar" msgstr "" @@ -222,177 +222,177 @@ msgctxt "PageAura" msgid "Lid Zone" msgstr "" -#: rog-control-center/ui/pages/aura.slint:298 +#: rog-control-center/ui/pages/aura.slint:299 msgctxt "PageAura" msgid "Rear Glow" msgstr "" -#: rog-control-center/ui/pages/aura.slint:361 rog-control-center/ui/pages/aura.slint:421 +#: rog-control-center/ui/pages/aura.slint:362 rog-control-center/ui/pages/aura.slint:422 msgctxt "PageAura" msgid "Boot" msgstr "" -#: rog-control-center/ui/pages/aura.slint:366 rog-control-center/ui/pages/aura.slint:426 +#: rog-control-center/ui/pages/aura.slint:367 rog-control-center/ui/pages/aura.slint:427 msgctxt "PageAura" msgid "Awake" msgstr "" -#: rog-control-center/ui/pages/aura.slint:371 rog-control-center/ui/pages/aura.slint:431 +#: rog-control-center/ui/pages/aura.slint:372 rog-control-center/ui/pages/aura.slint:432 msgctxt "PageAura" msgid "Sleep" msgstr "" -#: rog-control-center/ui/pages/aura.slint:376 rog-control-center/ui/pages/aura.slint:436 +#: rog-control-center/ui/pages/aura.slint:377 rog-control-center/ui/pages/aura.slint:437 msgctxt "PageAura" msgid "Shutdown" msgstr "" -#: rog-control-center/ui/pages/system.slint:27 +#: rog-control-center/ui/pages/system.slint:26 msgctxt "SystemPageData" msgid "Balanced" msgstr "" -#: rog-control-center/ui/pages/system.slint:27 rog-control-center/ui/pages/system.slint:31 +#: rog-control-center/ui/pages/system.slint:26 rog-control-center/ui/pages/system.slint:30 msgctxt "SystemPageData" msgid "Performance" msgstr "" -#: rog-control-center/ui/pages/system.slint:27 +#: rog-control-center/ui/pages/system.slint:26 msgctxt "SystemPageData" msgid "Quiet" msgstr "" -#: rog-control-center/ui/pages/system.slint:30 +#: rog-control-center/ui/pages/system.slint:29 msgctxt "SystemPageData" msgid "Default" msgstr "" -#: rog-control-center/ui/pages/system.slint:32 +#: rog-control-center/ui/pages/system.slint:31 msgctxt "SystemPageData" msgid "BalancePerformance" msgstr "" -#: rog-control-center/ui/pages/system.slint:33 +#: rog-control-center/ui/pages/system.slint:32 msgctxt "SystemPageData" msgid "BalancePower" msgstr "" -#: rog-control-center/ui/pages/system.slint:34 +#: rog-control-center/ui/pages/system.slint:33 msgctxt "SystemPageData" msgid "Power" msgstr "" -#: rog-control-center/ui/pages/system.slint:107 +#: rog-control-center/ui/pages/system.slint:106 msgctxt "PageSystem" msgid "Base system settings" msgstr "" -#: rog-control-center/ui/pages/system.slint:112 +#: rog-control-center/ui/pages/system.slint:111 msgctxt "PageSystem" msgid "Charge limit" msgstr "" -#: rog-control-center/ui/pages/system.slint:124 +#: rog-control-center/ui/pages/system.slint:123 msgctxt "PageSystem" msgid "Throttle Policy" msgstr "" -#: rog-control-center/ui/pages/system.slint:134 +#: rog-control-center/ui/pages/system.slint:133 msgctxt "PageSystem" msgid "Advanced" msgstr "" -#: rog-control-center/ui/pages/system.slint:146 +#: rog-control-center/ui/pages/system.slint:145 msgctxt "PageSystem" msgid "Panel Overdrive" msgstr "" -#: rog-control-center/ui/pages/system.slint:154 +#: rog-control-center/ui/pages/system.slint:153 msgctxt "PageSystem" msgid "MiniLED Mode" msgstr "" -#: rog-control-center/ui/pages/system.slint:162 +#: rog-control-center/ui/pages/system.slint:161 msgctxt "PageSystem" msgid "POST boot sound" msgstr "" -#: rog-control-center/ui/pages/system.slint:180 +#: rog-control-center/ui/pages/system.slint:179 msgctxt "PageSystem" msgid "System performance settings" msgstr "" -#: rog-control-center/ui/pages/system.slint:185 +#: rog-control-center/ui/pages/system.slint:184 msgctxt "ppt_pl1_spl" msgid "ppt_pl1_spl" msgstr "" -#: rog-control-center/ui/pages/system.slint:195 +#: rog-control-center/ui/pages/system.slint:194 msgctxt "ppt_pl2_sppt" msgid "ppt_pl2_sppt" msgstr "" -#: rog-control-center/ui/pages/system.slint:205 +#: rog-control-center/ui/pages/system.slint:204 msgctxt "ppt_fppt" msgid "ppt_fppt" msgstr "" -#: rog-control-center/ui/pages/system.slint:215 +#: rog-control-center/ui/pages/system.slint:214 msgctxt "ppt_apu_sppt" msgid "ppt_apu_sppt" msgstr "" -#: rog-control-center/ui/pages/system.slint:225 +#: rog-control-center/ui/pages/system.slint:224 msgctxt "ppt_platform_sppt" msgid "ppt_platform_sppt" msgstr "" -#: rog-control-center/ui/pages/system.slint:235 +#: rog-control-center/ui/pages/system.slint:234 msgctxt "nv_dynamic_boost" msgid "nv_dynamic_boost" msgstr "" -#: rog-control-center/ui/pages/system.slint:245 +#: rog-control-center/ui/pages/system.slint:244 msgctxt "nv_temp_target" msgid "nv_temp_target" msgstr "" -#: rog-control-center/ui/pages/system.slint:290 +#: rog-control-center/ui/pages/system.slint:289 msgctxt "PageSystem" msgid "Energy Performance Preference linked to Throttle Policy" msgstr "" -#: rog-control-center/ui/pages/system.slint:294 +#: rog-control-center/ui/pages/system.slint:293 msgctxt "PageSystem" msgid "Change EPP based on Throttle Policy" msgstr "" -#: rog-control-center/ui/pages/system.slint:302 +#: rog-control-center/ui/pages/system.slint:301 msgctxt "PageSystem" msgid "EPP for Balanced Policy" msgstr "" -#: rog-control-center/ui/pages/system.slint:312 +#: rog-control-center/ui/pages/system.slint:311 msgctxt "PageSystem" msgid "EPP for Performance Policy" msgstr "" -#: rog-control-center/ui/pages/system.slint:322 +#: rog-control-center/ui/pages/system.slint:321 msgctxt "PageSystem" msgid "EPP for Quiet Policy" msgstr "" -#: rog-control-center/ui/pages/system.slint:340 +#: rog-control-center/ui/pages/system.slint:339 msgctxt "PageSystem" msgid "Throttle Policy for power state" msgstr "" -#: rog-control-center/ui/pages/system.slint:344 +#: rog-control-center/ui/pages/system.slint:343 msgctxt "PageSystem" msgid "Throttle Policy on Battery" msgstr "" -#: rog-control-center/ui/pages/system.slint:354 +#: rog-control-center/ui/pages/system.slint:353 msgctxt "PageSystem" msgid "Throttle Policy on AC" msgstr "" @@ -402,32 +402,32 @@ msgctxt "AuraPowerGroup" msgid "Boot" msgstr "" -#: rog-control-center/ui/widgets/aura_power.slint:41 +#: rog-control-center/ui/widgets/aura_power.slint:42 msgctxt "AuraPowerGroup" msgid "Awake" msgstr "" -#: rog-control-center/ui/widgets/aura_power.slint:50 +#: rog-control-center/ui/widgets/aura_power.slint:52 msgctxt "AuraPowerGroup" msgid "Sleep" msgstr "" -#: rog-control-center/ui/widgets/aura_power.slint:59 +#: rog-control-center/ui/widgets/aura_power.slint:62 msgctxt "AuraPowerGroup" msgid "Shutdown" msgstr "" -#: rog-control-center/ui/main_window.slint:45 +#: rog-control-center/ui/main_window.slint:48 msgctxt "MainWindow" msgid "ROG" msgstr "" -#: rog-control-center/ui/main_window.slint:47 +#: rog-control-center/ui/main_window.slint:49 msgctxt "Menu1" msgid "System Control" msgstr "" -#: rog-control-center/ui/main_window.slint:48 +#: rog-control-center/ui/main_window.slint:49 msgctxt "Menu2" msgid "Keyboard Aura" msgstr "" @@ -437,17 +437,17 @@ msgctxt "Menu3" msgid "AniMe Matrix" msgstr "" -#: rog-control-center/ui/main_window.slint:50 +#: rog-control-center/ui/main_window.slint:49 msgctxt "Menu4" msgid "Fan Curves" msgstr "" -#: rog-control-center/ui/main_window.slint:51 +#: rog-control-center/ui/main_window.slint:49 msgctxt "Menu5" msgid "App Settings" msgstr "" -#: rog-control-center/ui/main_window.slint:52 +#: rog-control-center/ui/main_window.slint:49 msgctxt "Menu6" msgid "About" msgstr "" diff --git a/rog-control-center/ui/globals.slint b/rog-control-center/ui/globals.slint index 7726edd0..17367644 100644 --- a/rog-control-center/ui/globals.slint +++ b/rog-control-center/ui/globals.slint @@ -1,39 +1,8 @@ -struct ButtonColours { - base: color, - pressed: color, - hovered: color, -} - export global AppSize { out property width: 900px; out property height: 500px; } -export global Theme { - out property window-background: #000000; - out property neutral-box: #BDC0D1; - // The background colour of pages and bars - out property background-color: root.dark-mode ? #3a127b : white; - out property text-foreground-color: root.dark-mode ? #F4F6FF : black; - out property secondary-foreground-color: root.dark-mode ? #C1C3CA : #6C6E7A; - out property image-button-background: root.dark-mode ? root.window-background : white; - out property toolbar-background: root.background-color; - out property notification-border: root.background-color; - out property notification-background: root.background-color; - out property control-outline: #FFBF63; - out property control-secondary: #6284FF; - out property control-foreground: root.dark-mode ? white : #122F7B; - out property push-button-base: #FFBF63; - out property push-button: { - base: root.push-button-base, - pressed: root.push-button-base.darker(40%), - hovered: root.push-button-base.darker(20%), - }; - out property push-button-text-color: white; - out property base-font-size: 16px; - in property dark-mode: true; -} - export global IconImages { //out property two_t: @image-url("images/parameters/2t.png"); } diff --git a/rog-control-center/ui/main_window.slint b/rog-control-center/ui/main_window.slint index 9027a4de..4c36091b 100644 --- a/rog-control-center/ui/main_window.slint +++ b/rog-control-center/ui/main_window.slint @@ -1,5 +1,5 @@ -import { Button, VerticalBox } from "std-widgets.slint"; -import { Theme, AppSize } from "globals.slint"; +import { Palette, Button, VerticalBox } from "std-widgets.slint"; +import { AppSize } from "globals.slint"; import { PageSystem, AvailableSystemProperties, SystemPageData } from "pages/system.slint"; import { SideBar } from "widgets/sidebar.slint"; import { PageAbout } from "pages/about.slint"; @@ -10,11 +10,11 @@ import { AuraPageData, AuraDevType, AuraDevTuf, AuraDevRog1, PowerZones, KbAuraP export { AuraPageData, AuraDevType, AuraDevTuf, AuraDevRog1, PowerZones, KbAuraPowerState, AuraPowerDev, AuraEffect } import { PageAppSettings, AppSettingsPageData } from "pages/app_settings.slint"; -export { AppSize, Theme, AvailableSystemProperties, SystemPageData, AnimePageData, AppSettingsPageData } +export { AppSize, AvailableSystemProperties, SystemPageData, AnimePageData, AppSettingsPageData } export component MainWindow inherits Window { default-font-family: "DejaVu Sans"; - in property <[bool]> sidebar_items_avilable: [true, true, false, true, true, true]; + in property <[bool]> sidebar_items_avilable: [true, true, true, true, true, true]; private property show-notif; private property fade-cover; private property toast: false; @@ -23,17 +23,20 @@ export component MainWindow inherits Window { show_toast(text) => { toast = text != ""; toast_text = text; + } callback exit-app(); callback show-notification(bool); show-notification(yes) => { show-notif = yes; fade-cover = yes; + } callback external_colour_change(); external_colour_change() => { aura.external_colour_change(); aura.external_colour_change(); + } min-height: AppSize.height; min-width: AppSize.width; @@ -43,28 +46,27 @@ export component MainWindow inherits Window { VerticalLayout { side-bar := SideBar { title: @tr("ROG"); - model: [ - @tr("Menu1" => "System Control"), - @tr("Menu2" => "Keyboard Aura"), - @tr("Menu3" => "AniMe Matrix"), - @tr("Menu4" => "Fan Curves"), - @tr("Menu5" => "App Settings"), - @tr("Menu6" => "About"), - ]; + model: [@tr("Menu1" => "System Control"), @tr("Menu2" => "Keyboard Aura"), @tr("Menu3" => "AniMe Matrix"), @tr("Menu4" => "Fan Curves"), @tr("Menu5" => "App Settings"), @tr("Menu6" => "About"), ]; available: root.sidebar_items_avilable; } - Button { - max-height: 20px; - text: "Quit"; - clicked => { - root.exit-app(); + Rectangle { + height: qb.height; + width: side-bar.width; + background: Palette.control-background; + qb := Button { + max-height: 20px; + text: "Quit"; + clicked => { + root.exit-app(); + + } } } } Rectangle { - background: Colors.purple; + background: Palette.background; if(side-bar.current-item == 0): page := PageSystem { width: root.width - side-bar.width; height: root.height + 12px; @@ -107,8 +109,10 @@ export component MainWindow inherits Window { // toolbar-dropdown.close(); if (show-notif) { show-notif = false; + } fade-cover = false; + } } } @@ -124,15 +128,16 @@ export component MainWindow inherits Window { width: 100%; clicked => { toast = false; + } } Rectangle { height: 100%; width: 100%; - background: #1a043d; + background: Palette.control-background; Text { - color: Theme.text-foreground-color; + color: Palette.control-foreground; text: root.toast_text; } } @@ -150,6 +155,7 @@ export component MainWindow inherits Window { clicked => { show-notif = false; exit-app(); + } } @@ -157,7 +163,7 @@ export component MainWindow inherits Window { Rectangle { height: 100%; width: 100%; - background: Theme.neutral-box; + background: Palette.background; Text { text: "Click here to exit"; } diff --git a/rog-control-center/ui/pages/about.slint b/rog-control-center/ui/pages/about.slint index b3cc64eb..18b2f1f6 100644 --- a/rog-control-center/ui/pages/about.slint +++ b/rog-control-center/ui/pages/about.slint @@ -1,6 +1,4 @@ -import { ValueBar } from "../widgets/common.slint"; -import { Theme } from "../globals.slint"; -import { AboutSlint } from "std-widgets.slint"; +import { AboutSlint, VerticalBox, HorizontalBox } from "std-widgets.slint"; export component PageAbout inherits VerticalLayout { padding: 10px; @@ -12,6 +10,35 @@ export component PageAbout inherits VerticalLayout { font-size: 22px; } + HorizontalBox { + alignment: LayoutAlignment.center; + VerticalBox { + alignment: LayoutAlignment.center; + Text { + vertical-alignment: TextVerticalAlignment.center; + horizontal-alignment: TextHorizontalAlignment.center; + text: "Todo:"; + font-size: 22px; + } + + Text { + text: "- [x] Theme the widgets"; + } + + Text { + text: "- [x] Add a cpu/gpu temp/fan speed info bar"; + } + + Text { + text: "- [ ] Supergfx control"; + } + + Text { + text: "- [ ] Include fan speeds, temps in a bottom bar"; + } + } + } + Text { vertical-alignment: TextVerticalAlignment.center; horizontal-alignment: TextHorizontalAlignment.center; diff --git a/rog-control-center/ui/pages/anime.slint b/rog-control-center/ui/pages/anime.slint index c7d82181..fd0b0d02 100644 --- a/rog-control-center/ui/pages/anime.slint +++ b/rog-control-center/ui/pages/anime.slint @@ -1,6 +1,5 @@ -import { Theme } from "../globals.slint"; import { SystemDropdown, SystemToggle } from "../widgets/common.slint"; -import { GroupBox, VerticalBox, Button, HorizontalBox } from "std-widgets.slint"; +import { Palette, GroupBox, VerticalBox, Button, HorizontalBox } from "std-widgets.slint"; export global AnimePageData { in-out property <[string]> brightness_names: [ @@ -109,7 +108,7 @@ export component PageAnime inherits Rectangle { if root.show_fade_cover: Rectangle { width: 100%; height: 100%; - background: Theme.background-color; + background: Palette.background; opacity: 0.8; TouchArea { height: 100%; @@ -136,15 +135,15 @@ export component PageAnime inherits Rectangle { padding: 50px; spacing: 10px; GroupBox { - height: 100px; + height: 10px; VerticalBox { spacing: 10px; alignment: LayoutAlignment.start; Text { font-size: 18px; - color: Theme.text-foreground-color; + color: Palette.control-foreground; horizontal-alignment: TextHorizontalAlignment.center; - text: @tr("Advanced Anime Display : TODO!"); + text: @tr("Set which builtin animations are played"); } SystemDropdown { @@ -216,7 +215,7 @@ export component PageAnime inherits Rectangle { alignment: LayoutAlignment.start; Text { font-size: 18px; - color: Theme.text-foreground-color; + color: Palette.control-foreground; horizontal-alignment: TextHorizontalAlignment.center; text: @tr("Advanced Display Settings"); } diff --git a/rog-control-center/ui/pages/app_settings.slint b/rog-control-center/ui/pages/app_settings.slint index 51209a36..78f0e29d 100644 --- a/rog-control-center/ui/pages/app_settings.slint +++ b/rog-control-center/ui/pages/app_settings.slint @@ -1,4 +1,4 @@ -import { Theme } from "../globals.slint"; +import { Palette } from "std-widgets.slint"; import { SystemToggle } from "../widgets/common.slint"; export global AppSettingsPageData { diff --git a/rog-control-center/ui/pages/aura.slint b/rog-control-center/ui/pages/aura.slint index 0687dc27..4a7722cd 100644 --- a/rog-control-center/ui/pages/aura.slint +++ b/rog-control-center/ui/pages/aura.slint @@ -1,15 +1,13 @@ import { SystemDropdown, RogItem, SystemToggle, SystemToggleVert } from "../widgets/common.slint"; -import { Button, ComboBox, VerticalBox, GroupBox } from "std-widgets.slint"; +import { Palette, Button, ComboBox, VerticalBox, GroupBox } from "std-widgets.slint"; import { StyleMetrics, Slider, HorizontalBox, TextEdit, SpinBox, LineEdit, ScrollView } from "std-widgets.slint"; import { ColourSlider } from "../widgets/colour_picker.slint"; -import { Theme } from "../globals.slint"; import { AuraPageData, AuraDevType, AuraDevTuf, AuraDevRog1, PowerZones, KbAuraPowerState, AuraPowerDev, AuraEffect } from "../types/aura_types.slint"; import { AuraPowerGroup } from "../widgets/aura_power.slint"; export component PageAura inherits Rectangle { property show_fade_cover: false; property show_aura_power: false; - callback external_colour_change(); external_colour_change() => { c1.colourbox = AuraPageData.led_mode_data.colour1; @@ -23,7 +21,6 @@ export component PageAura inherits Rectangle { padding: 10px; spacing: 10px; alignment: LayoutAlignment.start; - HorizontalLayout { spacing: 10px; SystemDropdown { @@ -184,7 +181,7 @@ export component PageAura inherits Rectangle { if root.show_fade_cover: Rectangle { width: 100%; height: 100%; - background: Theme.background-color; + background: Palette.background; opacity: 0.8; TouchArea { height: 100%; @@ -203,7 +200,7 @@ export component PageAura inherits Rectangle { spacing: 10px; for power in AuraPageData.supported_power_zones: gr := HorizontalLayout { if power == PowerZones.Keyboard: zone1 := AuraPowerGroup { - title: @tr("Keyboard"); + group-title: @tr("Keyboard"); boot_checked: AuraPageData.led_power.rog.keyboard.boot; boot_toggled => { AuraPageData.led_power.rog.keyboard.boot = zone1.boot_checked; @@ -225,8 +222,9 @@ export component PageAura inherits Rectangle { AuraPageData.set_led_power(AuraPageData.led_power); } } + if power == PowerZones.Logo: zone2 := AuraPowerGroup { - title: @tr("Lid Logo"); + group-title: @tr("Lid Logo"); boot_checked: AuraPageData.led_power.rog.logo.boot; boot_toggled => { AuraPageData.led_power.rog.logo.boot = zone2.boot_checked; @@ -248,8 +246,9 @@ export component PageAura inherits Rectangle { AuraPageData.set_led_power(AuraPageData.led_power); } } + if power == PowerZones.Lightbar: zone3 := AuraPowerGroup { - title: @tr("Lightbar"); + group-title: @tr("Lightbar"); boot_checked: AuraPageData.led_power.rog.lightbar.boot; boot_toggled => { AuraPageData.led_power.rog.lightbar.boot = zone3.boot_checked; @@ -271,8 +270,9 @@ export component PageAura inherits Rectangle { AuraPageData.set_led_power(AuraPageData.led_power); } } + if power == PowerZones.Lid: zone4 := AuraPowerGroup { - title: @tr("Lid Zone"); + group-title: @tr("Lid Zone"); boot_checked: AuraPageData.led_power.rog.lid.boot; boot_toggled => { AuraPageData.led_power.rog.lid.boot = zone4.boot_checked; @@ -294,8 +294,9 @@ export component PageAura inherits Rectangle { AuraPageData.set_led_power(AuraPageData.led_power); } } + if power == PowerZones.RearGlow: zone5 := AuraPowerGroup { - title: @tr("Rear Glow"); + group-title: @tr("Rear Glow"); boot_checked: AuraPageData.led_power.rog.rear-glow.boot; boot_toggled => { AuraPageData.led_power.rog.rear-glow.boot = zone5.boot_checked; @@ -344,13 +345,13 @@ export component PageAura inherits Rectangle { spacing: 10px; Rectangle { border-radius: 20px; - background: Theme.window-background; + background: Palette.control-background; VerticalBox { spacing: 10px; alignment: LayoutAlignment.start; Text { font-size: 18px; - color: Theme.text-foreground-color; + color: Palette.control-foreground; horizontal-alignment: TextHorizontalAlignment.center; text: @tr("Keyboard"); } @@ -404,13 +405,13 @@ export component PageAura inherits Rectangle { spacing: 10px; Rectangle { border-radius: 20px; - background: Theme.window-background; + background: Palette.control-background; VerticalBox { spacing: 10px; alignment: LayoutAlignment.start; Text { font-size: 18px; - color: Theme.text-foreground-color; + color: Palette.control-foreground; horizontal-alignment: TextHorizontalAlignment.center; text: @tr("Keyboard"); } diff --git a/rog-control-center/ui/pages/fans.slint b/rog-control-center/ui/pages/fans.slint index e1989e1b..361a7ab0 100644 --- a/rog-control-center/ui/pages/fans.slint +++ b/rog-control-center/ui/pages/fans.slint @@ -1,5 +1,3 @@ -import { Theme } from "../globals.slint"; - export component PageFans inherits VerticalLayout { Rectangle { clip: true; diff --git a/rog-control-center/ui/pages/system.slint b/rog-control-center/ui/pages/system.slint index 7025ec9a..5bb48998 100644 --- a/rog-control-center/ui/pages/system.slint +++ b/rog-control-center/ui/pages/system.slint @@ -1,6 +1,5 @@ import { SystemSlider, SystemDropdown, SystemToggle } from "../widgets/common.slint"; -import { Theme } from "../globals.slint"; -import { HorizontalBox , VerticalBox, ScrollView, Slider, Button, Switch, ComboBox, GroupBox} from "std-widgets.slint"; +import { Palette, HorizontalBox , VerticalBox, ScrollView, Slider, Button, Switch, ComboBox, GroupBox} from "std-widgets.slint"; export struct AvailableSystemProperties { charge_control_end_threshold: bool, @@ -95,14 +94,14 @@ export component PageSystem inherits Rectangle { padding: 10px; spacing: 10px; Rectangle { - background: Theme.background-color; - border-color: Colors.black; - border-width: 6px; + background: Palette.alternate-background; + border-color: Palette.accent-background; + border-width: 3px; border-radius: 10px; height: 40px; Text { font-size: 18px; - color: Theme.text-foreground-color; + color: Palette.control-foreground; horizontal-alignment: TextHorizontalAlignment.center; text: @tr("Base system settings"); } @@ -168,14 +167,14 @@ export component PageSystem inherits Rectangle { } Rectangle { - background: Theme.background-color; - border-color: Colors.black; - border-width: 6px; + background: Palette.alternate-background; + border-color: Palette.accent-background; + border-width: 3px; border-radius: 10px; height: 40px; Text { font-size: 18px; - color: Theme.text-foreground-color; + color: Palette.control-foreground; horizontal-alignment: TextHorizontalAlignment.center; text: @tr("System performance settings"); } @@ -256,8 +255,8 @@ export component PageSystem inherits Rectangle { if root.show_fade_cover: Rectangle { width: 100%; height: 100%; - background: Theme.background-color; - opacity: 0.8; + background: Palette.background; + opacity: 0.9; TouchArea { height: 100%; width: 100%; diff --git a/rog-control-center/ui/types/aura_types.slint b/rog-control-center/ui/types/aura_types.slint index 538a3cba..c0243a21 100644 --- a/rog-control-center/ui/types/aura_types.slint +++ b/rog-control-center/ui/types/aura_types.slint @@ -150,9 +150,14 @@ export global AuraPageData { } callback set_hex_from_colour(color) -> string; callback set_hex_to_colour(string) -> color; - in-out property aura_type: AuraDevType.New; - in-out property <[PowerZones]> supported_power_zones: [PowerZones.Keyboard, PowerZones.RearGlow, PowerZones.Lid, PowerZones.Lightbar, PowerZones.Logo]; + in-out property <[PowerZones]> supported_power_zones: [ + PowerZones.Keyboard, + PowerZones.RearGlow, + PowerZones.Lid, + PowerZones.Lightbar, + PowerZones.Logo + ]; in-out property led_power; callback set_led_power(AuraPowerDev); -} \ No newline at end of file +} diff --git a/rog-control-center/ui/widgets/aura_power.slint b/rog-control-center/ui/widgets/aura_power.slint index eb72e047..ad9db3de 100644 --- a/rog-control-center/ui/widgets/aura_power.slint +++ b/rog-control-center/ui/widgets/aura_power.slint @@ -1,12 +1,12 @@ -import { VerticalBox, HorizontalBox } from "std-widgets.slint"; +import { Palette, VerticalBox, HorizontalBox, GroupBox } from "std-widgets.slint"; import { SystemToggleVert } from "common.slint"; -import { Theme } from "../globals.slint"; export component AuraPowerGroup inherits Rectangle { + min-width: row.min-width; border-radius: 20px; - background: Theme.window-background; - - in-out property title; + background: Palette.alternate-background; + opacity: 0.9; + in-out property group-title; in-out property boot_checked; in-out property awake_checked; in-out property sleep_checked; @@ -15,19 +15,19 @@ export component AuraPowerGroup inherits Rectangle { callback awake_toggled(bool); callback sleep_toggled(bool); callback shutdown_toggled(bool); - VerticalBox { spacing: 10px; - alignment: LayoutAlignment.start; Text { font-size: 18px; - color: Theme.text-foreground-color; + color: Palette.alternate-foreground; horizontal-alignment: TextHorizontalAlignment.center; - text <=> root.title; + text <=> root.group-title; } - HorizontalBox { + row := HorizontalBox { + alignment: LayoutAlignment.center; SystemToggleVert { + min-width: 96px; max-height: 42px; text: @tr("Boot"); checked <=> root.boot_checked; @@ -37,6 +37,7 @@ export component AuraPowerGroup inherits Rectangle { } SystemToggleVert { + min-width: 96px; max-height: 42px; text: @tr("Awake"); checked <=> root.awake_checked; @@ -46,6 +47,7 @@ export component AuraPowerGroup inherits Rectangle { } SystemToggleVert { + min-width: 96px; max-height: 42px; text: @tr("Sleep"); checked <=> root.sleep_checked; @@ -55,6 +57,7 @@ export component AuraPowerGroup inherits Rectangle { } SystemToggleVert { + min-width: 96px; max-height: 42px; text: @tr("Shutdown"); checked <=> root.shutdown_checked; @@ -64,4 +67,4 @@ export component AuraPowerGroup inherits Rectangle { } } } -} \ No newline at end of file +} diff --git a/rog-control-center/ui/widgets/colour_picker.slint b/rog-control-center/ui/widgets/colour_picker.slint index 2d7c3632..6fc57753 100644 --- a/rog-control-center/ui/widgets/colour_picker.slint +++ b/rog-control-center/ui/widgets/colour_picker.slint @@ -1,4 +1,4 @@ -import { Slider, HorizontalBox, Button, LineEdit } from "std-widgets.slint"; +import { Palette, Slider, HorizontalBox, Button, LineEdit } from "std-widgets.slint"; export component ColourSlider inherits VerticalLayout { spacing: 10px; @@ -9,7 +9,6 @@ export component ColourSlider inherits VerticalLayout { callback hex_to_colour(string) -> color; // required callback set_hex_from_colour(color) -> string; - in-out property c1value<=> c1.value; in-out property c2value<=> c2.value; property <[color]> base_colours: [ @@ -64,11 +63,9 @@ export component ColourSlider inherits VerticalLayout { blend_lightness(base_colour, 0.1), blend_lightness(base_colour, 0.0) ]; - function blend_lightness(c1: color, f: float) -> color { rgb(c1.red * f, c1.green * f, c1.blue * f) - } - function set_base_colour() { + }function set_base_colour() { root.base_colour = base_colours[c1.value].interpolate(base_colours[c1.value + 1], c1.value - Math.floor(c1.value)); root.final_colour = blend_lightness(base_colour, ((base_shade.length - c2.value) / base_shade.length)); root.colourbox = root.final_colour; @@ -82,13 +79,14 @@ export component ColourSlider inherits VerticalLayout { c2.value = root.base_shade.length - (root.base_shade.length * root.final_colour.brightness()); root.set_base_colour(); } - Rectangle { height: 32px; + border-width: 2px; + border-radius: 7px; + border-color: Palette.border; // 13 colours background: @linear-gradient(90deg, base_colours[0], base_colours[1], base_colours[2], base_colours[3], base_colours[4], base_colours[5], base_colours[6], base_colours[7], base_colours[8], base_colours[9], base_colours[10], base_colours[11], base_colours[12], base_colours[13], base_colours[14], base_colours[15], base_colours[16], base_colours[17], base_colours[18], base_colours[19], base_colours[20], base_colours[21], base_colours[22], base_colours[23], base_colours[24], base_colours[25], base_colours[26], base_colours[27], base_colours[28], base_colours[29], base_colours[30], base_colours[31], base_colours[32], base_colours[33], base_colours[34], base_colours[35]); clip: true; - border-radius: 6px; c1 := Slider { width: parent.width; height: parent.height; @@ -104,10 +102,12 @@ export component ColourSlider inherits VerticalLayout { Rectangle { height: 32px; + border-width: 2px; + border-radius: 7px; + border-color: Palette.border; // 11 colours background: @linear-gradient(90deg, base_shade[0], base_shade[1], base_shade[2], base_shade[3], base_shade[4], base_shade[5], base_shade[6], base_shade[7], base_shade[8], base_shade[9], base_shade[10]); clip: true; - border-radius: 6px; c2 := Slider { width: parent.width; height: parent.height; @@ -132,6 +132,9 @@ export component ColourSlider inherits VerticalLayout { Rectangle { width: self.height; + border-width: 2px; + border-radius: 7px; + border-color: Palette.border; background <=> root.colourbox; } } diff --git a/rog-control-center/ui/widgets/common.slint b/rog-control-center/ui/widgets/common.slint index 7b2fb13e..0b26fbe8 100644 --- a/rog-control-center/ui/widgets/common.slint +++ b/rog-control-center/ui/widgets/common.slint @@ -1,11 +1,11 @@ -import { VerticalBox , StandardButton, Button, HorizontalBox, ComboBox, Switch, Slider} from "std-widgets.slint"; -import { Theme } from "../globals.slint"; +import { Palette, VerticalBox , StandardButton, Button, HorizontalBox, ComboBox, Switch, Slider} from "std-widgets.slint"; export component RogItem inherits Rectangle { - background: Theme.background-color; - border-color: Colors.black; + background: Palette.control-background; + border-color: Palette.border; border-width: 3px; border-radius: 10px; + min-height: 46px; } export component SystemSlider inherits RogItem { @@ -15,21 +15,22 @@ export component SystemSlider inherits RogItem { in-out property maximum; callback released(int); HorizontalLayout { - HorizontalBox { + HorizontalLayout { width: 30%; - alignment: LayoutAlignment.start; + alignment: LayoutAlignment.space-between; + padding-left: 10px; Text { font-size: 16px; vertical-alignment: TextVerticalAlignment.center; - color: Theme.text-foreground-color; + color: Palette.control-foreground; text <=> root.text; } Text { font-size: 16px; vertical-alignment: TextVerticalAlignment.center; - color: Theme.text-foreground-color; - text: ": \{Math.round(root.value)}"; + color: Palette.control-foreground; + text: "\{Math.round(root.value)}"; } } @@ -53,17 +54,18 @@ export component SystemToggle inherits RogItem { in-out property checked; callback toggled(bool); HorizontalLayout { - HorizontalBox { + HorizontalLayout { alignment: LayoutAlignment.start; + padding-left: 10px; Text { font-size: 16px; vertical-alignment: TextVerticalAlignment.center; - color: Theme.text-foreground-color; + color: Palette.control-foreground; text <=> root.text; } } - HorizontalBox { + HorizontalLayout { alignment: LayoutAlignment.end; padding-right: 20px; Switch { @@ -80,25 +82,24 @@ export component SystemToggleVert inherits RogItem { in property text; in-out property checked; callback toggled(bool); + min-height: 86px; VerticalLayout { - HorizontalBox { - alignment: LayoutAlignment.center; - padding-top: 10px; - Text { - font-size: 16px; - vertical-alignment: TextVerticalAlignment.bottom; - horizontal-alignment: TextHorizontalAlignment.center; - color: Theme.text-foreground-color; - text <=> root.text; - } + alignment: LayoutAlignment.space-around; + padding-top: 8px; + Text { + font-size: 16px; + vertical-alignment: TextVerticalAlignment.bottom; + horizontal-alignment: TextHorizontalAlignment.center; + color: Palette.control-foreground; + text <=> root.text; } - HorizontalBox { + HorizontalLayout { alignment: LayoutAlignment.center; - padding: 10px; + padding-bottom: 10px; Switch { checked <=> root.checked; - toggled => { + toggled => { root.toggled(root.checked) } } @@ -113,19 +114,22 @@ export component SystemDropdown inherits RogItem { in-out property <[string]> model; callback selected(int); HorizontalLayout { - HorizontalBox { + HorizontalLayout { alignment: LayoutAlignment.start; + padding-left: 10px; Text { font-size: 16px; vertical-alignment: TextVerticalAlignment.center; - color: Theme.text-foreground-color; + color: Palette.control-foreground; text <=> root.text; } } - HorizontalBox { + HorizontalLayout { alignment: LayoutAlignment.end; padding-right: 20px; + padding-top: 7px; + padding-bottom: 7px; ComboBox { model <=> root.model; current-index <=> root.current_index; @@ -138,49 +142,6 @@ export component SystemDropdown inherits RogItem { } } -// A variable bar that can be single or double ended -export component ValueBar inherits Rectangle { - in property value: 0.0; - in property min: 0.0; - in property max: 1.0; - function percentage(min: float, max: float, value: float) -> float { - if (min < 0.0 && max > 0.0) { - // do a percentage of each half as 0-50% - if (value >= max + min) { - return (value - (max + min) / 2) / (max - min); - } - return 0.50 - (value - (min - max) / 2) / (max - min); - } - return (value - min) / (max - min); - }function set_x(min: float, max: float, value: float, width: length) -> length { - if (min < 0.0 && max > 0.0) { - if (value < max + min) { - return width / 2 - width * (percentage(min, max, value)); - } - return width / 2; - } - return 0; - }Rectangle { - border-radius: 3px; - background: Theme.neutral-box; - Rectangle { - x: set_x(root.min, root.max, root.value, root.width); - width: parent.x + parent.width * percentage(root.min, root.max, root.value); - border-radius: parent.border-radius; - background: Theme.control-secondary; - } - - Text { - vertical-alignment: center; - horizontal-alignment: center; - text: root.value; - font-size: root.height; - font-weight: 900; - color: Theme.control-foreground; - } - } -} - export component PopupNotification { in property heading; in property content; @@ -192,8 +153,8 @@ export component PopupNotification { // TODO: add properties to display Rectangle { border-width: 2px; - border-color: Theme.control-outline; - background: Theme.notification-background; + border-color: Palette.accent-background; + background: Palette.background; // TODO: drop shadows slow // drop-shadow-offset-x: 7px; // drop-shadow-offset-y: 7px; @@ -205,14 +166,14 @@ export component PopupNotification { alignment: start; Text { text: heading; - color: Theme.text-foreground-color; + color: Palette.control-foreground; font-size: 32px; font-weight: 900; } Text { text: content; - color: Theme.text-foreground-color; + color: Palette.control-foreground; font-size: 18px; } }