Merge pull request #3370

74e1483 Checkbox: handle Enter/Return/Space keys, change border color on focus (xiphon)
This commit is contained in:
luigi1111 2021-04-05 21:31:48 -05:00
commit 2354c615d1
No known key found for this signature in database
GPG Key ID: F4ACA0183641E010

View File

@ -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;