mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
feat: support TUF lighting power
This commit is contained in:
@@ -35,6 +35,8 @@ export component MainWindow inherits Window {
|
||||
true, // About
|
||||
];
|
||||
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> toast: false;
|
||||
private property <string> toast_text: "I show when something is waiting";
|
||||
@@ -80,6 +82,7 @@ export component MainWindow inherits Window {
|
||||
@tr("Menu7" => "About"),
|
||||
];
|
||||
available: root.sidebar_items_avilable;
|
||||
is_tuf: root.is_tuf;
|
||||
}
|
||||
|
||||
Button {
|
||||
|
||||
@@ -252,6 +252,60 @@ export component PageAura inherits Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
// TUF devices: show the same configurable power groups as `New`, since
|
||||
// `setup_aura` fills `AuraPageData.supported_power_zones` and `led_power`
|
||||
// appropriately for TUF devices. This ensures the Power Settings panel
|
||||
// reflects what the firmware reports for TUF models.
|
||||
if root.show_aura_power && AuraPageData.device_type == AuraDevType.Tuf: Rectangle {
|
||||
background: Palette.background;
|
||||
width: 100%;
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
x: root.width - self.width - 6px;
|
||||
y: 6px;
|
||||
text: "✕";
|
||||
height: 36px;
|
||||
clicked => {
|
||||
root.show_aura_power = false;
|
||||
root.show_fade_cover = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if root.show_aura_power && AuraPageData.device_type == AuraDevType.Old: Rectangle {
|
||||
background: Palette.background;
|
||||
width: 100%;
|
||||
|
||||
@@ -52,6 +52,7 @@ component SideBarItem inherits Rectangle {
|
||||
export component SideBar inherits Rectangle {
|
||||
in property <[string]> model: [];
|
||||
in property <[bool]> available: [];
|
||||
in property <bool> is_tuf: false;
|
||||
out property <int> current-item: 0;
|
||||
out property <int> current-focused: fs.has-focus ? fs.focused-tab : -1;
|
||||
|
||||
@@ -99,6 +100,9 @@ export component SideBar inherits Rectangle {
|
||||
|
||||
Image {
|
||||
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");
|
||||
horizontal-alignment: center;
|
||||
image-fit: contain;
|
||||
|
||||
Reference in New Issue
Block a user