mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
rogcc gpu settings page UI updated
This commit is contained in:
@@ -1,102 +1,36 @@
|
|||||||
import { Palette, TabWidget, Button, CheckBox } from "std-widgets.slint";
|
import { Palette, TabWidget, Button, CheckBox, ScrollView } from "std-widgets.slint";
|
||||||
import { Graph, Node } from "../widgets/graph.slint";
|
import { Graph, Node } from "../widgets/graph.slint";
|
||||||
import { SystemToggle } from "../widgets/common.slint";
|
import { SystemToggle, SystemDropdown } from "../widgets/common.slint";
|
||||||
import { Profile, FanType, FanPageData } from "../types/fan_types.slint";
|
import { Profile, FanType, FanPageData } from "../types/fan_types.slint";
|
||||||
import { Palette, HorizontalBox , VerticalBox, ScrollView, Slider, Button, Switch, ComboBox, GroupBox, StandardButton} from "std-widgets.slint";
|
|
||||||
|
|
||||||
export global GPUPageData {
|
export global GPUPageData {
|
||||||
// GPU mode and device state
|
// GPU mode and device state
|
||||||
in-out property <int> gpu_mux_mode: 1; // 0 = Ultra/Discreet, 1 = Integrated/Optimus
|
in-out property <int> gpu_mux_mode: 1; // 0 = Ultra/Discreet, 1 = Integrated/Optimus
|
||||||
in-out property <int> dgpu_disabled: 0; // 1 == dGPU disabled
|
in-out property <int> dgpu_disabled: 0; // 1 == dGPU disabled
|
||||||
in-out property <int> egpu_enabled: 0; // 1 == eGPU (XGMobile) enabled
|
in-out property <int> egpu_enabled: 0; // 1 == eGPU (XGMobile) enabled
|
||||||
|
in-out property <[string]> gpu_modes_choises: [@tr("Ultra"), @tr("Integrated")];
|
||||||
callback cb_gpu_mux_mode(int);
|
callback cb_gpu_mux_mode(int);
|
||||||
callback cb_dgpu_disabled(int);
|
callback cb_dgpu_disabled(int);
|
||||||
callback cb_egpu_enabled(int);
|
callback cb_egpu_enabled(int);
|
||||||
}
|
}
|
||||||
|
|
||||||
export component PageGPU inherits Rectangle {
|
export component PageGPU inherits Rectangle {
|
||||||
|
|
||||||
clip: true;
|
clip: true;
|
||||||
|
|
||||||
ScrollView {
|
ScrollView {
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
spacing: 10px;
|
spacing: 10px;
|
||||||
alignment: LayoutAlignment.start;
|
SystemDropdown {
|
||||||
Rectangle {
|
text: @tr("GPU mode");
|
||||||
background: Palette.alternate-background;
|
current_index <=> GPUPageData.gpu_mux_mode;
|
||||||
border-color: Palette.accent-background;
|
current_value: GPUPageData.gpu_modes_choises[GPUPageData.gpu_mux_mode];
|
||||||
border-width: 3px;
|
model <=> GPUPageData.gpu_modes_choises;
|
||||||
border-radius: 10px;
|
selected => {
|
||||||
height: 40px;
|
GPUPageData.cb_gpu_mux_mode(0);
|
||||||
Text {
|
GPUPageData.cb_gpu_mux_mode(1);
|
||||||
font-size: 18px;
|
|
||||||
color: Palette.control-foreground;
|
|
||||||
horizontal-alignment: TextHorizontalAlignment.center;
|
|
||||||
text: @tr("GPU Configuration");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GroupBox {
|
|
||||||
HorizontalLayout {
|
|
||||||
spacing: 10px;
|
|
||||||
|
|
||||||
// Ultra (discreet) mode button - disabled if dGPU is marked disabled
|
|
||||||
Rectangle {
|
|
||||||
width: 120px;
|
|
||||||
height: 36px;
|
|
||||||
border-radius: 6px;
|
|
||||||
border-color: Palette.border;
|
|
||||||
border-width: 2px;
|
|
||||||
background: GPUPageData.gpu_mux_mode == 0 ? Palette.accent-background : Palette.control-background;
|
|
||||||
opacity: GPUPageData.dgpu_disabled == 1 ? 0.5 : 1.0;
|
|
||||||
|
|
||||||
Text {
|
|
||||||
color: Palette.control-foreground;
|
|
||||||
horizontal-alignment: TextHorizontalAlignment.center;
|
|
||||||
vertical-alignment: TextVerticalAlignment.center;
|
|
||||||
text: @tr("Ultra");
|
|
||||||
}
|
|
||||||
|
|
||||||
TouchArea {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
clicked => {
|
|
||||||
if (GPUPageData.dgpu_disabled != 1 && GPUPageData.gpu_mux_mode != 0) {
|
|
||||||
GPUPageData.cb_gpu_mux_mode(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Integrated (Optimus) mode button
|
|
||||||
Rectangle {
|
|
||||||
width: 120px;
|
|
||||||
height: 36px;
|
|
||||||
border-radius: 6px;
|
|
||||||
border-color: Palette.border;
|
|
||||||
border-width: 2px;
|
|
||||||
background: GPUPageData.gpu_mux_mode == 1 ? Palette.accent-background : Palette.control-background;
|
|
||||||
|
|
||||||
Text {
|
|
||||||
color: Palette.control-foreground;
|
|
||||||
horizontal-alignment: TextHorizontalAlignment.center;
|
|
||||||
vertical-alignment: TextVerticalAlignment.center;
|
|
||||||
text: @tr("Integrated");
|
|
||||||
}
|
|
||||||
|
|
||||||
TouchArea {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
clicked => {
|
|
||||||
if (GPUPageData.gpu_mux_mode != 1) {
|
|
||||||
GPUPageData.cb_gpu_mux_mode(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -261,12 +261,12 @@ export component PageSystem inherits Rectangle {
|
|||||||
alignment: LayoutAlignment.start;
|
alignment: LayoutAlignment.start;
|
||||||
Rectangle {
|
Rectangle {
|
||||||
background: Palette.alternate-background;
|
background: Palette.alternate-background;
|
||||||
border-color: Palette.accent-background;
|
border-color: Palette.border;
|
||||||
border-width: 3px;
|
border-width: 1px;
|
||||||
border-radius: 10px;
|
border-radius: 2px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
Text {
|
Text {
|
||||||
font-size: 18px;
|
font-size: 16px;
|
||||||
color: Palette.control-foreground;
|
color: Palette.control-foreground;
|
||||||
horizontal-alignment: TextHorizontalAlignment.center;
|
horizontal-alignment: TextHorizontalAlignment.center;
|
||||||
text: @tr("Keyboard Power Management");
|
text: @tr("Keyboard Power Management");
|
||||||
|
|||||||
Reference in New Issue
Block a user