Clean up debug info

This commit is contained in:
Luke D. Jones
2024-03-09 23:30:15 +13:00
parent ca41bd59de
commit b0da062577
5 changed files with 60 additions and 214 deletions

View File

@@ -173,7 +173,7 @@ pub fn init_tray(
.with_icon(rog_red.clone())
.with_tooltip(TRAY_LABEL)
.with_menu(build_menu())
.build(|event| do_action(event))
.build(do_action)
.unwrap();
info!("Started ROGTray");
loop {

View File

@@ -251,12 +251,12 @@ impl From<SlintAuraPowerDev> for rog_aura::usb::AuraPowerDev {
let tuf: Vec<rog_aura::usb::AuraDevTuf> = value
.tuf
.iter()
.map(|n| rog_aura::usb::AuraDevTuf::from(n))
.map(rog_aura::usb::AuraDevTuf::from)
.collect();
let old_rog: Vec<rog_aura::usb::AuraDevRog1> = value
.old_rog
.iter()
.map(|n| rog_aura::usb::AuraDevRog1::from(n))
.map(rog_aura::usb::AuraDevRog1::from)
.collect();
Self {
tuf,
@@ -608,7 +608,6 @@ fn decode_hex(s: &str) -> RgbaColor<u8> {
red: *c.first().unwrap_or(&255),
green: *c.get(1).unwrap_or(&128),
blue: *c.get(2).unwrap_or(&32),
..Default::default()
}
}
@@ -720,7 +719,7 @@ fn setup_aura_page(ui: &MainWindow, _states: Arc<Mutex<Config>>) {
"Anime builtin animations changed".into(),
"Failed to set Anime builtin animations".into(),
handle_copy,
proxy_copy.set_led_power(power.into()).await,
proxy_copy.set_led_power(power).await,
);
});
});

View File

@@ -2,7 +2,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-03-09 08:00+0000\n"
"POT-Creation-Date: 2024-03-09 10:26+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -157,96 +157,96 @@ msgctxt "PageAppSettings"
msgid "Enable change notifications"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:29
#: rog-control-center/ui/pages/aura.slint:30
msgctxt "PageAura"
msgid "Brightness"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:40
#: rog-control-center/ui/pages/aura.slint:41
msgctxt "PageAura"
msgid "Aura mode"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:57
#: rog-control-center/ui/pages/aura.slint:58
msgctxt "PageAura"
msgid "Colour 1"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:78
#: rog-control-center/ui/pages/aura.slint:79
msgctxt "PageAura"
msgid "Colour 2"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:105
#: rog-control-center/ui/pages/aura.slint:106
msgctxt "PageAura"
msgid "Zone"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:125
#: rog-control-center/ui/pages/aura.slint:126
msgctxt "PageAura"
msgid "Direction"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:145
#: rog-control-center/ui/pages/aura.slint:146
msgctxt "PageAura"
msgid "Speed"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:164
#: rog-control-center/ui/pages/aura.slint:165
msgctxt "PageAura"
msgid "Power Settings"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:172
#: rog-control-center/ui/pages/aura.slint:173
msgctxt "PageAura"
msgid "Apply Aura"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:213 rog-control-center/ui/pages/aura.slint:421 rog-control-center/ui/pages/aura.slint:481
#: rog-control-center/ui/pages/aura.slint:206 rog-control-center/ui/pages/aura.slint:355 rog-control-center/ui/pages/aura.slint:415
msgctxt "PageAura"
msgid "Keyboard"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:219 rog-control-center/ui/pages/aura.slint:256 rog-control-center/ui/pages/aura.slint:293 rog-control-center/ui/pages/aura.slint:330 rog-control-center/ui/pages/aura.slint:367 rog-control-center/ui/pages/aura.slint:427 rog-control-center/ui/pages/aura.slint:487
msgctxt "PageAura"
msgid "Boot"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:224 rog-control-center/ui/pages/aura.slint:261 rog-control-center/ui/pages/aura.slint:298 rog-control-center/ui/pages/aura.slint:335 rog-control-center/ui/pages/aura.slint:372 rog-control-center/ui/pages/aura.slint:432 rog-control-center/ui/pages/aura.slint:492
msgctxt "PageAura"
msgid "Awake"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:229 rog-control-center/ui/pages/aura.slint:266 rog-control-center/ui/pages/aura.slint:303 rog-control-center/ui/pages/aura.slint:340 rog-control-center/ui/pages/aura.slint:377 rog-control-center/ui/pages/aura.slint:437 rog-control-center/ui/pages/aura.slint:497
msgctxt "PageAura"
msgid "Sleep"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:234 rog-control-center/ui/pages/aura.slint:271 rog-control-center/ui/pages/aura.slint:308 rog-control-center/ui/pages/aura.slint:345 rog-control-center/ui/pages/aura.slint:382 rog-control-center/ui/pages/aura.slint:442 rog-control-center/ui/pages/aura.slint:502
msgctxt "PageAura"
msgid "Shutdown"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:250
#: rog-control-center/ui/pages/aura.slint:229
msgctxt "PageAura"
msgid "Lid Logo"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:287
#: rog-control-center/ui/pages/aura.slint:252
msgctxt "PageAura"
msgid "Lightbar"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:324
#: rog-control-center/ui/pages/aura.slint:275
msgctxt "PageAura"
msgid "Lid Zone"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:361
#: rog-control-center/ui/pages/aura.slint:298
msgctxt "PageAura"
msgid "Rear Glow"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:361 rog-control-center/ui/pages/aura.slint:421
msgctxt "PageAura"
msgid "Boot"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:366 rog-control-center/ui/pages/aura.slint:426
msgctxt "PageAura"
msgid "Awake"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:371 rog-control-center/ui/pages/aura.slint:431
msgctxt "PageAura"
msgid "Sleep"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:376 rog-control-center/ui/pages/aura.slint:436
msgctxt "PageAura"
msgid "Shutdown"
msgstr ""
#: rog-control-center/ui/pages/system.slint:26
msgctxt "SystemPageData"
msgid "Balanced"
@@ -392,6 +392,26 @@ msgctxt "PageSystem"
msgid "Throttle Policy on AC"
msgstr ""
#: rog-control-center/ui/widgets/aura_power.slint:32
msgctxt "AuraPowerGroup"
msgid "Boot"
msgstr ""
#: rog-control-center/ui/widgets/aura_power.slint:41
msgctxt "AuraPowerGroup"
msgid "Awake"
msgstr ""
#: rog-control-center/ui/widgets/aura_power.slint:50
msgctxt "AuraPowerGroup"
msgid "Sleep"
msgstr ""
#: rog-control-center/ui/widgets/aura_power.slint:59
msgctxt "AuraPowerGroup"
msgid "Shutdown"
msgstr ""
#: rog-control-center/ui/main_window.slint:45
msgctxt "MainWindow"
msgid "ROG"

View File

@@ -1,7 +1,7 @@
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, ScrollView } from "std-widgets.slint";
import { ColorPicker, ColourSlider } from "../widgets/colour_picker.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";
@@ -166,8 +166,6 @@ export component PageAura inherits Rectangle {
clicked => {
root.show_fade_cover = true;
root.show_aura_power = true;
debug(AuraPageData.led_power);
debug(AuraPageData.supported_power_zones);
}
}

View File

@@ -136,174 +136,3 @@ export component ColourSlider inherits VerticalLayout {
}
}
}
component ColorButton {
callback select<=>i_touch_area.clicked;
in property <brush> color<=> i_container.background;
in property <bool> selected;
height: self.width;
i_container := Rectangle {
border_width: 2px;
}
i_touch_area := TouchArea { }
states [
selected when selected: {
i_container.border_color: Colors.black;
}
]
}
export component ColorPicker {
height: palette.length * 1px / colors_per_row / 1px * color_size;
private property <int> selected_color_index;
in-out property <float> colors_per_row: 13.0;
private property <length> color_size: self.width / colors_per_row;
out property <color> selected_color: palette[selected_color_index];
callback selected(color);
in property <[color]> palette: [
Colors.rgb(51,0,0),
Colors.rgb(51,25,0),
Colors.rgb(51,51,0),
Colors.rgb(25,51,0),
Colors.rgb(0,51,0),
Colors.rgb(0,51,25),
Colors.rgb(0,51,51),
Colors.rgb(0,25,51),
Colors.rgb(0,0,51),
Colors.rgb(25,0,51),
Colors.rgb(51,0,51),
Colors.rgb(51,0,25),
Colors.rgb(0,0,0),
//
Colors.rgb(102,0,0),
Colors.rgb(102,51,0),
Colors.rgb(102,102,0),
Colors.rgb(51,102,0),
Colors.rgb(0,102,0),
Colors.rgb(0,102,51),
Colors.rgb(0,102,102),
Colors.rgb(0,51,102),
Colors.rgb(0,0,102),
Colors.rgb(51,0,102),
Colors.rgb(102,0,102),
Colors.rgb(102,0,51),
Colors.rgb(32,32,32),
//
Colors.rgb(153,0,0),
Colors.rgb(153,76,0),
Colors.rgb(153,153,0),
Colors.rgb(76,153,0),
Colors.rgb(0,153,0),
Colors.rgb(0,153,76),
Colors.rgb(0,153,153),
Colors.rgb(0,76,153),
Colors.rgb(0,0,153),
Colors.rgb(76,0,153),
Colors.rgb(153,0,153),
Colors.rgb(153,0,76),
Colors.rgb(64,64,64),
//
Colors.rgb(204,0,0),
Colors.rgb(204,102,0),
Colors.rgb(204,204,0),
Colors.rgb(102,204,0),
Colors.rgb(0,204,0),
Colors.rgb(0,204,102),
Colors.rgb(0,204,204),
Colors.rgb(0,102,204),
Colors.rgb(0,0,204),
Colors.rgb(102,0,204),
Colors.rgb(204,0,204),
Colors.rgb(204,0,102),
Colors.rgb(96,96,96),
//
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(128,0,255),
Colors.rgb(255,0,255),
Colors.rgb(255,0,128),
Colors.rgb(128,128,128),
//
Colors.rgb(255,51,51),
Colors.rgb(255,153,51),
Colors.rgb(255,255,51),
Colors.rgb(153,255,51),
Colors.rgb(51,255,51),
Colors.rgb(51,255,153),
Colors.rgb(51,255,255),
Colors.rgb(51,153,255),
Colors.rgb(51,51,255),
Colors.rgb(153,51,255),
Colors.rgb(255,51,255),
Colors.rgb(255,51,153),
Colors.rgb(160,160,160),
//
Colors.rgb(255,102,102),
Colors.rgb(255,178,102),
Colors.rgb(255,255,102),
Colors.rgb(178,255,102),
Colors.rgb(102,255,102),
Colors.rgb(102,255,178),
Colors.rgb(102,255,255),
Colors.rgb(102,178,255),
Colors.rgb(102,102,255),
Colors.rgb(178,102,255),
Colors.rgb(255,102,255),
Colors.rgb(255,102,178),
Colors.rgb(192,192,192),
//
Colors.rgb(255,153,153),
Colors.rgb(255,204,153),
Colors.rgb(255,255,153),
Colors.rgb(204,255,153),
Colors.rgb(153,255,153),
Colors.rgb(153,255,204),
Colors.rgb(153,255,255),
Colors.rgb(153,204,255),
Colors.rgb(153,153,255),
Colors.rgb(204,153,255),
Colors.rgb(255,153,255),
Colors.rgb(255,153,204),
Colors.rgb(224,224,224),
//
Colors.rgb(255,204,204),
Colors.rgb(255,229,204),
Colors.rgb(255,255,204),
Colors.rgb(229,255,204),
Colors.rgb(204,255,204),
Colors.rgb(204,255,229),
Colors.rgb(204,255,255),
Colors.rgb(204,229,255),
Colors.rgb(204,204,255),
Colors.rgb(229,204,255),
Colors.rgb(255,204,255),
Colors.rgb(255,204,229),
Colors.rgb(224,224,224),
];
Rectangle {
border_width: 1px;
border_color: Colors.black;
for color[index] in palette: ColorButton {
x: color_size * mod(index, colors_per_row);
y: color_size * floor(index / colors_per_row);
width: color_size;
color: color;
selected: index == selected_color_index;
select => {
selected_color_index = index;
// debug(Math.mod(selected_color_index, colors_per_row)); // X pos
// debug(Math.floor(selected_color_index / colors_per_row)); // Y pos
return selected(Math.mod(selected_color_index, colors_per_row) == colors_per_row - 1 ? Colors.rgb(255 / (palette.length / colors_per_row - 1) * Math.floor(selected_color_index / colors_per_row),0,0) : selected_color);
}
}
}
}