From cf3a27cecf59198ff88358b204ba99cbf3ad3594 Mon Sep 17 00:00:00 2001 From: Logan McNaughton <848146+loganmc10@users.noreply.github.com> Date: Mon, 20 Apr 2026 04:27:44 -0600 Subject: [PATCH] Use switch instead of checkbox (#785) --- src/ui/gui/cheat_page.slint | 5 ++--- src/ui/gui/controller_page.slint | 8 ++++---- src/ui/gui/input_profile.slint | 4 ++-- src/ui/gui/retroachievements_page.slint | 10 +++++----- src/ui/gui/settings_page.slint | 18 +++++++++--------- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/ui/gui/cheat_page.slint b/src/ui/gui/cheat_page.slint index 6918af59..5df273a2 100644 --- a/src/ui/gui/cheat_page.slint +++ b/src/ui/gui/cheat_page.slint @@ -1,7 +1,7 @@ // Copyright © SixtyFPS GmbH // SPDX-License-Identifier: MIT -import { ListView, HorizontalBox, VerticalBox, Button, GroupBox, CheckBox } from "std-widgets.slint"; +import { ListView, HorizontalBox, VerticalBox, Button, GroupBox, Switch, CheckBox } from "std-widgets.slint"; import { Page } from "page.slint"; import { SettingsData } from "settings_page.slint"; @@ -62,8 +62,7 @@ export component Cheats inherits Page { wrap: word-wrap; } - if data.options.length == 0: CheckBox { - text: @tr("Enabled"); + if data.options.length == 0: Switch { checked: data.enabled; toggled => { data.enabled = self.checked; diff --git a/src/ui/gui/controller_page.slint b/src/ui/gui/controller_page.slint index 07f705df..156e10a4 100644 --- a/src/ui/gui/controller_page.slint +++ b/src/ui/gui/controller_page.slint @@ -1,7 +1,7 @@ // Copyright © SixtyFPS GmbH // SPDX-License-Identifier: MIT -import { CheckBox, ComboBox, Button, HorizontalBox, VerticalBox, GroupBox } from "std-widgets.slint"; +import { Switch, ComboBox, Button, HorizontalBox, VerticalBox, GroupBox } from "std-widgets.slint"; import { Page } from "page.slint"; import { State } from "localgame_page.slint"; @@ -55,7 +55,7 @@ export component ControllerConfig inherits Page { title: @tr("Enabled"); VerticalLayout { alignment: space-between; - for player in [0, 1, 2, 3]: CheckBox { + for player in [0, 1, 2, 3]: Switch { checked: ControllerData.controller_enabled[player]; toggled => { ControllerData.controller_enabled[player] = self.checked; @@ -68,7 +68,7 @@ export component ControllerConfig inherits Page { title: @tr("Emulate VRU"); VerticalLayout { alignment: space-between; - for valid in [false, false, false, true]: CheckBox { + for valid in [false, false, false, true]: Switch { enabled: valid; checked: valid && ControllerData.emulate_vru; toggled => { @@ -82,7 +82,7 @@ export component ControllerConfig inherits Page { title: @tr("Transfer Pak"); VerticalLayout { alignment: space-between; - for player in [0, 1, 2, 3]: CheckBox { + for player in [0, 1, 2, 3]: Switch { checked: ControllerData.transferpak[player]; toggled => { ControllerData.transferpak[player] = self.checked; diff --git a/src/ui/gui/input_profile.slint b/src/ui/gui/input_profile.slint index 941867d4..76123a59 100644 --- a/src/ui/gui/input_profile.slint +++ b/src/ui/gui/input_profile.slint @@ -1,4 +1,4 @@ -import { StandardButton, HorizontalBox, VerticalBox, Button, LineEdit, CheckBox, Slider } from "std-widgets.slint"; +import { StandardButton, HorizontalBox, VerticalBox, Button, LineEdit, Switch, Slider } from "std-widgets.slint"; export global InputProfileData { in-out property dinput; @@ -47,7 +47,7 @@ export component InputProfileDialog inherits Window { HorizontalBox { alignment: center; - CheckBox { + Switch { text: @tr("Use DirectInput"); checked: InputProfileData.dinput; toggled => { diff --git a/src/ui/gui/retroachievements_page.slint b/src/ui/gui/retroachievements_page.slint index 7a34ce13..498f323b 100644 --- a/src/ui/gui/retroachievements_page.slint +++ b/src/ui/gui/retroachievements_page.slint @@ -1,7 +1,7 @@ // Copyright © SixtyFPS GmbH // SPDX-License-Identifier: MIT -import { LineEdit, CheckBox, Button, HorizontalBox, VerticalBox } from "std-widgets.slint"; +import { LineEdit, Switch, Button, HorizontalBox, VerticalBox } from "std-widgets.slint"; import { Page } from "page.slint"; export global RAData { @@ -27,7 +27,7 @@ export component RetroAchievements inherits Page { alignment: start; HorizontalBox { alignment: start; - CheckBox { + Switch { text: @tr("Enabled"); checked: RAData.enabled; toggled => { @@ -45,7 +45,7 @@ export component RetroAchievements inherits Page { } HorizontalBox { alignment: start; - CheckBox { + Switch { text: @tr("Hardcore mode"); checked: RAData.hardcore; enabled: RAData.enabled; @@ -57,7 +57,7 @@ export component RetroAchievements inherits Page { } HorizontalBox { alignment: start; - CheckBox { + Switch { text: @tr("Challenge Indicators"); checked: RAData.challenge; enabled: RAData.enabled; @@ -69,7 +69,7 @@ export component RetroAchievements inherits Page { } HorizontalBox { alignment: start; - CheckBox { + Switch { text: @tr("Leaderboard Trackers"); checked: RAData.leaderboard; enabled: RAData.enabled; diff --git a/src/ui/gui/settings_page.slint b/src/ui/gui/settings_page.slint index 5145ab98..0ad1f835 100644 --- a/src/ui/gui/settings_page.slint +++ b/src/ui/gui/settings_page.slint @@ -1,7 +1,7 @@ // Copyright © SixtyFPS GmbH // SPDX-License-Identifier: MIT -import { ComboBox, HorizontalBox, VerticalBox, CheckBox } from "std-widgets.slint"; +import { ComboBox, HorizontalBox, VerticalBox, Switch } from "std-widgets.slint"; import { Page } from "page.slint"; export global SettingsData { @@ -40,7 +40,7 @@ export component Settings inherits Page { HorizontalBox { alignment: start; - CheckBox { + Switch { text: @tr("Integer Scaling"); checked: SettingsData.integer_scaling; toggled => { @@ -51,7 +51,7 @@ export component Settings inherits Page { HorizontalBox { alignment: start; - CheckBox { + Switch { text: @tr("Fullscreen (Esc closes game)"); checked: SettingsData.fullscreen; toggled => { @@ -62,7 +62,7 @@ export component Settings inherits Page { HorizontalBox { alignment: start; - CheckBox { + Switch { text: @tr("Widescreen (stretch)"); checked: SettingsData.widescreen; toggled => { @@ -73,7 +73,7 @@ export component Settings inherits Page { HorizontalBox { alignment: start; - CheckBox { + Switch { text: @tr("VSync"); checked: SettingsData.vsync; toggled => { @@ -84,7 +84,7 @@ export component Settings inherits Page { HorizontalBox { alignment: start; - CheckBox { + Switch { text: @tr("Apply CRT shader"); checked: SettingsData.apply_crt_shader; toggled => { @@ -99,7 +99,7 @@ export component Settings inherits Page { HorizontalBox { alignment: start; - CheckBox { + Switch { text: @tr("Overclock N64 CPU (may cause bugs)"); checked: SettingsData.overclock_n64_cpu; toggled => { @@ -110,7 +110,7 @@ export component Settings inherits Page { HorizontalBox { alignment: start; - CheckBox { + Switch { text: @tr("Disable Expansion Pak"); checked: SettingsData.disable_expansion_pak; toggled => { @@ -121,7 +121,7 @@ export component Settings inherits Page { HorizontalBox { alignment: start; - CheckBox { + Switch { text: @tr("Emulate UNFLoader"); checked: SettingsData.emulate_usb; toggled => {