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
- 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]

View File

@@ -284,9 +284,9 @@ export component PageSystem inherits Rectangle {
cb_do_reset => {
SystemPageData.cb_default_ppt_pl1_spl();
}
released => {
SystemPageData.ppt_pl1_spl.current = self.value;
SystemPageData.cb_ppt_pl1_spl(Math.round(self.value));
released(value) => {
SystemPageData.ppt_pl1_spl.current = Math.round(value);
SystemPageData.cb_ppt_pl1_spl(Math.round(value));
}
}
@@ -302,9 +302,9 @@ export component PageSystem inherits Rectangle {
cb_do_reset => {
SystemPageData.cb_default_ppt_pl2_sppt();
}
released => {
SystemPageData.ppt_pl2_sppt.current = self.value;
SystemPageData.cb_ppt_pl2_sppt(Math.round(self.value))
released(value) => {
SystemPageData.ppt_pl2_sppt.current = Math.round(value);
SystemPageData.cb_ppt_pl2_sppt(Math.round(value));
}
}
@@ -320,9 +320,9 @@ export component PageSystem inherits Rectangle {
cb_do_reset => {
SystemPageData.cb_default_ppt_pl3_fppt();
}
released => {
SystemPageData.ppt_pl3_fppt.current = self.value;
SystemPageData.cb_ppt_pl3_fppt(Math.round(self.value))
released(value) => {
SystemPageData.ppt_pl3_fppt.current = Math.round(value);
SystemPageData.cb_ppt_pl3_fppt(Math.round(value));
}
}
if SystemPageData.ppt_fppt.current != -1: SystemSlider {
@@ -337,9 +337,9 @@ export component PageSystem inherits Rectangle {
cb_do_reset => {
SystemPageData.cb_default_ppt_fppt();
}
released => {
SystemPageData.ppt_fppt.current = self.value;
SystemPageData.cb_ppt_fppt(Math.round(self.value))
released(value) => {
SystemPageData.ppt_fppt.current = Math.round(value);
SystemPageData.cb_ppt_fppt(Math.round(value));
}
}
@@ -355,9 +355,9 @@ export component PageSystem inherits Rectangle {
cb_do_reset => {
SystemPageData.cb_default_ppt_apu_sppt();
}
released => {
SystemPageData.ppt_apu_sppt.current = self.value;
SystemPageData.cb_ppt_apu_sppt(Math.round(self.value))
released(value) => {
SystemPageData.ppt_apu_sppt.current = Math.round(value);
SystemPageData.cb_ppt_apu_sppt(Math.round(value));
}
}
@@ -373,9 +373,9 @@ export component PageSystem inherits Rectangle {
cb_do_reset => {
SystemPageData.cb_default_ppt_platform_sppt();
}
released => {
SystemPageData.ppt_platform_sppt.current = self.value;
SystemPageData.cb_ppt_platform_sppt(Math.round(self.value))
released(value) => {
SystemPageData.ppt_platform_sppt.current = Math.round(value);
SystemPageData.cb_ppt_platform_sppt(Math.round(value));
}
}
@@ -391,9 +391,9 @@ export component PageSystem inherits Rectangle {
cb_do_reset => {
SystemPageData.cb_default_nv_dynamic_boost();
}
released => {
SystemPageData.nv_dynamic_boost.current = self.value;
SystemPageData.cb_nv_dynamic_boost(Math.round(self.value))
released(value) => {
SystemPageData.nv_dynamic_boost.current = Math.round(value);
SystemPageData.cb_nv_dynamic_boost(Math.round(value));
}
}
@@ -409,9 +409,9 @@ export component PageSystem inherits Rectangle {
cb_do_reset => {
SystemPageData.cb_default_nv_temp_target();
}
released => {
SystemPageData.nv_temp_target.current = self.value;
SystemPageData.cb_nv_temp_target(Math.round(self.value))
released(value) => {
SystemPageData.nv_temp_target.current = Math.round(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 {
in property <string> title;
in property <string> text;
in-out property <bool> enabled: true;
in-out property <float> value;
in-out property <float> minimum;
in-out property <float> maximum;
callback released(int);
in property <float> minimum;
in property <float> maximum;
callback released(float);
in-out property <string> help_text;
in-out property <bool> has_reset: false;
in property <string> help_text;
in property <bool> enabled: true;
in property <bool> has_reset: false;
callback cb_do_reset();
HorizontalLayout {
@@ -27,44 +27,34 @@ export component SystemSlider inherits RogItem {
width: 40%;
alignment: LayoutAlignment.stretch;
padding-left: 10px;
TouchArea {
enabled <=> root.enabled;
clicked => {
slider.value += 1;
if slider.value > slider.maximum {
slider.value = slider.minimum;
}
HorizontalLayout {
spacing: 6px;
Text {
font-size: 16px;
vertical-alignment: TextVerticalAlignment.center;
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 {
font-size: 16px;
horizontal-alignment: TextHorizontalAlignment.right;
vertical-alignment: TextVerticalAlignment.center;
color: Palette.control-foreground;
text: "\{Math.round(root.value)}";
}
Text {
font-size: 16px;
horizontal-alignment: TextHorizontalAlignment.right;
vertical-alignment: TextVerticalAlignment.center;
color: Palette.control-foreground;
text: "\{Math.round(root.value)}";
}
}
}
HorizontalBox {
// alignment: LayoutAlignment.end;
padding-right: 20px;
slider := Slider {
enabled <=> root.enabled;
enabled: root.enabled;
maximum: root.maximum;
minimum: root.minimum;
value <=> root.value;
released => {
root.released(Math.round(root.value))
released(value) => {
root.released(value)
}
}
}
@@ -79,14 +69,14 @@ export component SystemSlider inherits RogItem {
border-color: Palette.accent-background;
background: Palette.background;
Dialog {
title <=> root.title;
title: root.title;
VerticalBox {
Text {
max-width: 420px;
font-size: 18px;
wrap: TextWrap.word-wrap;
horizontal-alignment: TextHorizontalAlignment.center;
text <=> root.title;
text: root.title;
}
Rectangle {
@@ -99,7 +89,7 @@ export component SystemSlider inherits RogItem {
max-width: 420px;
font-size: 16px;
wrap: TextWrap.word-wrap;
text <=> root.help_text;
text: root.help_text;
}
}
@@ -153,7 +143,7 @@ export component SystemSlider inherits RogItem {
reset := HorizontalBox {
if (has_reset): StandardButton {
kind: StandardButtonKind.reset;
enabled <=> root.enabled;
enabled: root.enabled;
clicked => {
reset_popup.show();
}
@@ -175,7 +165,7 @@ export component SystemToggle inherits RogItem {
font-size: 16px;
vertical-alignment: TextVerticalAlignment.center;
color: Palette.control-foreground;
text <=> root.text;
text: root.text;
}
}
@@ -206,7 +196,7 @@ export component SystemToggleInt inherits RogItem {
font-size: 16px;
vertical-alignment: TextVerticalAlignment.center;
color: Palette.control-foreground;
text <=> root.text;
text: root.text;
}
}
@@ -237,7 +227,7 @@ export component SystemToggleVert inherits RogItem {
vertical-alignment: TextVerticalAlignment.bottom;
horizontal-alignment: TextHorizontalAlignment.center;
color: Palette.control-foreground;
text <=> root.text;
text: root.text;
}
HorizontalLayout {
@@ -267,7 +257,7 @@ export component SystemDropdown inherits RogItem {
font-size: 16px;
vertical-alignment: TextVerticalAlignment.center;
color: Palette.control-foreground;
text <=> root.text;
text: root.text;
}
}