mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Begin implmenting keyboard power states
This commit is contained in:
@@ -5,14 +5,16 @@ import { SideBar } from "widgets/sidebar.slint";
|
||||
import { PageAbout } from "pages/about.slint";
|
||||
import { PageFans } from "pages/fans.slint";
|
||||
import { PageAnime, AnimePageData } from "pages/anime.slint";
|
||||
import { PageAura, AuraPageData, AuraEffect } from "pages/aura.slint";
|
||||
import { PageAura } from "pages/aura.slint";
|
||||
import { AuraPageData, AuraDevType, AuraDevTuf, AuraDevRog1, PowerZones, KbAuraPowerState, AuraPowerDev, AuraEffect } from "types/aura_types.slint";
|
||||
export { AuraPageData, AuraDevType, AuraDevTuf, AuraDevRog1, PowerZones, KbAuraPowerState, AuraPowerDev, AuraEffect }
|
||||
import { PageAppSettings, AppSettingsPageData } from "pages/app_settings.slint";
|
||||
|
||||
export { AppSize, AuraEffect, Theme, AvailableSystemProperties, SystemPageData, AuraPageData, AnimePageData, AppSettingsPageData }
|
||||
export { AppSize, Theme, AvailableSystemProperties, SystemPageData, AnimePageData, AppSettingsPageData }
|
||||
|
||||
export component MainWindow inherits Window {
|
||||
default-font-family: "DejaVu Sans";
|
||||
in property <[bool]> sidebar_items_avilable: [true, true, true, true, true, true];
|
||||
in property <[bool]> sidebar_items_avilable: [true, true, false, true, true, true];
|
||||
private property <bool> show-notif;
|
||||
private property <bool> fade-cover;
|
||||
private property <bool> toast: false;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ValueBar } from "../common_widgets.slint";
|
||||
import { ValueBar } from "../widgets/common.slint";
|
||||
import { Theme } from "../globals.slint";
|
||||
import { AboutSlint } from "std-widgets.slint";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Theme } from "../globals.slint";
|
||||
import { SystemDropdown, SystemToggle } from "../common_widgets.slint";
|
||||
import { SystemDropdown, SystemToggle } from "../widgets/common.slint";
|
||||
import { GroupBox, VerticalBox, Button, HorizontalBox } from "std-widgets.slint";
|
||||
|
||||
export global AnimePageData {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Theme } from "../globals.slint";
|
||||
import { SystemToggle } from "../common_widgets.slint";
|
||||
import { SystemToggle } from "../widgets/common.slint";
|
||||
|
||||
export global AppSettingsPageData {
|
||||
in-out property <bool> run_in_background;
|
||||
|
||||
@@ -1,270 +1,457 @@
|
||||
import { SystemDropdown, RogItem } from "../common_widgets.slint";
|
||||
import { SystemDropdown, RogItem, SystemToggle, SystemToggleVert } from "../widgets/common.slint";
|
||||
import { Button, ComboBox, VerticalBox, GroupBox } from "std-widgets.slint";
|
||||
import { StyleMetrics, Slider, HorizontalBox, TextEdit, SpinBox, LineEdit } from "std-widgets.slint";
|
||||
import { StyleMetrics, Slider, HorizontalBox, TextEdit, SpinBox, LineEdit, ScrollView } from "std-widgets.slint";
|
||||
import { ColorPicker, 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 struct AuraEffect {
|
||||
/// The effect type
|
||||
mode: int,
|
||||
/// `AuraZone::None` for no zone or zoneless keyboards
|
||||
zone: int,
|
||||
/// Primary colour for all modes
|
||||
colour1: color,
|
||||
/// Secondary colour in some modes like Breathing or Stars
|
||||
colour2: color,
|
||||
/// One of three speeds for modes that support speed (most that animate)
|
||||
speed: int,
|
||||
/// Up, down, left, right. Only Rainbow mode seems to use this
|
||||
direction: int,
|
||||
}
|
||||
export component PageAura inherits Rectangle {
|
||||
property <bool> show_fade_cover: false;
|
||||
property <bool> show_aura_power: false;
|
||||
|
||||
export global AuraPageData {
|
||||
in-out property <[string]> brightness_names: [
|
||||
@tr("Aura brightness" => "Off"),
|
||||
@tr("Aura brightness" => "Low"),
|
||||
@tr("Aura brightness" => "Med"),
|
||||
@tr("Aura brightness" => "High"),
|
||||
];
|
||||
in-out property <int> brightness;
|
||||
callback set_brightness(int);
|
||||
in-out property <[string]> mode_names: [
|
||||
@tr("Basic aura mode" => "Static"),
|
||||
@tr("Basic aura mode" => "Breathe"),
|
||||
@tr("Basic aura mode" => "Strobe"),
|
||||
@tr("Basic aura mode" => "Rainbow"),
|
||||
@tr("Basic aura mode" => "Star"),
|
||||
@tr("Basic aura mode" => "Rain"),
|
||||
@tr("Basic aura mode" => "Highlight"),
|
||||
@tr("Basic aura mode" => "Laser"),
|
||||
@tr("Basic aura mode" => "Ripple"),
|
||||
@tr("Basic aura mode" => "Nothing"),
|
||||
@tr("Basic aura mode" => "Pulse"),
|
||||
@tr("Basic aura mode" => "Comet"),
|
||||
@tr("Basic aura mode" => "Flash"),
|
||||
];
|
||||
in-out property <[string]> available_mode_names: [
|
||||
@tr("Basic aura mode" => "Static"),
|
||||
@tr("Basic aura mode" => "Breathe"),
|
||||
@tr("Basic aura mode" => "Strobe"),
|
||||
];
|
||||
in-out property <int> current_available_mode: 0;
|
||||
in-out property <[int]> supported_basic_modes: [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12];
|
||||
in-out property <int> led_mode;
|
||||
callback set_led_mode(int);
|
||||
in-out property <[string]> zone_names: [
|
||||
@tr("Aura zone" => "None"),
|
||||
@tr("Aura zone" => "Key1"),
|
||||
@tr("Aura zone" => "Key2"),
|
||||
@tr("Aura zone" => "Key3"),
|
||||
@tr("Aura zone" => "Key4"),
|
||||
@tr("Aura zone" => "Logo"),
|
||||
@tr("Aura zone" => "Lightbar Left"),
|
||||
@tr("Aura zone" => "Lightbar Right"),
|
||||
];
|
||||
in-out property <int> zone;
|
||||
in-out property <[string]> direction_names: [
|
||||
@tr("Aura direction" => "Right"),
|
||||
@tr("Aura direction" => "Left"),
|
||||
@tr("Aura direction" => "Up"),
|
||||
@tr("Aura direction" => "Down"),
|
||||
];
|
||||
in-out property <int> direction;
|
||||
in-out property <[string]> speed_names: [
|
||||
@tr("Aura speed" => "Low"),
|
||||
@tr("Aura speed" => "Medium"),
|
||||
@tr("Aura speed" => "High"),
|
||||
];
|
||||
in-out property <int> speed;
|
||||
in-out property <AuraEffect> led_mode_data: {
|
||||
mode: 0,
|
||||
zone: 0,
|
||||
colour1: Colors.aquamarine,
|
||||
colourbox1: Colors.aquamarine,
|
||||
colour2: Colors.hotpink,
|
||||
colourbox2: Colors.hotpink,
|
||||
speed: 0,
|
||||
direction: 0,
|
||||
};
|
||||
callback set_led_mode_data(AuraEffect);
|
||||
in-out property <color> color1;
|
||||
in-out property <brush> colorbox1;
|
||||
in-out property <color> color2;
|
||||
in-out property <brush> colorbox2;
|
||||
callback update_led_mode_data(AuraEffect);
|
||||
update_led_mode_data(data) => {
|
||||
led_mode_data = data;
|
||||
current_available_mode = data.mode;
|
||||
zone = data.zone;
|
||||
speed = data.speed;
|
||||
direction = data.direction;
|
||||
color1 = data.colour1;
|
||||
color2 = data.colour2;
|
||||
colorbox1 = data.colour1;
|
||||
colorbox2 = data.colour2;
|
||||
}
|
||||
callback set_hex_from_colour(color) -> string;
|
||||
callback set_hex_to_colour(string) -> color;
|
||||
}
|
||||
|
||||
export component PageAura inherits VerticalLayout {
|
||||
padding: 10px;
|
||||
spacing: 10px;
|
||||
alignment: LayoutAlignment.start;
|
||||
callback external_colour_change();
|
||||
external_colour_change() => {
|
||||
c1.colourbox = AuraPageData.led_mode_data.colour1;
|
||||
c1.final_colour = AuraPageData.led_mode_data.colour1;
|
||||
c1.external_colour_change();
|
||||
|
||||
c2.colourbox = AuraPageData.led_mode_data.colour2;
|
||||
c2.final_colour = AuraPageData.led_mode_data.colour2;
|
||||
c2.external_colour_change();
|
||||
}
|
||||
|
||||
HorizontalLayout {
|
||||
VerticalLayout {
|
||||
padding: 10px;
|
||||
spacing: 10px;
|
||||
SystemDropdown {
|
||||
text: @tr("Brightness");
|
||||
current_index <=> AuraPageData.brightness;
|
||||
current_value: AuraPageData.brightness_names[self.current-index];
|
||||
model <=> AuraPageData.brightness_names;
|
||||
selected => {
|
||||
AuraPageData.set_brightness(AuraPageData.brightness)
|
||||
}
|
||||
}
|
||||
alignment: LayoutAlignment.start;
|
||||
|
||||
SystemDropdown {
|
||||
width: parent.width * 1px / 2px;
|
||||
text: @tr("Aura mode");
|
||||
current_index <=> AuraPageData.current_available_mode;
|
||||
current_value: AuraPageData.available_mode_names[self.current-index];
|
||||
model <=> AuraPageData.available_mode_names;
|
||||
selected => {
|
||||
AuraPageData.led_mode_data.mode = AuraPageData.current_available_mode;
|
||||
self.current_value = AuraPageData.available_mode_names[self.current-index];
|
||||
AuraPageData.set_led_mode(AuraPageData.current_available_mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RogItem {
|
||||
HorizontalLayout {
|
||||
spacing: 10px;
|
||||
VerticalBox {
|
||||
Text {
|
||||
text: @tr("Colour 1");
|
||||
vertical-alignment: TextVerticalAlignment.center;
|
||||
horizontal-alignment: TextHorizontalAlignment.center;
|
||||
SystemDropdown {
|
||||
text: @tr("Brightness");
|
||||
current_index <=> AuraPageData.brightness;
|
||||
current_value: AuraPageData.brightness_names[self.current-index];
|
||||
model <=> AuraPageData.brightness_names;
|
||||
selected => {
|
||||
AuraPageData.set_brightness(AuraPageData.brightness)
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalBox {
|
||||
c1:= ColourSlider {
|
||||
final_colour <=> AuraPageData.color1;
|
||||
SystemDropdown {
|
||||
width: parent.width * 1px / 2px;
|
||||
text: @tr("Aura mode");
|
||||
current_index <=> AuraPageData.current_available_mode;
|
||||
current_value: AuraPageData.available_mode_names[self.current-index];
|
||||
model <=> AuraPageData.available_mode_names;
|
||||
selected => {
|
||||
AuraPageData.led_mode_data.mode = AuraPageData.current_available_mode;
|
||||
self.current_value = AuraPageData.available_mode_names[self.current-index];
|
||||
AuraPageData.set_led_mode(AuraPageData.current_available_mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RogItem {
|
||||
HorizontalLayout {
|
||||
spacing: 10px;
|
||||
VerticalBox {
|
||||
Text {
|
||||
text: @tr("Colour 1");
|
||||
vertical-alignment: TextVerticalAlignment.center;
|
||||
horizontal-alignment: TextHorizontalAlignment.center;
|
||||
}
|
||||
|
||||
HorizontalBox {
|
||||
c1 := ColourSlider {
|
||||
final_colour <=> AuraPageData.color1;
|
||||
colourbox <=> AuraPageData.colorbox1;
|
||||
set_hex_from_colour(c1) => {
|
||||
return AuraPageData.set_hex_from_colour(c1);
|
||||
}
|
||||
hex_to_colour(s) => {
|
||||
return AuraPageData.set_hex_to_colour(s);
|
||||
return AuraPageData.set_hex_from_colour(c1);
|
||||
}
|
||||
hex_to_colour(s) => {
|
||||
return AuraPageData.set_hex_to_colour(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VerticalBox {
|
||||
Text {
|
||||
text: @tr("Colour 2");
|
||||
vertical-alignment: TextVerticalAlignment.center;
|
||||
horizontal-alignment: TextHorizontalAlignment.center;
|
||||
}
|
||||
VerticalBox {
|
||||
Text {
|
||||
text: @tr("Colour 2");
|
||||
vertical-alignment: TextVerticalAlignment.center;
|
||||
horizontal-alignment: TextHorizontalAlignment.center;
|
||||
}
|
||||
|
||||
HorizontalBox {
|
||||
c2:= ColourSlider {
|
||||
final_colour <=> AuraPageData.color2;
|
||||
HorizontalBox {
|
||||
c2 := ColourSlider {
|
||||
final_colour <=> AuraPageData.color2;
|
||||
colourbox <=> AuraPageData.colorbox2;
|
||||
set_hex_from_colour(c1) => {
|
||||
return AuraPageData.set_hex_from_colour(c1);
|
||||
}
|
||||
hex_to_colour(s) => {
|
||||
return AuraPageData.set_hex_to_colour(s);
|
||||
return AuraPageData.set_hex_from_colour(c1);
|
||||
}
|
||||
hex_to_colour(s) => {
|
||||
return AuraPageData.set_hex_to_colour(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLayout {
|
||||
spacing: 10px;
|
||||
RogItem {
|
||||
padding: 0px;
|
||||
VerticalBox {
|
||||
Text {
|
||||
text: @tr("Zone");
|
||||
vertical-alignment: TextVerticalAlignment.center;
|
||||
horizontal-alignment: TextHorizontalAlignment.center;
|
||||
}
|
||||
HorizontalLayout {
|
||||
spacing: 10px;
|
||||
RogItem {
|
||||
padding: 0px;
|
||||
VerticalBox {
|
||||
Text {
|
||||
text: @tr("Zone");
|
||||
vertical-alignment: TextVerticalAlignment.center;
|
||||
horizontal-alignment: TextHorizontalAlignment.center;
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
current_index <=> AuraPageData.zone;
|
||||
ComboBox {
|
||||
current_index <=> AuraPageData.zone;
|
||||
current_value: AuraPageData.zone_names[self.current-index];
|
||||
model <=> AuraPageData.zone_names;
|
||||
model <=> AuraPageData.zone_names;
|
||||
selected => {
|
||||
AuraPageData.led_mode_data.zone = self.current-index;
|
||||
AuraPageData.led_mode_data.zone = self.current-index;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RogItem {
|
||||
padding: 0px;
|
||||
VerticalBox {
|
||||
Text {
|
||||
text: @tr("Direction");
|
||||
vertical-alignment: TextVerticalAlignment.center;
|
||||
horizontal-alignment: TextHorizontalAlignment.center;
|
||||
}
|
||||
RogItem {
|
||||
padding: 0px;
|
||||
VerticalBox {
|
||||
Text {
|
||||
text: @tr("Direction");
|
||||
vertical-alignment: TextVerticalAlignment.center;
|
||||
horizontal-alignment: TextHorizontalAlignment.center;
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
current_index <=> AuraPageData.direction;
|
||||
ComboBox {
|
||||
current_index <=> AuraPageData.direction;
|
||||
current_value: AuraPageData.direction_names[self.current-index];
|
||||
model <=> AuraPageData.direction_names;
|
||||
model <=> AuraPageData.direction_names;
|
||||
selected => {
|
||||
AuraPageData.led_mode_data.direction = self.current-index;
|
||||
AuraPageData.led_mode_data.direction = self.current-index;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RogItem {
|
||||
padding: 0px;
|
||||
VerticalBox {
|
||||
Text {
|
||||
text: @tr("Speed");
|
||||
vertical-alignment: TextVerticalAlignment.center;
|
||||
horizontal-alignment: TextHorizontalAlignment.center;
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
current_index <=> AuraPageData.speed;
|
||||
current_value: AuraPageData.speed_names[self.current-index];
|
||||
model <=> AuraPageData.speed_names;
|
||||
selected => {
|
||||
AuraPageData.led_mode_data.speed = self.current-index;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RogItem {
|
||||
padding: 0px;
|
||||
VerticalBox {
|
||||
Text {
|
||||
text: @tr("Speed");
|
||||
vertical-alignment: TextVerticalAlignment.center;
|
||||
horizontal-alignment: TextHorizontalAlignment.center;
|
||||
HorizontalBox {
|
||||
Button {
|
||||
text: @tr("Power Settings");
|
||||
clicked => {
|
||||
root.show_fade_cover = true;
|
||||
root.show_aura_power = true;
|
||||
debug(AuraPageData.led_power);
|
||||
debug(AuraPageData.supported_power_zones);
|
||||
}
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
current_index <=> AuraPageData.speed;
|
||||
current_value: AuraPageData.speed_names[self.current-index];
|
||||
model <=> AuraPageData.speed_names;
|
||||
selected => {
|
||||
AuraPageData.led_mode_data.speed = self.current-index;
|
||||
}
|
||||
Button {
|
||||
text: @tr("Apply Aura");
|
||||
clicked => {
|
||||
AuraPageData.led_mode_data.mode = AuraPageData.led_mode;
|
||||
AuraPageData.led_mode_data.colour1 = AuraPageData.color1;
|
||||
AuraPageData.led_mode_data.colour2 = AuraPageData.color2;
|
||||
AuraPageData.set_led_mode_data(AuraPageData.led_mode_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: @tr("Apply");
|
||||
clicked => {
|
||||
AuraPageData.led_mode_data.mode = AuraPageData.led_mode;
|
||||
AuraPageData.led_mode_data.colour1 = AuraPageData.color1;
|
||||
AuraPageData.led_mode_data.colour2 = AuraPageData.color2;
|
||||
AuraPageData.set_led_mode_data(AuraPageData.led_mode_data);
|
||||
if root.show_fade_cover: Rectangle {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: Theme.background-color;
|
||||
opacity: 0.8;
|
||||
TouchArea {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
if root.show_aura_power && AuraPageData.aura_type == AuraDevType.New: Rectangle {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 1;
|
||||
ScrollView {
|
||||
VerticalLayout {
|
||||
padding: 30px;
|
||||
padding-top: 10px;
|
||||
spacing: 10px;
|
||||
for power in AuraPageData.supported_power_zones: gr:= HorizontalLayout {
|
||||
if power == PowerZones.Keyboard: zone1:= AuraPowerGroup {
|
||||
title: @tr("Keyboard");
|
||||
boot_checked: AuraPageData.led_power.rog.keyboard.boot;
|
||||
boot_toggled => {
|
||||
AuraPageData.led_power.rog.keyboard.boot = zone1.boot_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
awake_checked: AuraPageData.led_power.rog.keyboard.awake;
|
||||
awake_toggled => {
|
||||
AuraPageData.led_power.rog.keyboard.awake = zone1.awake_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
sleep_checked: AuraPageData.led_power.rog.keyboard.sleep;
|
||||
sleep_toggled => {
|
||||
AuraPageData.led_power.rog.keyboard.sleep = zone1.sleep_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
shutdown_checked: AuraPageData.led_power.rog.keyboard.shutdown;
|
||||
shutdown_toggled => {
|
||||
AuraPageData.led_power.rog.keyboard.shutdown = zone1.shutdown_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
}
|
||||
if power == PowerZones.Logo: zone2:= AuraPowerGroup {
|
||||
title: @tr("Lid Logo");
|
||||
boot_checked: AuraPageData.led_power.rog.logo.boot;
|
||||
boot_toggled => {
|
||||
AuraPageData.led_power.rog.logo.boot = zone2.boot_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
awake_checked: AuraPageData.led_power.rog.logo.awake;
|
||||
awake_toggled => {
|
||||
AuraPageData.led_power.rog.logo.awake = zone2.awake_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
sleep_checked: AuraPageData.led_power.rog.logo.sleep;
|
||||
sleep_toggled => {
|
||||
AuraPageData.led_power.rog.logo.sleep = zone2.sleep_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
shutdown_checked: AuraPageData.led_power.rog.logo.shutdown;
|
||||
shutdown_toggled => {
|
||||
AuraPageData.led_power.rog.logo.shutdown = zone2.shutdown_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
}
|
||||
if power == PowerZones.Lightbar: zone3:= AuraPowerGroup {
|
||||
title: @tr("Lightbar");
|
||||
boot_checked: AuraPageData.led_power.rog.lightbar.boot;
|
||||
boot_toggled => {
|
||||
AuraPageData.led_power.rog.lightbar.boot = zone3.boot_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
awake_checked: AuraPageData.led_power.rog.lightbar.awake;
|
||||
awake_toggled => {
|
||||
AuraPageData.led_power.rog.lightbar.awake = zone3.awake_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
sleep_checked: AuraPageData.led_power.rog.lightbar.sleep;
|
||||
sleep_toggled => {
|
||||
AuraPageData.led_power.rog.lightbar.sleep = zone3.sleep_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
shutdown_checked: AuraPageData.led_power.rog.lightbar.shutdown;
|
||||
shutdown_toggled => {
|
||||
AuraPageData.led_power.rog.lightbar.shutdown = zone3.shutdown_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
}
|
||||
if power == PowerZones.Lid: zone4:= AuraPowerGroup {
|
||||
title: @tr("Lid Zone");
|
||||
boot_checked: AuraPageData.led_power.rog.lid.boot;
|
||||
boot_toggled => {
|
||||
AuraPageData.led_power.rog.lid.boot = zone4.boot_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
awake_checked: AuraPageData.led_power.rog.lid.awake;
|
||||
awake_toggled => {
|
||||
AuraPageData.led_power.rog.lid.awake = zone4.awake_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
sleep_checked: AuraPageData.led_power.rog.lid.sleep;
|
||||
sleep_toggled => {
|
||||
AuraPageData.led_power.rog.lid.sleep = zone4.sleep_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
shutdown_checked: AuraPageData.led_power.rog.lid.shutdown;
|
||||
shutdown_toggled => {
|
||||
AuraPageData.led_power.rog.lid.shutdown = zone4.shutdown_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
}
|
||||
if power == PowerZones.RearGlow: zone5:= AuraPowerGroup {
|
||||
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;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
awake_checked: AuraPageData.led_power.rog.rear-glow.awake;
|
||||
awake_toggled => {
|
||||
AuraPageData.led_power.rog.rear-glow.awake = zone5.awake_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
sleep_checked: AuraPageData.led_power.rog.rear-glow.sleep;
|
||||
sleep_toggled => {
|
||||
AuraPageData.led_power.rog.rear-glow.sleep = zone5.sleep_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
shutdown_checked: AuraPageData.led_power.rog.rear-glow.shutdown;
|
||||
shutdown_toggled => {
|
||||
AuraPageData.led_power.rog.rear-glow.shutdown = zone5.shutdown_checked;
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
x: root.width - self.width - 6px;
|
||||
y: 6px;
|
||||
text: "X";
|
||||
height: 40px;
|
||||
clicked => {
|
||||
root.show_aura_power = false;
|
||||
root.show_fade_cover = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if root.show_aura_power && AuraPageData.aura_type == AuraDevType.Old: Rectangle {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 1;
|
||||
ScrollView {
|
||||
VerticalLayout {
|
||||
padding: 30px;
|
||||
padding-top: 10px;
|
||||
spacing: 10px;
|
||||
Rectangle {
|
||||
border-radius: 20px;
|
||||
background: Theme.window-background;
|
||||
VerticalBox {
|
||||
spacing: 10px;
|
||||
alignment: LayoutAlignment.start;
|
||||
Text {
|
||||
font-size: 18px;
|
||||
color: Theme.text-foreground-color;
|
||||
horizontal-alignment: TextHorizontalAlignment.center;
|
||||
text: @tr("Keyboard");
|
||||
}
|
||||
|
||||
HorizontalBox {
|
||||
SystemToggleVert {
|
||||
max-height: 42px;
|
||||
text: @tr("Boot");
|
||||
}
|
||||
|
||||
SystemToggleVert {
|
||||
max-height: 42px;
|
||||
text: @tr("Awake");
|
||||
}
|
||||
|
||||
SystemToggleVert {
|
||||
max-height: 42px;
|
||||
text: @tr("Sleep");
|
||||
}
|
||||
|
||||
SystemToggleVert {
|
||||
max-height: 42px;
|
||||
text: @tr("Shutdown");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
x: root.width - self.width - 6px;
|
||||
y: 6px;
|
||||
text: "X";
|
||||
height: 40px;
|
||||
clicked => {
|
||||
root.show_aura_power = false;
|
||||
root.show_fade_cover = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if root.show_aura_power && AuraPageData.aura_type == AuraDevType.Tuf: Rectangle {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
opacity: 1;
|
||||
ScrollView {
|
||||
VerticalLayout {
|
||||
padding: 30px;
|
||||
padding-top: 10px;
|
||||
spacing: 10px;
|
||||
Rectangle {
|
||||
border-radius: 20px;
|
||||
background: Theme.window-background;
|
||||
VerticalBox {
|
||||
spacing: 10px;
|
||||
alignment: LayoutAlignment.start;
|
||||
Text {
|
||||
font-size: 18px;
|
||||
color: Theme.text-foreground-color;
|
||||
horizontal-alignment: TextHorizontalAlignment.center;
|
||||
text: @tr("Keyboard");
|
||||
}
|
||||
|
||||
HorizontalBox {
|
||||
SystemToggleVert {
|
||||
max-height: 42px;
|
||||
text: @tr("Boot");
|
||||
}
|
||||
|
||||
SystemToggleVert {
|
||||
max-height: 42px;
|
||||
text: @tr("Awake");
|
||||
}
|
||||
|
||||
SystemToggleVert {
|
||||
max-height: 42px;
|
||||
text: @tr("Sleep");
|
||||
}
|
||||
|
||||
SystemToggleVert {
|
||||
max-height: 42px;
|
||||
text: @tr("Shutdown");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
x: root.width - self.width - 6px;
|
||||
y: 6px;
|
||||
text: "X";
|
||||
height: 40px;
|
||||
clicked => {
|
||||
root.show_aura_power = false;
|
||||
root.show_fade_cover = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SystemSlider, SystemDropdown, SystemToggle } from "../common_widgets.slint";
|
||||
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";
|
||||
|
||||
|
||||
158
rog-control-center/ui/types/aura_types.slint
Normal file
158
rog-control-center/ui/types/aura_types.slint
Normal file
@@ -0,0 +1,158 @@
|
||||
export enum AuraDevType {
|
||||
Tuf,
|
||||
Old,
|
||||
New,
|
||||
}
|
||||
|
||||
export struct AuraEffect {
|
||||
/// The effect type
|
||||
mode: int,
|
||||
/// `AuraZone::None` for no zone or zoneless keyboards
|
||||
zone: int,
|
||||
/// Primary colour for all modes
|
||||
colour1: color,
|
||||
/// Secondary colour in some modes like Breathing or Stars
|
||||
colour2: color,
|
||||
/// One of three speeds for modes that support speed (most that animate)
|
||||
speed: int,
|
||||
/// Up, down, left, right. Only Rainbow mode seems to use this
|
||||
direction: int,
|
||||
}
|
||||
|
||||
export enum AuraDevTuf {
|
||||
Boot,
|
||||
Awake,
|
||||
Sleep,
|
||||
Keyboard,
|
||||
}
|
||||
|
||||
export enum AuraDevRog1 {
|
||||
Awake,
|
||||
Keyboard,
|
||||
Lightbar,
|
||||
Boot,
|
||||
Sleep,
|
||||
}
|
||||
|
||||
export enum PowerZones {
|
||||
Logo,
|
||||
Keyboard,
|
||||
Lightbar,
|
||||
Lid,
|
||||
RearGlow,
|
||||
}
|
||||
|
||||
export struct KbAuraPowerState {
|
||||
zone: PowerZones,
|
||||
boot: bool,
|
||||
awake: bool,
|
||||
sleep: bool,
|
||||
shutdown: bool,
|
||||
}
|
||||
|
||||
export struct AuraPower {
|
||||
keyboard: KbAuraPowerState,
|
||||
logo: KbAuraPowerState,
|
||||
lightbar: KbAuraPowerState,
|
||||
lid: KbAuraPowerState,
|
||||
rear_glow: KbAuraPowerState,
|
||||
}
|
||||
|
||||
export struct AuraPowerDev {
|
||||
tuf: [AuraDevTuf],
|
||||
old_rog: [AuraDevRog1],
|
||||
rog: AuraPower,
|
||||
}
|
||||
|
||||
export global AuraPageData {
|
||||
in-out property <[string]> brightness_names: [
|
||||
@tr("Aura brightness" => "Off"),
|
||||
@tr("Aura brightness" => "Low"),
|
||||
@tr("Aura brightness" => "Med"),
|
||||
@tr("Aura brightness" => "High"),
|
||||
];
|
||||
in-out property <int> brightness;
|
||||
callback set_brightness(int);
|
||||
in-out property <[string]> mode_names: [
|
||||
@tr("Basic aura mode" => "Static"),
|
||||
@tr("Basic aura mode" => "Breathe"),
|
||||
@tr("Basic aura mode" => "Strobe"),
|
||||
@tr("Basic aura mode" => "Rainbow"),
|
||||
@tr("Basic aura mode" => "Star"),
|
||||
@tr("Basic aura mode" => "Rain"),
|
||||
@tr("Basic aura mode" => "Highlight"),
|
||||
@tr("Basic aura mode" => "Laser"),
|
||||
@tr("Basic aura mode" => "Ripple"),
|
||||
@tr("Basic aura mode" => "Nothing"),
|
||||
@tr("Basic aura mode" => "Pulse"),
|
||||
@tr("Basic aura mode" => "Comet"),
|
||||
@tr("Basic aura mode" => "Flash"),
|
||||
];
|
||||
in-out property <[string]> available_mode_names: [
|
||||
@tr("Basic aura mode" => "Static"),
|
||||
@tr("Basic aura mode" => "Breathe"),
|
||||
@tr("Basic aura mode" => "Strobe"),
|
||||
];
|
||||
in-out property <int> current_available_mode: 0;
|
||||
in-out property <[int]> supported_basic_modes: [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12];
|
||||
in-out property <int> led_mode;
|
||||
callback set_led_mode(int);
|
||||
in-out property <[string]> zone_names: [
|
||||
@tr("Aura zone" => "None"),
|
||||
@tr("Aura zone" => "Key1"),
|
||||
@tr("Aura zone" => "Key2"),
|
||||
@tr("Aura zone" => "Key3"),
|
||||
@tr("Aura zone" => "Key4"),
|
||||
@tr("Aura zone" => "Logo"),
|
||||
@tr("Aura zone" => "Lightbar Left"),
|
||||
@tr("Aura zone" => "Lightbar Right"),
|
||||
];
|
||||
in-out property <int> zone;
|
||||
in-out property <[string]> direction_names: [
|
||||
@tr("Aura direction" => "Right"),
|
||||
@tr("Aura direction" => "Left"),
|
||||
@tr("Aura direction" => "Up"),
|
||||
@tr("Aura direction" => "Down"),
|
||||
];
|
||||
in-out property <int> direction;
|
||||
in-out property <[string]> speed_names: [
|
||||
@tr("Aura speed" => "Low"),
|
||||
@tr("Aura speed" => "Medium"),
|
||||
@tr("Aura speed" => "High"),
|
||||
];
|
||||
in-out property <int> speed;
|
||||
in-out property <AuraEffect> led_mode_data: {
|
||||
mode: 0,
|
||||
zone: 0,
|
||||
colour1: Colors.aquamarine,
|
||||
colourbox1: Colors.aquamarine,
|
||||
colour2: Colors.hotpink,
|
||||
colourbox2: Colors.hotpink,
|
||||
speed: 0,
|
||||
direction: 0,
|
||||
};
|
||||
callback set_led_mode_data(AuraEffect);
|
||||
in-out property <color> color1;
|
||||
in-out property <brush> colorbox1;
|
||||
in-out property <color> color2;
|
||||
in-out property <brush> colorbox2;
|
||||
callback update_led_mode_data(AuraEffect);
|
||||
update_led_mode_data(data) => {
|
||||
led_mode_data = data;
|
||||
current_available_mode = data.mode;
|
||||
zone = data.zone;
|
||||
speed = data.speed;
|
||||
direction = data.direction;
|
||||
color1 = data.colour1;
|
||||
color2 = data.colour2;
|
||||
colorbox1 = data.colour1;
|
||||
colorbox2 = data.colour2;
|
||||
}
|
||||
callback set_hex_from_colour(color) -> string;
|
||||
callback set_hex_to_colour(string) -> color;
|
||||
|
||||
in-out property <AuraDevType> aura_type: AuraDevType.New;
|
||||
in-out property <[PowerZones]> supported_power_zones: [PowerZones.Keyboard, PowerZones.RearGlow, PowerZones.Lid, PowerZones.Lightbar, PowerZones.Logo];
|
||||
in-out property <AuraPowerDev> led_power;
|
||||
callback set_led_power(AuraPowerDev);
|
||||
}
|
||||
67
rog-control-center/ui/widgets/aura_power.slint
Normal file
67
rog-control-center/ui/widgets/aura_power.slint
Normal file
@@ -0,0 +1,67 @@
|
||||
import { VerticalBox, HorizontalBox } from "std-widgets.slint";
|
||||
import { SystemToggleVert } from "common.slint";
|
||||
import { Theme } from "../globals.slint";
|
||||
|
||||
export component AuraPowerGroup inherits Rectangle {
|
||||
border-radius: 20px;
|
||||
background: Theme.window-background;
|
||||
|
||||
in-out property <string> title;
|
||||
in-out property <bool> boot_checked;
|
||||
in-out property <bool> awake_checked;
|
||||
in-out property <bool> sleep_checked;
|
||||
in-out property <bool> shutdown_checked;
|
||||
callback boot_toggled(bool);
|
||||
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;
|
||||
horizontal-alignment: TextHorizontalAlignment.center;
|
||||
text <=> root.title;
|
||||
}
|
||||
|
||||
HorizontalBox {
|
||||
SystemToggleVert {
|
||||
max-height: 42px;
|
||||
text: @tr("Boot");
|
||||
checked <=> root.boot_checked;
|
||||
toggled => {
|
||||
root.boot_toggled(self.checked);
|
||||
}
|
||||
}
|
||||
|
||||
SystemToggleVert {
|
||||
max-height: 42px;
|
||||
text: @tr("Awake");
|
||||
checked <=> root.awake_checked;
|
||||
toggled => {
|
||||
root.awake_toggled(self.checked);
|
||||
}
|
||||
}
|
||||
|
||||
SystemToggleVert {
|
||||
max-height: 42px;
|
||||
text: @tr("Sleep");
|
||||
checked <=> root.sleep_checked;
|
||||
toggled => {
|
||||
root.sleep_toggled(self.checked);
|
||||
}
|
||||
}
|
||||
|
||||
SystemToggleVert {
|
||||
max-height: 42px;
|
||||
text: @tr("Shutdown");
|
||||
checked <=> root.shutdown_checked;
|
||||
toggled => {
|
||||
root.shutdown_toggled(self.checked);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,19 +13,43 @@ export component ColourSlider inherits VerticalLayout {
|
||||
in-out property <float> c1value<=> c1.value;
|
||||
in-out property <float> c2value<=> c2.value;
|
||||
property <[color]> base_colours: [
|
||||
Colors.rgb( 255, 0, 0),
|
||||
Colors.rgb( 255, 128, 0),
|
||||
Colors.rgb( 255, 255, 0),
|
||||
Colors.rgb( 128, 255, 0),
|
||||
Colors.rgb( 0, 255, 0),
|
||||
Colors.rgb( 0, 255, 128),
|
||||
Colors.rgb( 0, 255, 255),
|
||||
Colors.rgb( 0, 128, 255),
|
||||
Colors.rgb( 0, 0, 255),
|
||||
Colors.rgb( 127, 0, 255),
|
||||
Colors.rgb( 255, 0, 255),
|
||||
Colors.rgb( 255, 0, 127),
|
||||
Colors.rgb( 128, 128, 128)
|
||||
hsv(0, 1, 1),
|
||||
hsv(10, 1, 1),
|
||||
hsv(20, 1, 1),
|
||||
hsv(30, 1, 1),
|
||||
hsv(40, 1, 1),
|
||||
hsv(50, 1, 1),
|
||||
hsv(60, 1, 1),
|
||||
hsv(70, 1, 1),
|
||||
hsv(80, 1, 1),
|
||||
hsv(90, 1, 1),
|
||||
hsv(100, 1, 1),
|
||||
hsv(110, 1, 1),
|
||||
hsv(120, 1, 1),
|
||||
hsv(130, 1, 1),
|
||||
hsv(140, 1, 1),
|
||||
hsv(150, 1, 1),
|
||||
hsv(160, 1, 1),
|
||||
hsv(170, 1, 1),
|
||||
hsv(180, 1, 1),
|
||||
hsv(190, 1, 1),
|
||||
hsv(200, 1, 1),
|
||||
hsv(210, 1, 1),
|
||||
hsv(220, 1, 1),
|
||||
hsv(230, 1, 1),
|
||||
hsv(240, 1, 1),
|
||||
hsv(250, 1, 1),
|
||||
hsv(260, 1, 1),
|
||||
hsv(270, 1, 1),
|
||||
hsv(280, 1, 1),
|
||||
hsv(290, 1, 1),
|
||||
hsv(300, 1, 1),
|
||||
hsv(310, 1, 1),
|
||||
hsv(320, 1, 1),
|
||||
hsv(330, 1, 1),
|
||||
hsv(340, 1, 1),
|
||||
hsv(350, 1, 1),
|
||||
hsv(360, 1, 1),
|
||||
];
|
||||
property <[color]> base_shade: [
|
||||
blend_lightness(base_colour, 1.0),
|
||||
@@ -42,15 +66,13 @@ export component ColourSlider inherits VerticalLayout {
|
||||
];
|
||||
|
||||
function blend_lightness(c1: color, f: float) -> color {
|
||||
rgb(c1.red() * f, c1.green() * f, c1.blue() * f)
|
||||
}
|
||||
|
||||
rgb(c1.red * f, c1.green * f, c1.blue * f)
|
||||
}
|
||||
function set_base_colour() {
|
||||
root.base_colour = base_colours[c1.value].linear-blend(base_colours[c1.value + 1], c1.value - Math.floor(c1.value));
|
||||
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;
|
||||
}
|
||||
callback external_colour_change();
|
||||
}callback external_colour_change();
|
||||
external_colour_change => {
|
||||
if (root.final_colour.hue() < 0) {
|
||||
c1.value = (root.base_colours.length - 1) * ((root.final_colour.hue() + 360) / 360);
|
||||
@@ -64,14 +86,15 @@ export component ColourSlider inherits VerticalLayout {
|
||||
Rectangle {
|
||||
height: 32px;
|
||||
// 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]);
|
||||
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;
|
||||
minimum: 0;
|
||||
maximum: root.base_colours.length - 1; // One less than the array length
|
||||
maximum: root.base_colours.length - 1;
|
||||
// One less than the array length
|
||||
changed => {
|
||||
set_base_colour();
|
||||
hex = set_hex_from_colour(final_colour);
|
||||
@@ -110,7 +133,6 @@ export component ColourSlider inherits VerticalLayout {
|
||||
Rectangle {
|
||||
width: self.height;
|
||||
background <=> root.colourbox;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { VerticalBox , StandardButton, Button, HorizontalBox, ComboBox, Switch, Slider} from "std-widgets.slint";
|
||||
import { Theme } from "globals.slint";
|
||||
import { Theme } from "../globals.slint";
|
||||
|
||||
export component RogItem inherits Rectangle {
|
||||
background: Theme.background-color;
|
||||
@@ -76,6 +76,36 @@ export component SystemToggle inherits RogItem {
|
||||
}
|
||||
}
|
||||
|
||||
export component SystemToggleVert inherits RogItem {
|
||||
in property <string> text;
|
||||
in-out property <bool> checked;
|
||||
callback toggled(bool);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalBox {
|
||||
alignment: LayoutAlignment.center;
|
||||
padding: 10px;
|
||||
Switch {
|
||||
checked <=> root.checked;
|
||||
toggled => {
|
||||
root.toggled(root.checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export component SystemDropdown inherits RogItem {
|
||||
in property <string> text;
|
||||
in-out property <int> current_index;
|
||||
@@ -4,11 +4,13 @@
|
||||
import { StyleMetrics } from "std-widgets.slint";
|
||||
|
||||
component SideBarItem inherits Rectangle {
|
||||
padding: 10px;
|
||||
in property <bool> selected;
|
||||
in property <bool> has-focus;
|
||||
in-out property <string> text<=> label.text;
|
||||
callback clicked<=>touch.clicked;
|
||||
min-height: self.visible ? l.preferred-height : 0px;
|
||||
min-height: self.visible ? l.preferred-height + 10px : 0px;
|
||||
// min-width: self.visible ? l.preferred-width + 10px : 0px;
|
||||
states [
|
||||
pressed when touch.pressed: {
|
||||
state.opacity: 0.8;
|
||||
@@ -30,6 +32,7 @@ component SideBarItem inherits Rectangle {
|
||||
background: StyleMetrics.window-background;
|
||||
animate opacity { duration: 150ms; }
|
||||
animate border-width { duration: 150ms; }
|
||||
height: l.preferred-height;
|
||||
}
|
||||
|
||||
l := HorizontalLayout {
|
||||
@@ -102,7 +105,7 @@ export component SideBar inherits Rectangle {
|
||||
}
|
||||
|
||||
navigation := VerticalLayout {
|
||||
spacing: 10px;
|
||||
// spacing: 10px;
|
||||
alignment: start;
|
||||
vertical-stretch: 0;
|
||||
for item[index] in root.model: SideBarItem {
|
||||
|
||||
Reference in New Issue
Block a user