mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-24 02:00:24 +07:00
fix checkbox switch (#1777)
This commit is contained in:
@@ -173,15 +173,17 @@ CheckBox {
|
|||||||
enabled: false
|
enabled: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Keys.onEnterPressed: event => handleSwitch(event)
|
||||||
|
Keys.onReturnPressed: event => handleSwitch(event)
|
||||||
|
Keys.onSpacePressed: event => handleSwitch(event)
|
||||||
|
|
||||||
Keys.onEnterPressed: {
|
function handleSwitch(event) {
|
||||||
|
if (!event.isAutoRepeat) {
|
||||||
root.checked = !root.checked
|
root.checked = !root.checked
|
||||||
|
root.checkedChanged()
|
||||||
}
|
}
|
||||||
|
event.accepted = true
|
||||||
Keys.onReturnPressed: {
|
|
||||||
root.checked = !root.checked
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user