mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
51 lines
1.8 KiB
Plaintext
51 lines
1.8 KiB
Plaintext
import { Palette, TabWidget, Button, CheckBox, ScrollView } from "std-widgets.slint";
|
|
import { Graph, Node } from "../widgets/graph.slint";
|
|
import { SystemToggle, SystemDropdown } from "../widgets/common.slint";
|
|
import { Profile, FanType, FanPageData } from "../types/fan_types.slint";
|
|
|
|
export global GPUPageData {
|
|
// GPU mode and device state
|
|
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> egpu_enabled: 0; // 1 == eGPU (XGMobile) enabled
|
|
in-out property <[string]> gpu_modes_choises: [@tr("Integrated"), @tr("Hybrid")];
|
|
in-out property <bool> gpu_mux_available: false;
|
|
callback cb_set_gpu_mode(int);
|
|
}
|
|
|
|
export component PageGPU inherits Rectangle {
|
|
clip: true;
|
|
|
|
ScrollView {
|
|
VerticalLayout {
|
|
padding: 10px;
|
|
spacing: 10px;
|
|
|
|
HorizontalLayout {
|
|
padding-right: 10px;
|
|
padding-left: 10px;
|
|
alignment: LayoutAlignment.space-between;
|
|
Rectangle {
|
|
height: 32px;
|
|
Text {
|
|
font-size: 16px;
|
|
text: @tr("Note: Changes take effect after a reboot. The dropdown always shows the current mode.");
|
|
}
|
|
}
|
|
}
|
|
|
|
HorizontalLayout {
|
|
SystemDropdown {
|
|
text: @tr("GPU mode");
|
|
model <=> GPUPageData.gpu_modes_choises;
|
|
current_index <=> GPUPageData.gpu_mux_mode;
|
|
current_value: GPUPageData.gpu_modes_choises[GPUPageData.gpu_mux_mode];
|
|
selected => {
|
|
GPUPageData.cb_set_gpu_mode(GPUPageData.gpu_mux_mode)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|