ROGCC: fix PPT sliders

This commit is contained in:
Luke Jones
2025-03-02 20:39:16 +13:00
parent f7bf7aeef9
commit b4d657b866
3 changed files with 56 additions and 64 deletions

View File

@@ -6,6 +6,8 @@
### Changed ### Changed
- Testing CI for opensuse RPM build - Testing CI for opensuse RPM build
- ROGCC: Fixes to showing the PPT enablement toggle
- ROGCC: Fixes to how PPT and NV sliders work and enable/disable
## [v6.1.7] ## [v6.1.7]

View File

@@ -284,9 +284,9 @@ export component PageSystem inherits Rectangle {
cb_do_reset => { cb_do_reset => {
SystemPageData.cb_default_ppt_pl1_spl(); SystemPageData.cb_default_ppt_pl1_spl();
} }
released => { released(value) => {
SystemPageData.ppt_pl1_spl.current = self.value; SystemPageData.ppt_pl1_spl.current = Math.round(value);
SystemPageData.cb_ppt_pl1_spl(Math.round(self.value)); SystemPageData.cb_ppt_pl1_spl(Math.round(value));
} }
} }
@@ -302,9 +302,9 @@ export component PageSystem inherits Rectangle {
cb_do_reset => { cb_do_reset => {
SystemPageData.cb_default_ppt_pl2_sppt(); SystemPageData.cb_default_ppt_pl2_sppt();
} }
released => { released(value) => {
SystemPageData.ppt_pl2_sppt.current = self.value; SystemPageData.ppt_pl2_sppt.current = Math.round(value);
SystemPageData.cb_ppt_pl2_sppt(Math.round(self.value)) SystemPageData.cb_ppt_pl2_sppt(Math.round(value));
} }
} }
@@ -320,9 +320,9 @@ export component PageSystem inherits Rectangle {
cb_do_reset => { cb_do_reset => {
SystemPageData.cb_default_ppt_pl3_fppt(); SystemPageData.cb_default_ppt_pl3_fppt();
} }
released => { released(value) => {
SystemPageData.ppt_pl3_fppt.current = self.value; SystemPageData.ppt_pl3_fppt.current = Math.round(value);
SystemPageData.cb_ppt_pl3_fppt(Math.round(self.value)) SystemPageData.cb_ppt_pl3_fppt(Math.round(value));
} }
} }
if SystemPageData.ppt_fppt.current != -1: SystemSlider { if SystemPageData.ppt_fppt.current != -1: SystemSlider {
@@ -337,9 +337,9 @@ export component PageSystem inherits Rectangle {
cb_do_reset => { cb_do_reset => {
SystemPageData.cb_default_ppt_fppt(); SystemPageData.cb_default_ppt_fppt();
} }
released => { released(value) => {
SystemPageData.ppt_fppt.current = self.value; SystemPageData.ppt_fppt.current = Math.round(value);
SystemPageData.cb_ppt_fppt(Math.round(self.value)) SystemPageData.cb_ppt_fppt(Math.round(value));
} }
} }
@@ -355,9 +355,9 @@ export component PageSystem inherits Rectangle {
cb_do_reset => { cb_do_reset => {
SystemPageData.cb_default_ppt_apu_sppt(); SystemPageData.cb_default_ppt_apu_sppt();
} }
released => { released(value) => {
SystemPageData.ppt_apu_sppt.current = self.value; SystemPageData.ppt_apu_sppt.current = Math.round(value);
SystemPageData.cb_ppt_apu_sppt(Math.round(self.value)) SystemPageData.cb_ppt_apu_sppt(Math.round(value));
} }
} }
@@ -373,9 +373,9 @@ export component PageSystem inherits Rectangle {
cb_do_reset => { cb_do_reset => {
SystemPageData.cb_default_ppt_platform_sppt(); SystemPageData.cb_default_ppt_platform_sppt();
} }
released => { released(value) => {
SystemPageData.ppt_platform_sppt.current = self.value; SystemPageData.ppt_platform_sppt.current = Math.round(value);
SystemPageData.cb_ppt_platform_sppt(Math.round(self.value)) SystemPageData.cb_ppt_platform_sppt(Math.round(value));
} }
} }
@@ -391,9 +391,9 @@ export component PageSystem inherits Rectangle {
cb_do_reset => { cb_do_reset => {
SystemPageData.cb_default_nv_dynamic_boost(); SystemPageData.cb_default_nv_dynamic_boost();
} }
released => { released(value) => {
SystemPageData.nv_dynamic_boost.current = self.value; SystemPageData.nv_dynamic_boost.current = Math.round(value);
SystemPageData.cb_nv_dynamic_boost(Math.round(self.value)) SystemPageData.cb_nv_dynamic_boost(Math.round(value));
} }
} }
@@ -409,9 +409,9 @@ export component PageSystem inherits Rectangle {
cb_do_reset => { cb_do_reset => {
SystemPageData.cb_default_nv_temp_target(); SystemPageData.cb_default_nv_temp_target();
} }
released => { released(value) => {
SystemPageData.nv_temp_target.current = self.value; SystemPageData.nv_temp_target.current = Math.round(value);
SystemPageData.cb_nv_temp_target(Math.round(self.value)) SystemPageData.cb_nv_temp_target(Math.round(value));
} }
} }
} }

View File

@@ -12,14 +12,14 @@ export component RogItem inherits Rectangle {
export component SystemSlider inherits RogItem { export component SystemSlider inherits RogItem {
in property <string> title; in property <string> title;
in property <string> text; in property <string> text;
in-out property <bool> enabled: true;
in-out property <float> value; in-out property <float> value;
in-out property <float> minimum; in property <float> minimum;
in-out property <float> maximum; in property <float> maximum;
callback released(int); callback released(float);
in-out property <string> help_text; in property <string> help_text;
in-out property <bool> has_reset: false; in property <bool> enabled: true;
in property <bool> has_reset: false;
callback cb_do_reset(); callback cb_do_reset();
HorizontalLayout { HorizontalLayout {
@@ -27,44 +27,34 @@ export component SystemSlider inherits RogItem {
width: 40%; width: 40%;
alignment: LayoutAlignment.stretch; alignment: LayoutAlignment.stretch;
padding-left: 10px; padding-left: 10px;
TouchArea { HorizontalLayout {
enabled <=> root.enabled; spacing: 6px;
clicked => { Text {
slider.value += 1; font-size: 16px;
if slider.value > slider.maximum { vertical-alignment: TextVerticalAlignment.center;
slider.value = slider.minimum; color: Palette.control-foreground;
} text: root.text;
} }
HorizontalLayout {
spacing: 6px;
Text {
font-size: 16px;
vertical-alignment: TextVerticalAlignment.center;
color: Palette.control-foreground;
text <=> root.text;
}
Text { Text {
font-size: 16px; font-size: 16px;
horizontal-alignment: TextHorizontalAlignment.right; horizontal-alignment: TextHorizontalAlignment.right;
vertical-alignment: TextVerticalAlignment.center; vertical-alignment: TextVerticalAlignment.center;
color: Palette.control-foreground; color: Palette.control-foreground;
text: "\{Math.round(root.value)}"; text: "\{Math.round(root.value)}";
}
} }
} }
} }
HorizontalBox { HorizontalBox {
// alignment: LayoutAlignment.end;
padding-right: 20px; padding-right: 20px;
slider := Slider { slider := Slider {
enabled <=> root.enabled; enabled: root.enabled;
maximum: root.maximum; maximum: root.maximum;
minimum: root.minimum; minimum: root.minimum;
value <=> root.value; value <=> root.value;
released => { released(value) => {
root.released(Math.round(root.value)) root.released(value)
} }
} }
} }
@@ -79,14 +69,14 @@ export component SystemSlider inherits RogItem {
border-color: Palette.accent-background; border-color: Palette.accent-background;
background: Palette.background; background: Palette.background;
Dialog { Dialog {
title <=> root.title; title: root.title;
VerticalBox { VerticalBox {
Text { Text {
max-width: 420px; max-width: 420px;
font-size: 18px; font-size: 18px;
wrap: TextWrap.word-wrap; wrap: TextWrap.word-wrap;
horizontal-alignment: TextHorizontalAlignment.center; horizontal-alignment: TextHorizontalAlignment.center;
text <=> root.title; text: root.title;
} }
Rectangle { Rectangle {
@@ -99,7 +89,7 @@ export component SystemSlider inherits RogItem {
max-width: 420px; max-width: 420px;
font-size: 16px; font-size: 16px;
wrap: TextWrap.word-wrap; wrap: TextWrap.word-wrap;
text <=> root.help_text; text: root.help_text;
} }
} }
@@ -153,7 +143,7 @@ export component SystemSlider inherits RogItem {
reset := HorizontalBox { reset := HorizontalBox {
if (has_reset): StandardButton { if (has_reset): StandardButton {
kind: StandardButtonKind.reset; kind: StandardButtonKind.reset;
enabled <=> root.enabled; enabled: root.enabled;
clicked => { clicked => {
reset_popup.show(); reset_popup.show();
} }
@@ -175,7 +165,7 @@ export component SystemToggle inherits RogItem {
font-size: 16px; font-size: 16px;
vertical-alignment: TextVerticalAlignment.center; vertical-alignment: TextVerticalAlignment.center;
color: Palette.control-foreground; color: Palette.control-foreground;
text <=> root.text; text: root.text;
} }
} }
@@ -206,7 +196,7 @@ export component SystemToggleInt inherits RogItem {
font-size: 16px; font-size: 16px;
vertical-alignment: TextVerticalAlignment.center; vertical-alignment: TextVerticalAlignment.center;
color: Palette.control-foreground; color: Palette.control-foreground;
text <=> root.text; text: root.text;
} }
} }
@@ -237,7 +227,7 @@ export component SystemToggleVert inherits RogItem {
vertical-alignment: TextVerticalAlignment.bottom; vertical-alignment: TextVerticalAlignment.bottom;
horizontal-alignment: TextHorizontalAlignment.center; horizontal-alignment: TextHorizontalAlignment.center;
color: Palette.control-foreground; color: Palette.control-foreground;
text <=> root.text; text: root.text;
} }
HorizontalLayout { HorizontalLayout {
@@ -267,7 +257,7 @@ export component SystemDropdown inherits RogItem {
font-size: 16px; font-size: 16px;
vertical-alignment: TextVerticalAlignment.center; vertical-alignment: TextVerticalAlignment.center;
color: Palette.control-foreground; color: Palette.control-foreground;
text <=> root.text; text: root.text;
} }
} }