Skip to content

Commit c54a2c7

Browse files
committed
qml: Introduce FocusBorder component
1 parent 31ec28d commit c54a2c7

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

src/Makefile.qt.include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ QML_RES_QML = \
342342
qml/components/StorageSettings.qml \
343343
qml/controls/ContinueButton.qml \
344344
qml/controls/ExternalLink.qml \
345+
qml/controls/FocusBorder.qml \
345346
qml/controls/Header.qml \
346347
qml/controls/InformationPage.qml \
347348
qml/controls/NavButton.qml \

src/qml/bitcoin_qml.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<file>components/StorageSettings.qml</file>
1616
<file>controls/ContinueButton.qml</file>
1717
<file>controls/ExternalLink.qml</file>
18+
<file>controls/FocusBorder.qml</file>
1819
<file>controls/Header.qml</file>
1920
<file>controls/InformationPage.qml</file>
2021
<file>controls/NavButton.qml</file>

src/qml/controls/FocusBorder.qml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright (c) 2023 The Bitcoin Core developers
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+
import QtQuick 2.15
6+
import QtQuick.Controls 2.15
7+
import "../controls"
8+
9+
10+
Rectangle {
11+
id: root
12+
property int topMargin: -4
13+
property int bottomMargin: -4
14+
property int leftMargin: -4
15+
property int rightMargin: -4
16+
property int borderRadius: 9
17+
18+
anchors.fill: parent
19+
anchors.topMargin: root.topMargin
20+
anchors.bottomMargin: root.bottomMargin
21+
anchors.leftMargin: root.leftMargin
22+
anchors.rightMargin: root.rightMargin
23+
border.width: 2
24+
border.color: Theme.color.purple
25+
radius: root.borderRadius
26+
color: "transparent"
27+
28+
Behavior on border.color {
29+
ColorAnimation { duration: 150 }
30+
}
31+
32+
Behavior on visible {
33+
NumberAnimation { duration: 150 }
34+
}
35+
}

0 commit comments

Comments
 (0)