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 gpu_mux_mode: 1; // 0 = Ultra/Discreet, 1 = Integrated/Optimus in-out property dgpu_disabled: 0; // 1 == dGPU disabled in-out property egpu_enabled: 0; // 1 == eGPU (XGMobile) enabled in-out property <[string]> gpu_modes_choises: [@tr("Integrated"), @tr("Hybrid")]; in-out property gpu_mux_available: false; callback cb_set_gpu_mode(int); } export component PageGPU inherits Rectangle { clip: true; ScrollView { VerticalLayout { padding: 12px; spacing: 8px; Rectangle { background: Palette.alternate-background; border-color: Palette.border; border-width: 1px; border-radius: 2px; height: 36px; Text { font-size: 16px; color: Palette.control-foreground; horizontal-alignment: TextHorizontalAlignment.center; text: @tr("Internal/Discrete GPU"); } } 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) } } } } } }