aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxiphon <xiphon@protonmail.com>2021-04-02 12:10:24 +0000
committerxiphon <xiphon@protonmail.com>2021-04-02 12:10:24 +0000
commit74e1483d0b12de6b0e674486b7e346f4bf8eeeb7 (patch)
tree7d6b8575264d0484425982e143758930ca5a169f
parent34df4e74d4c75f53d0a05ad9e75cf494e9f7134a (diff)
downloadmonzero-gui-74e1483d0b12de6b0e674486b7e346f4bf8eeeb7.tar.gz
monzero-gui-74e1483d0b12de6b0e674486b7e346f4bf8eeeb7.tar.xz
monzero-gui-74e1483d0b12de6b0e674486b7e346f4bf8eeeb7.zip
Checkbox: handle Enter/Return/Space keys, change border color on focus
-rw-r--r--components/CheckBox.qml6
1 files changed, 5 insertions, 1 deletions
diff --git a/components/CheckBox.qml b/components/CheckBox.qml
index 1b475983..6e120f07 100644
--- a/components/CheckBox.qml
+++ b/components/CheckBox.qml
@@ -54,6 +54,10 @@ Item {
width: checkBoxLayout.width
opacity: enabled ? 1 : 0.7
+ Keys.onEnterPressed: toggle()
+ Keys.onReturnPressed: Keys.onEnterPressed(event)
+ Keys.onSpacePressed: Keys.onEnterPressed(event)
+
function toggle(){
if (checkBox.toggleOnClick) {
checkBox.checked = !checkBox.checked
@@ -78,7 +82,7 @@ Item {
radius: 3
color: checkBox.enabled ? "transparent" : MoneroComponents.Style.inputBoxBackgroundDisabled
border.color:
- if(checkBox.checked){
+ if (checkBox.activeFocus) {
return MoneroComponents.Style.inputBorderColorActive;
} else {
return MoneroComponents.Style.inputBorderColorInActive;