Skip to content

Commit ab0ea57

Browse files
committed
qml: add FocusBorder to Focus-able components
1 parent c54a2c7 commit ab0ea57

File tree

6 files changed

+27
-8
lines changed

6 files changed

+27
-8
lines changed

src/qml/components/BlockClock.qml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Item {
2424
property bool synced: nodeModel.verificationProgress > 0.999
2525
property bool paused: false
2626

27+
activeFocusOnTab: true
28+
2729
BlockClockDial {
2830
id: dial
2931
anchors.fill: parent
@@ -81,6 +83,9 @@ Item {
8183
root.paused = !root.paused
8284
nodeModel.pause = root.paused
8385
}
86+
FocusBorder {
87+
visible: root.activeFocus
88+
}
8489
}
8590

8691
states: [

src/qml/controls/ContinueButton.qml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ Button {
4343
Behavior on color {
4444
ColorAnimation { duration: 150 }
4545
}
46+
47+
FocusBorder {
48+
visible: root.visualFocus
49+
}
4650
}
4751
MouseArea {
4852
anchors.fill: parent

src/qml/controls/NavButton.qml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ AbstractButton {
4141
}
4242
]
4343

44+
FocusBorder {
45+
visible: root.visualFocus
46+
}
47+
4448
Behavior on color {
4549
ColorAnimation { duration: 150 }
4650
}

src/qml/controls/OptionButton.qml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,9 @@ Button {
1818
border.color: button.checked ? Theme.color.orange : button.hovered ? Theme.color.neutral9 : Theme.color.neutral5
1919
radius: 10
2020
color: "transparent"
21-
Rectangle {
21+
FocusBorder {
2222
visible: button.visualFocus
23-
anchors.fill: parent
24-
anchors.margins: -4
25-
border.width: 2
26-
border.color: Theme.color.orange
27-
radius: 14
28-
color: "transparent"
29-
opacity: 0.4
23+
borderRadius: 14
3024
}
3125
}
3226
contentItem: RowLayout {

src/qml/controls/Setting.qml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ AbstractButton {
4343
}
4444
]
4545

46+
background: FocusBorder {
47+
visible: root.visualFocus
48+
topMargin: -4
49+
bottomMargin: -4
50+
leftMargin: -6
51+
rightMargin: -6
52+
}
53+
4654
MouseArea {
4755
id: mouseArea
4856
anchors.fill: root

src/qml/controls/TextButton.qml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ Button {
3434
Behavior on color {
3535
ColorAnimation { duration: 150 }
3636
}
37+
38+
FocusBorder {
39+
visible: root.visualFocus
40+
}
3741
}
3842
states: [
3943
State {

0 commit comments

Comments
 (0)