mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-02-02 03:06:26 +00:00
Checkbox: handle Enter/Return/Space keys, change border color on focus
This commit is contained in:
parent
34df4e74d4
commit
74e1483d0b
1 changed files with 5 additions and 1 deletions
|
@ -54,6 +54,10 @@ Item {
|
||||||
width: checkBoxLayout.width
|
width: checkBoxLayout.width
|
||||||
opacity: enabled ? 1 : 0.7
|
opacity: enabled ? 1 : 0.7
|
||||||
|
|
||||||
|
Keys.onEnterPressed: toggle()
|
||||||
|
Keys.onReturnPressed: Keys.onEnterPressed(event)
|
||||||
|
Keys.onSpacePressed: Keys.onEnterPressed(event)
|
||||||
|
|
||||||
function toggle(){
|
function toggle(){
|
||||||
if (checkBox.toggleOnClick) {
|
if (checkBox.toggleOnClick) {
|
||||||
checkBox.checked = !checkBox.checked
|
checkBox.checked = !checkBox.checked
|
||||||
|
@ -78,7 +82,7 @@ Item {
|
||||||
radius: 3
|
radius: 3
|
||||||
color: checkBox.enabled ? "transparent" : MoneroComponents.Style.inputBoxBackgroundDisabled
|
color: checkBox.enabled ? "transparent" : MoneroComponents.Style.inputBoxBackgroundDisabled
|
||||||
border.color:
|
border.color:
|
||||||
if(checkBox.checked){
|
if (checkBox.activeFocus) {
|
||||||
return MoneroComponents.Style.inputBorderColorActive;
|
return MoneroComponents.Style.inputBorderColorActive;
|
||||||
} else {
|
} else {
|
||||||
return MoneroComponents.Style.inputBorderColorInActive;
|
return MoneroComponents.Style.inputBorderColorInActive;
|
||||||
|
|
Loading…
Reference in a new issue