fix: fixed switcher behavior (#1801)

This commit is contained in:
vkamn
2025-08-20 13:01:09 +08:00
committed by GitHub
parent beb1c6dbf2
commit 8dc2a4b76c
6 changed files with 11 additions and 11 deletions

View File

@@ -155,7 +155,7 @@ Switch {
function handleSwitch(event) {
if (!event.isAutoRepeat) {
root.checked = !root.checked
root.checkedChanged()
root.toggled()
}
event.accepted = true
}

View File

@@ -153,7 +153,7 @@ PageType {
text: qsTr("Auto-negotiate encryption")
checked: autoNegotiateEncryprion
onCheckedChanged: {
onToggled: function() {
if (checked !== autoNegotiateEncryprion) {
autoNegotiateEncryprion = checked
}
@@ -320,7 +320,7 @@ PageType {
text: qsTr("Additional client configuration commands")
onCheckedChanged: {
onToggled: function() {
if (!checked) {
additionalClientCommands = ""
}
@@ -357,7 +357,7 @@ PageType {
text: qsTr("Additional server configuration commands")
onCheckedChanged: {
onToggled: function() {
if (!checked) {
additionalServerCommands = ""
}

View File

@@ -66,7 +66,7 @@ PageType {
text: qsTr("Allow application screenshots")
checked: SettingsController.isScreenshotsEnabled()
onCheckedChanged: {
onToggled: function() {
if (checked !== SettingsController.isScreenshotsEnabled()) {
SettingsController.toggleScreenshotsEnabled(checked)
}
@@ -109,7 +109,7 @@ PageType {
descriptionText: qsTr("Launch the application every time the device is starts")
checked: SettingsController.isAutoStartEnabled()
onCheckedChanged: {
onToggled: function() {
if (checked !== SettingsController.isAutoStartEnabled()) {
SettingsController.toggleAutoStart(checked)
}
@@ -132,7 +132,7 @@ PageType {
descriptionText: qsTr("Connect to VPN on app start")
checked: SettingsController.isAutoConnectEnabled()
onCheckedChanged: {
onToggled: function() {
if (checked !== SettingsController.isAutoConnectEnabled()) {
SettingsController.toggleAutoConnect(checked)
}
@@ -158,7 +158,7 @@ PageType {
opacity: enabled ? 1.0 : 0.5
checked: SettingsController.isStartMinimizedEnabled()
onCheckedChanged: {
onToggled: function() {
if (checked !== SettingsController.isStartMinimizedEnabled()) {
SettingsController.toggleStartMinimized(checked)
}

View File

@@ -66,7 +66,7 @@ PageType {
descriptionText: qsTr("If AmneziaDNS is installed on the server")
checked: SettingsController.isAmneziaDnsEnabled()
onCheckedChanged: {
onToggled: function() {
if (checked !== SettingsController.isAmneziaDnsEnabled()) {
SettingsController.toggleAmneziaDns(checked)
}

View File

@@ -64,7 +64,7 @@ PageType {
checked: SettingsController.isLoggingEnabled
onCheckedChanged: {
onToggled: function() {
if (checked !== SettingsController.isLoggingEnabled) {
SettingsController.isLoggingEnabled = checked
}

View File

@@ -86,7 +86,7 @@ PageType {
visible: PageController.isStartPageVisible()
checked: SettingsController.isLoggingEnabled
onCheckedChanged: {
onToggled: function() {
if (checked !== SettingsController.isLoggingEnabled) {
SettingsController.isLoggingEnabled = checked
}