mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0d9d42fb19 | |||
| 99ec1e8bcf | |||
| c2a3310891 | |||
| 024d41727f | |||
| 7d55a2675b |
@@ -8,7 +8,7 @@ use rog_aura::{AuraEffect, AuraModeNum, AuraZone, Colour, Direction, Speed};
|
|||||||
#[derive(FromArgs, Debug, Clone)]
|
#[derive(FromArgs, Debug, Clone)]
|
||||||
#[argh(
|
#[argh(
|
||||||
subcommand,
|
subcommand,
|
||||||
name = "aura-power-old",
|
name = "power-tuf",
|
||||||
description = "aura power (old ROGs and TUF laptops)"
|
description = "aura power (old ROGs and TUF laptops)"
|
||||||
)]
|
)]
|
||||||
pub struct LedPowerCommand1 {
|
pub struct LedPowerCommand1 {
|
||||||
@@ -38,7 +38,7 @@ pub struct LedPowerCommand1 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(FromArgs, Debug, Clone)]
|
#[derive(FromArgs, Debug, Clone)]
|
||||||
#[argh(subcommand, name = "aura-power", description = "aura power")]
|
#[argh(subcommand, name = "power", description = "aura power")]
|
||||||
pub struct LedPowerCommand2 {
|
pub struct LedPowerCommand2 {
|
||||||
#[argh(subcommand)]
|
#[argh(subcommand)]
|
||||||
pub command: Option<SetAuraZoneEnabled>,
|
pub command: Option<SetAuraZoneEnabled>,
|
||||||
|
|||||||
+17
-4
@@ -18,9 +18,7 @@ pub struct CliStart {
|
|||||||
#[derive(FromArgs, Debug)]
|
#[derive(FromArgs, Debug)]
|
||||||
#[argh(subcommand)]
|
#[argh(subcommand)]
|
||||||
pub enum CliCommand {
|
pub enum CliCommand {
|
||||||
Aura(LedModeCommand),
|
Aura(AuraCommand),
|
||||||
AuraPowerOld(LedPowerCommand1),
|
|
||||||
AuraPower(LedPowerCommand2),
|
|
||||||
Brightness(BrightnessCommand),
|
Brightness(BrightnessCommand),
|
||||||
Profile(ProfileCommand),
|
Profile(ProfileCommand),
|
||||||
FanCurve(FanCurveCommand),
|
FanCurve(FanCurveCommand),
|
||||||
@@ -99,7 +97,7 @@ pub struct ProfileSetCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(FromArgs, Debug, Default)]
|
#[derive(FromArgs, Debug, Default)]
|
||||||
#[argh(subcommand, name = "aura", description = "led mode commands")]
|
#[argh(subcommand, name = "effect", description = "led mode commands")]
|
||||||
pub struct LedModeCommand {
|
pub struct LedModeCommand {
|
||||||
#[argh(switch, description = "switch to next aura mode")]
|
#[argh(switch, description = "switch to next aura mode")]
|
||||||
pub next_mode: bool,
|
pub next_mode: bool,
|
||||||
@@ -111,6 +109,21 @@ pub struct LedModeCommand {
|
|||||||
pub command: Option<SetAuraBuiltin>,
|
pub command: Option<SetAuraBuiltin>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(FromArgs, Debug)]
|
||||||
|
#[argh(subcommand, name = "aura", description = "aura device commands")]
|
||||||
|
pub struct AuraCommand {
|
||||||
|
#[argh(subcommand)]
|
||||||
|
pub command: AuraSubCommand,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(FromArgs, Debug)]
|
||||||
|
#[argh(subcommand)]
|
||||||
|
pub enum AuraSubCommand {
|
||||||
|
Power(LedPowerCommand2),
|
||||||
|
PowerTuf(LedPowerCommand1),
|
||||||
|
Effect(LedModeCommand),
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(FromArgs, Debug, Default)]
|
#[derive(FromArgs, Debug, Default)]
|
||||||
#[argh(
|
#[argh(
|
||||||
subcommand,
|
subcommand,
|
||||||
|
|||||||
+7
-5
@@ -186,9 +186,11 @@ fn do_parsed(
|
|||||||
conn: Connection,
|
conn: Connection,
|
||||||
) -> Result<(), Box<dyn std::error::Error>> {
|
) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
match &parsed.command {
|
match &parsed.command {
|
||||||
CliCommand::Aura(mode) => handle_led_mode(mode)?,
|
CliCommand::Aura(a) => match &a.command {
|
||||||
CliCommand::AuraPowerOld(pow) => handle_led_power1(pow)?,
|
crate::cli_opts::AuraSubCommand::Effect(mode) => handle_led_mode(mode)?,
|
||||||
CliCommand::AuraPower(pow) => handle_led_power2(pow)?,
|
crate::cli_opts::AuraSubCommand::PowerTuf(pow) => handle_led_power1(pow)?,
|
||||||
|
crate::cli_opts::AuraSubCommand::Power(pow) => handle_led_power2(pow)?,
|
||||||
|
},
|
||||||
CliCommand::Brightness(cmd) => handle_brightness(cmd)?,
|
CliCommand::Brightness(cmd) => handle_brightness(cmd)?,
|
||||||
CliCommand::Profile(cmd) => handle_throttle_profile(&conn, supported_properties, cmd)?,
|
CliCommand::Profile(cmd) => handle_throttle_profile(&conn, supported_properties, cmd)?,
|
||||||
CliCommand::FanCurve(cmd) => handle_fan_curve(&conn, cmd)?,
|
CliCommand::FanCurve(cmd) => handle_fan_curve(&conn, cmd)?,
|
||||||
@@ -720,7 +722,7 @@ fn handle_led_power1(power: &LedPowerCommand1) -> Result<(), Box<dyn std::error:
|
|||||||
&& !power.keyboard
|
&& !power.keyboard
|
||||||
&& !power.lightbar
|
&& !power.lightbar
|
||||||
{
|
{
|
||||||
println!("Missing arg or command; run 'asusctl aura-power-old --help' for usage");
|
println!("Missing arg or command; run 'asusctl aura power-tuf --help' for usage");
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -773,7 +775,7 @@ fn handle_led_power2(power: &LedPowerCommand2) -> Result<(), Box<dyn std::error:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if power.command.is_none() {
|
if power.command.is_none() {
|
||||||
println!("Missing arg or command; run 'asusctl aura-power --help' for usage");
|
println!("Missing arg or command; run 'asusctl aura power --help' for usage");
|
||||||
println!("Commands available");
|
println!("Commands available");
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,6 +148,12 @@ async fn main() -> Result<()> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let is_tuf = {
|
||||||
|
let b = board_name.to_lowercase();
|
||||||
|
let p = prod_family.to_lowercase();
|
||||||
|
b.contains("tuf") || p.contains("tuf")
|
||||||
|
};
|
||||||
|
|
||||||
#[cfg(feature = "rog_ally")]
|
#[cfg(feature = "rog_ally")]
|
||||||
if is_rog_ally {
|
if is_rog_ally {
|
||||||
config.notifications.enabled = false;
|
config.notifications.enabled = false;
|
||||||
@@ -198,7 +204,7 @@ async fn main() -> Result<()> {
|
|||||||
loop {
|
loop {
|
||||||
if is_rog_ally {
|
if is_rog_ally {
|
||||||
let config_copy_2 = config.clone();
|
let config_copy_2 = config.clone();
|
||||||
let newui = setup_window(config.clone(), prefetched_supported.clone());
|
let newui = setup_window(config.clone(), prefetched_supported.clone(), is_tuf);
|
||||||
newui.window().on_close_requested(move || {
|
newui.window().on_close_requested(move || {
|
||||||
exit(0);
|
exit(0);
|
||||||
});
|
});
|
||||||
@@ -256,7 +262,7 @@ async fn main() -> Result<()> {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
let config_copy_2 = config_copy.clone();
|
let config_copy_2 = config_copy.clone();
|
||||||
let newui = setup_window(config_copy, pref_for_invoke.clone());
|
let newui = setup_window(config_copy, pref_for_invoke.clone(), is_tuf);
|
||||||
newui.window().on_close_requested(move || {
|
newui.window().on_close_requested(move || {
|
||||||
if let Ok(mut app_state) = app_state_copy.lock() {
|
if let Ok(mut app_state) = app_state_copy.lock() {
|
||||||
*app_state = AppState::MainWindowClosed;
|
*app_state = AppState::MainWindowClosed;
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ pub fn show_toast(
|
|||||||
pub fn setup_window(
|
pub fn setup_window(
|
||||||
config: Arc<Mutex<Config>>,
|
config: Arc<Mutex<Config>>,
|
||||||
prefetched_supported: std::sync::Arc<Option<Vec<i32>>>,
|
prefetched_supported: std::sync::Arc<Option<Vec<i32>>>,
|
||||||
|
is_tuf: bool,
|
||||||
) -> MainWindow {
|
) -> MainWindow {
|
||||||
slint::set_xdg_app_id("rog-control-center")
|
slint::set_xdg_app_id("rog-control-center")
|
||||||
.map_err(|e| warn!("Couldn't set application ID: {e:?}"))
|
.map_err(|e| warn!("Couldn't set application ID: {e:?}"))
|
||||||
@@ -127,6 +128,8 @@ pub fn setup_window(
|
|||||||
let ui = MainWindow::new()
|
let ui = MainWindow::new()
|
||||||
.map_err(|e| warn!("Couldn't create main window: {e:?}"))
|
.map_err(|e| warn!("Couldn't create main window: {e:?}"))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
// propagate TUF flag to the UI so the sidebar can swap logo branding
|
||||||
|
ui.set_is_tuf(is_tuf);
|
||||||
ui.window()
|
ui.window()
|
||||||
.show()
|
.show()
|
||||||
.map_err(|e| warn!("Couldn't show main window: {e:?}"))
|
.map_err(|e| warn!("Couldn't show main window: {e:?}"))
|
||||||
|
|||||||
@@ -40,10 +40,6 @@ pub fn setup_system_page(ui: &MainWindow, _config: Arc<Mutex<Config>>) {
|
|||||||
ui.global::<SystemPageData>().set_platform_profile(-1);
|
ui.global::<SystemPageData>().set_platform_profile(-1);
|
||||||
ui.global::<SystemPageData>().set_panel_overdrive(-1);
|
ui.global::<SystemPageData>().set_panel_overdrive(-1);
|
||||||
ui.global::<SystemPageData>().set_boot_sound(-1);
|
ui.global::<SystemPageData>().set_boot_sound(-1);
|
||||||
ui.global::<SystemPageData>().set_kbd_leds_awake(-1);
|
|
||||||
ui.global::<SystemPageData>().set_kbd_leds_sleep(-1);
|
|
||||||
ui.global::<SystemPageData>().set_kbd_leds_boot(-1);
|
|
||||||
ui.global::<SystemPageData>().set_kbd_leds_shutdown(-1);
|
|
||||||
ui.global::<SystemPageData>().set_screen_auto_brightness(-1);
|
ui.global::<SystemPageData>().set_screen_auto_brightness(-1);
|
||||||
ui.global::<SystemPageData>().set_mcu_powersave(-1);
|
ui.global::<SystemPageData>().set_mcu_powersave(-1);
|
||||||
ui.global::<SystemPageData>().set_mini_led_mode(-1);
|
ui.global::<SystemPageData>().set_mini_led_mode(-1);
|
||||||
@@ -673,26 +669,6 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
|
|||||||
setup_callback!(boot_sound, handle, attr, i32);
|
setup_callback!(boot_sound, handle, attr, i32);
|
||||||
setup_external!(boot_sound, i32, handle, attr, value)
|
setup_external!(boot_sound, i32, handle, attr, value)
|
||||||
}
|
}
|
||||||
FirmwareAttribute::KbdLedsAwake => {
|
|
||||||
init_property!(kbd_leds_awake, handle, value, i32);
|
|
||||||
setup_callback!(kbd_leds_awake, handle, attr, i32);
|
|
||||||
setup_external!(kbd_leds_awake, i32, handle, attr, value)
|
|
||||||
}
|
|
||||||
FirmwareAttribute::KbdLedsSleep => {
|
|
||||||
init_property!(kbd_leds_sleep, handle, value, i32);
|
|
||||||
setup_callback!(kbd_leds_sleep, handle, attr, i32);
|
|
||||||
setup_external!(kbd_leds_sleep, i32, handle, attr, value)
|
|
||||||
}
|
|
||||||
FirmwareAttribute::KbdLedsBoot => {
|
|
||||||
init_property!(kbd_leds_boot, handle, value, i32);
|
|
||||||
setup_callback!(kbd_leds_boot, handle, attr, i32);
|
|
||||||
setup_external!(kbd_leds_boot, i32, handle, attr, value)
|
|
||||||
}
|
|
||||||
FirmwareAttribute::KbdLedsShutdown => {
|
|
||||||
init_property!(kbd_leds_shutdown, handle, value, i32);
|
|
||||||
setup_callback!(kbd_leds_shutdown, handle, attr, i32);
|
|
||||||
setup_external!(kbd_leds_shutdown, i32, handle, attr, value)
|
|
||||||
}
|
|
||||||
FirmwareAttribute::ScreenAutoBrightness => {
|
FirmwareAttribute::ScreenAutoBrightness => {
|
||||||
init_property!(screen_auto_brightness, handle, value, i32);
|
init_property!(screen_auto_brightness, handle, value, i32);
|
||||||
setup_callback!(screen_auto_brightness, handle, attr, i32);
|
setup_callback!(screen_auto_brightness, handle, attr, i32);
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ export component MainWindow inherits Window {
|
|||||||
true, // About
|
true, // About
|
||||||
];
|
];
|
||||||
private property <bool> show_notif;
|
private property <bool> show_notif;
|
||||||
|
// TODO: change if TUF on the logo in the menu on the main page
|
||||||
|
in property <bool> is_tuf: false;
|
||||||
private property <bool> fade_cover;
|
private property <bool> fade_cover;
|
||||||
private property <bool> toast: false;
|
private property <bool> toast: false;
|
||||||
private property <string> toast_text: "I show when something is waiting";
|
private property <string> toast_text: "I show when something is waiting";
|
||||||
@@ -80,6 +82,7 @@ export component MainWindow inherits Window {
|
|||||||
@tr("Menu7" => "About"),
|
@tr("Menu7" => "About"),
|
||||||
];
|
];
|
||||||
available: root.sidebar_items_avilable;
|
available: root.sidebar_items_avilable;
|
||||||
|
is_tuf: root.is_tuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
@@ -101,31 +104,37 @@ export component MainWindow inherits Window {
|
|||||||
|
|
||||||
/*if(side-bar.current-item == 1):*/ aura := PageAura {
|
/*if(side-bar.current-item == 1):*/ aura := PageAura {
|
||||||
width: root.width - side-bar.width;
|
width: root.width - side-bar.width;
|
||||||
|
height: root.height + 12px;
|
||||||
visible: side-bar.current-item == 1;
|
visible: side-bar.current-item == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(side-bar.current-item == 2): PageAnime {
|
if(side-bar.current-item == 2): PageAnime {
|
||||||
width: root.width - side-bar.width;
|
width: root.width - side-bar.width;
|
||||||
|
height: root.height + 12px;
|
||||||
visible: side-bar.current-item == 2;
|
visible: side-bar.current-item == 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(side-bar.current-item == 3): fans := PageFans {
|
if(side-bar.current-item == 3): fans := PageFans {
|
||||||
width: root.width - side-bar.width;
|
width: root.width - side-bar.width;
|
||||||
|
height: root.height + 12px;
|
||||||
visible: side-bar.current-item == 3;
|
visible: side-bar.current-item == 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(side-bar.current-item == 4): PageGPU {
|
if(side-bar.current-item == 4): PageGPU {
|
||||||
width: root.width - side-bar.width;
|
width: root.width - side-bar.width;
|
||||||
|
height: root.height + 12px;
|
||||||
visible: side-bar.current-item == 4;
|
visible: side-bar.current-item == 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(side-bar.current-item == 5): PageAppSettings {
|
if(side-bar.current-item == 5): PageAppSettings {
|
||||||
width: root.width - side-bar.width;
|
width: root.width - side-bar.width;
|
||||||
|
height: root.height + 12px;
|
||||||
visible: side-bar.current-item == 5;
|
visible: side-bar.current-item == 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(side-bar.current-item == 6): PageAbout {
|
if(side-bar.current-item == 6): PageAbout {
|
||||||
width: root.width - side-bar.width;
|
width: root.width - side-bar.width;
|
||||||
|
height: root.height + 12px;
|
||||||
visible: side-bar.current-item == 6;
|
visible: side-bar.current-item == 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -238,15 +238,47 @@ export component PageAura inherits Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Button {
|
// TUF devices: show the same configurable power groups as `New`, since
|
||||||
x: root.width - self.width - 6px;
|
// `setup_aura` fills `AuraPageData.supported_power_zones` and `led_power`
|
||||||
y: 6px;
|
// appropriately for TUF devices. This ensures the Power Settings panel
|
||||||
text: "✕";
|
// reflects what the firmware reports for TUF models.
|
||||||
height: 36px;
|
if root.show_aura_power && AuraPageData.device_type == AuraDevType.Tuf: Rectangle {
|
||||||
clicked => {
|
background: Palette.background;
|
||||||
root.show_aura_power = false;
|
width: 100%;
|
||||||
root.show_fade_cover = false;
|
height: 100%;
|
||||||
|
opacity: 1;
|
||||||
|
ScrollView {
|
||||||
|
VerticalLayout {
|
||||||
|
padding: 30px;
|
||||||
|
padding-top: 10px;
|
||||||
|
spacing: 10px;
|
||||||
|
alignment: LayoutAlignment.start;
|
||||||
|
|
||||||
|
for state[idx] in AuraPageData.led_power.states: tuf_zone := AuraPowerGroup {
|
||||||
|
group-title: AuraPageData.power_zone_names[state.zone_name_idx];
|
||||||
|
boot_checked: state.boot;
|
||||||
|
boot_toggled => {
|
||||||
|
AuraPageData.led_power.states[idx].boot = tuf_zone.boot_checked;
|
||||||
|
AuraPageData.cb_led_power(AuraPageData.led_power);
|
||||||
|
}
|
||||||
|
awake_checked: state.awake;
|
||||||
|
awake_toggled => {
|
||||||
|
AuraPageData.led_power.states[idx].awake = tuf_zone.awake_checked;
|
||||||
|
AuraPageData.cb_led_power(AuraPageData.led_power);
|
||||||
|
}
|
||||||
|
sleep_checked: state.sleep;
|
||||||
|
sleep_toggled => {
|
||||||
|
AuraPageData.led_power.states[idx].sleep = tuf_zone.sleep_checked;
|
||||||
|
AuraPageData.cb_led_power(AuraPageData.led_power);
|
||||||
|
}
|
||||||
|
shutdown_checked: state.shutdown;
|
||||||
|
shutdown_toggled => {
|
||||||
|
AuraPageData.led_power.states[idx].shutdown = tuf_zone.shutdown_checked;
|
||||||
|
AuraPageData.cb_led_power(AuraPageData.led_power);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -292,8 +324,10 @@ export component PageAura inherits Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Button {
|
if root.show_aura_power: Button {
|
||||||
x: root.width - self.width - 6px;
|
x: root.width - self.width - 6px;
|
||||||
y: 6px;
|
y: 6px;
|
||||||
text: "✕";
|
text: "✕";
|
||||||
@@ -303,6 +337,4 @@ export component PageAura inherits Rectangle {
|
|||||||
root.show_fade_cover = false;
|
root.show_fade_cover = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,8 +18,22 @@ export component PageGPU inherits Rectangle {
|
|||||||
|
|
||||||
ScrollView {
|
ScrollView {
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
padding: 10px;
|
padding: 12px;
|
||||||
spacing: 10px;
|
spacing: 8px;
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
background: Palette.alternate-background;
|
||||||
|
border-color: Palette.border;
|
||||||
|
border-width: 1px;
|
||||||
|
border-radius: 2px;
|
||||||
|
height: 36px;
|
||||||
|
Text {
|
||||||
|
font-size: 16px;
|
||||||
|
color: Palette.control-foreground;
|
||||||
|
horizontal-alignment: TextHorizontalAlignment.center;
|
||||||
|
text: @tr("Internal/Discrete GPU");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
|
|||||||
@@ -51,14 +51,6 @@ export global SystemPageData {
|
|||||||
callback cb_panel_overdrive(int);
|
callback cb_panel_overdrive(int);
|
||||||
in-out property <int> boot_sound;
|
in-out property <int> boot_sound;
|
||||||
callback cb_boot_sound(int);
|
callback cb_boot_sound(int);
|
||||||
in-out property <int> kbd_leds_awake;
|
|
||||||
callback cb_kbd_leds_awake(int);
|
|
||||||
in-out property <int> kbd_leds_sleep;
|
|
||||||
callback cb_kbd_leds_sleep(int);
|
|
||||||
in-out property <int> kbd_leds_boot;
|
|
||||||
callback cb_kbd_leds_boot(int);
|
|
||||||
in-out property <int> kbd_leds_shutdown;
|
|
||||||
callback cb_kbd_leds_shutdown(int);
|
|
||||||
in-out property <int> screen_auto_brightness;
|
in-out property <int> screen_auto_brightness;
|
||||||
callback cb_screen_auto_brightness(int);
|
callback cb_screen_auto_brightness(int);
|
||||||
in-out property <int> mcu_powersave;
|
in-out property <int> mcu_powersave;
|
||||||
@@ -252,66 +244,6 @@ export component PageSystem inherits Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if SystemPageData.kbd_leds_awake != -1 ||
|
|
||||||
SystemPageData.kbd_leds_sleep != -1 ||
|
|
||||||
SystemPageData.kbd_leds_boot != -1 ||
|
|
||||||
SystemPageData.kbd_leds_shutdown != -1: VerticalLayout {
|
|
||||||
padding: 0px;
|
|
||||||
spacing: 0px;
|
|
||||||
alignment: LayoutAlignment.start;
|
|
||||||
Rectangle {
|
|
||||||
background: Palette.alternate-background;
|
|
||||||
border-color: Palette.border;
|
|
||||||
border-width: 1px;
|
|
||||||
border-radius: 2px;
|
|
||||||
height: 40px;
|
|
||||||
Text {
|
|
||||||
font-size: 16px;
|
|
||||||
color: Palette.control-foreground;
|
|
||||||
horizontal-alignment: TextHorizontalAlignment.center;
|
|
||||||
text: @tr("Keyboard Power Management");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GroupBox {
|
|
||||||
|
|
||||||
HorizontalLayout {
|
|
||||||
spacing: 10px;
|
|
||||||
if SystemPageData.kbd_leds_awake != -1: SystemToggleInt {
|
|
||||||
text: @tr("Keyboard Awake Effect");
|
|
||||||
checked_int <=> SystemPageData.kbd_leds_awake;
|
|
||||||
toggled => {
|
|
||||||
SystemPageData.cb_kbd_leds_awake(SystemPageData.kbd_leds_awake)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if SystemPageData.kbd_leds_sleep != -1: SystemToggleInt {
|
|
||||||
text: @tr("Keyboard Sleep Effect");
|
|
||||||
checked_int <=> SystemPageData.kbd_leds_sleep;
|
|
||||||
toggled => {
|
|
||||||
SystemPageData.cb_kbd_leds_sleep(SystemPageData.kbd_leds_sleep)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if SystemPageData.kbd_leds_boot != -1: SystemToggleInt {
|
|
||||||
text: @tr("Keyboard Boot Effect");
|
|
||||||
checked_int <=> SystemPageData.kbd_leds_boot;
|
|
||||||
toggled => {
|
|
||||||
SystemPageData.cb_kbd_leds_boot(SystemPageData.kbd_leds_boot)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if SystemPageData.kbd_leds_shutdown != -1: SystemToggleInt {
|
|
||||||
text: @tr("Keyboard Shutdown Effect");
|
|
||||||
checked_int <=> SystemPageData.kbd_leds_shutdown;
|
|
||||||
toggled => {
|
|
||||||
SystemPageData.cb_kbd_leds_shutdown(SystemPageData.kbd_leds_shutdown)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
background: Palette.alternate-background;
|
background: Palette.alternate-background;
|
||||||
border-color: Palette.border;
|
border-color: Palette.border;
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ component SideBarItem inherits Rectangle {
|
|||||||
export component SideBar inherits Rectangle {
|
export component SideBar inherits Rectangle {
|
||||||
in property <[string]> model: [];
|
in property <[string]> model: [];
|
||||||
in property <[bool]> available: [];
|
in property <[bool]> available: [];
|
||||||
|
in property <bool> is_tuf: false;
|
||||||
out property <int> current-item: 0;
|
out property <int> current-item: 0;
|
||||||
out property <int> current-focused: fs.has-focus ? fs.focused-tab : -1;
|
out property <int> current-focused: fs.has-focus ? fs.focused-tab : -1;
|
||||||
|
|
||||||
@@ -99,6 +100,9 @@ export component SideBar inherits Rectangle {
|
|||||||
|
|
||||||
Image {
|
Image {
|
||||||
height: 100px;
|
height: 100px;
|
||||||
|
// TODO: change if TUF on the logo in the menu on the main page
|
||||||
|
// If running on a TUF model, replace the ROG red with TUF orange
|
||||||
|
// (add data/tuf-control-center.png and switch here when available)
|
||||||
source: @image-url("../../data/rog-control-center.png");
|
source: @image-url("../../data/rog-control-center.png");
|
||||||
horizontal-alignment: center;
|
horizontal-alignment: center;
|
||||||
image-fit: contain;
|
image-fit: contain;
|
||||||
|
|||||||
@@ -257,7 +257,6 @@ impl FirmwareAttributes {
|
|||||||
pub enum FirmwareAttributeType {
|
pub enum FirmwareAttributeType {
|
||||||
#[default]
|
#[default]
|
||||||
Immediate,
|
Immediate,
|
||||||
TUFKeyboard,
|
|
||||||
Ppt,
|
Ppt,
|
||||||
Gpu,
|
Gpu,
|
||||||
Bios,
|
Bios,
|
||||||
@@ -346,11 +345,6 @@ define_attribute_getters!(
|
|||||||
panel_hd_mode: Immediate,
|
panel_hd_mode: Immediate,
|
||||||
panel_od: Immediate,
|
panel_od: Immediate,
|
||||||
|
|
||||||
kbd_leds_awake: TUFKeyboard,
|
|
||||||
kbd_leds_sleep: TUFKeyboard,
|
|
||||||
kbd_leds_boot: TUFKeyboard,
|
|
||||||
kbd_leds_shutdown: TUFKeyboard,
|
|
||||||
|
|
||||||
charge_mode: Immediate,
|
charge_mode: Immediate,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -400,10 +394,6 @@ pub enum FirmwareAttribute {
|
|||||||
PptEnabled = 24,
|
PptEnabled = 24,
|
||||||
None = 25,
|
None = 25,
|
||||||
ScreenAutoBrightness = 26,
|
ScreenAutoBrightness = 26,
|
||||||
KbdLedsAwake = 27,
|
|
||||||
KbdLedsSleep = 28,
|
|
||||||
KbdLedsBoot = 29,
|
|
||||||
KbdLedsShutdown = 30,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<&str> for FirmwareAttribute {
|
impl From<&str> for FirmwareAttribute {
|
||||||
@@ -425,10 +415,6 @@ impl From<&str> for FirmwareAttribute {
|
|||||||
"nv_tgp" => Self::DgpuTgp,
|
"nv_tgp" => Self::DgpuTgp,
|
||||||
"charge_mode" => Self::ChargeMode,
|
"charge_mode" => Self::ChargeMode,
|
||||||
"boot_sound" => Self::BootSound,
|
"boot_sound" => Self::BootSound,
|
||||||
"kbd_leds_awake" => Self::KbdLedsAwake,
|
|
||||||
"kbd_leds_sleep" => Self::KbdLedsSleep,
|
|
||||||
"kbd_leds_boot" => Self::KbdLedsBoot,
|
|
||||||
"kbd_leds_shutdown" => Self::KbdLedsShutdown,
|
|
||||||
"mcu_powersave" => Self::McuPowersave,
|
"mcu_powersave" => Self::McuPowersave,
|
||||||
"panel_overdrive" => Self::PanelOverdrive,
|
"panel_overdrive" => Self::PanelOverdrive,
|
||||||
"panel_hd_mode" => Self::PanelHdMode,
|
"panel_hd_mode" => Self::PanelHdMode,
|
||||||
@@ -474,10 +460,6 @@ impl From<FirmwareAttribute> for &str {
|
|||||||
FirmwareAttribute::DgpuDisable => "dgpu_disable",
|
FirmwareAttribute::DgpuDisable => "dgpu_disable",
|
||||||
FirmwareAttribute::GpuMuxMode => "gpu_mux_mode",
|
FirmwareAttribute::GpuMuxMode => "gpu_mux_mode",
|
||||||
FirmwareAttribute::MiniLedMode => "mini_led_mode",
|
FirmwareAttribute::MiniLedMode => "mini_led_mode",
|
||||||
FirmwareAttribute::KbdLedsAwake => "kbd_leds_awake",
|
|
||||||
FirmwareAttribute::KbdLedsSleep => "kbd_leds_sleep",
|
|
||||||
FirmwareAttribute::KbdLedsBoot => "kbd_leds_boot",
|
|
||||||
FirmwareAttribute::KbdLedsShutdown => "kbd_leds_shutdown",
|
|
||||||
FirmwareAttribute::PendingReboot => "pending_reboot",
|
FirmwareAttribute::PendingReboot => "pending_reboot",
|
||||||
FirmwareAttribute::ScreenAutoBrightness => "screen_auto_brightness",
|
FirmwareAttribute::ScreenAutoBrightness => "screen_auto_brightness",
|
||||||
FirmwareAttribute::None => "none",
|
FirmwareAttribute::None => "none",
|
||||||
|
|||||||
Reference in New Issue
Block a user