Skip to content

Commit 8dfe391

Browse files
committed
qml: add Icon control
1 parent ddbc0ea commit 8dfe391

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

src/Makefile.qt.include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ QML_RES_QML = \
362362
qml/controls/ExternalLink.qml \
363363
qml/controls/FocusBorder.qml \
364364
qml/controls/Header.qml \
365+
qml/controls/Icon.qml \
365366
qml/controls/InformationPage.qml \
366367
qml/controls/NavButton.qml \
367368
qml/controls/PageIndicator.qml \

src/qml/bitcoin_qml.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<file>controls/ExternalLink.qml</file>
2424
<file>controls/FocusBorder.qml</file>
2525
<file>controls/Header.qml</file>
26+
<file>controls/Icon.qml</file>
2627
<file>controls/InformationPage.qml</file>
2728
<file>controls/NavButton.qml</file>
2829
<file>controls/PageIndicator.qml</file>

src/qml/controls/Icon.qml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
8+
Button {
9+
id: root
10+
required property color color
11+
required property url source
12+
property int size: 32
13+
focusPolicy: Qt.NoFocus
14+
padding: 0
15+
icon.source: root.source
16+
icon.color: root.color
17+
icon.height: root.size
18+
icon.width: root.size
19+
enabled: false
20+
background: null
21+
22+
Behavior on icon.color {
23+
ColorAnimation {
24+
duration: 150
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)