update CardType for using with focus navigation
This commit is contained in:
parent
89ac585e07
commit
852e90e317
1 changed files with 30 additions and 1 deletions
|
|
@ -22,6 +22,7 @@ RadioButton {
|
||||||
property string pressedBorderColor: AmneziaStyle.color.softGoldenApricot
|
property string pressedBorderColor: AmneziaStyle.color.softGoldenApricot
|
||||||
property string selectedBorderColor: AmneziaStyle.color.goldenApricot
|
property string selectedBorderColor: AmneziaStyle.color.goldenApricot
|
||||||
property string defaultBodredColor: AmneziaStyle.color.transparent
|
property string defaultBodredColor: AmneziaStyle.color.transparent
|
||||||
|
property string focusBorderColor: AmneziaStyle.color.paleGray
|
||||||
property int borderWidth: 0
|
property int borderWidth: 0
|
||||||
|
|
||||||
implicitWidth: content.implicitWidth
|
implicitWidth: content.implicitWidth
|
||||||
|
|
@ -29,6 +30,32 @@ RadioButton {
|
||||||
|
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
|
||||||
|
property bool isFocusable: true
|
||||||
|
|
||||||
|
Keys.onTabPressed: {
|
||||||
|
FocusController.nextKeyTabItem()
|
||||||
|
}
|
||||||
|
|
||||||
|
Keys.onBacktabPressed: {
|
||||||
|
FocusController.previousKeyTabItem()
|
||||||
|
}
|
||||||
|
|
||||||
|
Keys.onUpPressed: {
|
||||||
|
FocusController.nextKeyUpItem()
|
||||||
|
}
|
||||||
|
|
||||||
|
Keys.onDownPressed: {
|
||||||
|
FocusController.nextKeyDownItem()
|
||||||
|
}
|
||||||
|
|
||||||
|
Keys.onLeftPressed: {
|
||||||
|
FocusController.nextKeyLeftItem()
|
||||||
|
}
|
||||||
|
|
||||||
|
Keys.onRightPressed: {
|
||||||
|
FocusController.nextKeyRightItem()
|
||||||
|
}
|
||||||
|
|
||||||
indicator: Rectangle {
|
indicator: Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: 16
|
radius: 16
|
||||||
|
|
@ -52,6 +79,8 @@ RadioButton {
|
||||||
return pressedBorderColor
|
return pressedBorderColor
|
||||||
} else if (root.checked) {
|
} else if (root.checked) {
|
||||||
return selectedBorderColor
|
return selectedBorderColor
|
||||||
|
} else if (root.activeFocus) {
|
||||||
|
return focusBorderColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return defaultBodredColor
|
return defaultBodredColor
|
||||||
|
|
@ -59,7 +88,7 @@ RadioButton {
|
||||||
|
|
||||||
border.width: {
|
border.width: {
|
||||||
if (root.enabled) {
|
if (root.enabled) {
|
||||||
if(root.checked) {
|
if(root.checked || root.activeFocus) {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
return root.pressed ? 1 : 0
|
return root.pressed ? 1 : 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue