Skip to content

Commit 4ba609b

Browse files
promaghebasto
authored andcommitted
qml: Add ProgressIndicator control
Github-Pull: bitcoin-core#69 Rebased-From: 455b2f8
1 parent d8c4440 commit 4ba609b

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

src/qml/BitcoinApp/Controls/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ qt6_add_qml_module(bitcoin_qml_controls
99
RESOURCE_PREFIX /qt/qml/
1010
QML_FILES
1111
OptionButton.qml
12+
ProgressIndicator.qml
1213
)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) 2021 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
6+
import QtQuick.Controls
7+
8+
Control {
9+
property real progress: 0
10+
Behavior on progress {
11+
NumberAnimation {
12+
easing.type: Easing.Bezier
13+
easing.bezierCurve: [0.5, 0.0, 0.2, 1, 1, 1]
14+
duration: 250
15+
}
16+
}
17+
contentItem: Rectangle {
18+
implicitHeight: 6
19+
radius: Math.floor(height / 2)
20+
color: "#404040"
21+
Item {
22+
width: Math.round(progress * contentItem.width)
23+
height: parent.height
24+
clip: true
25+
Rectangle {
26+
width: contentItem.width
27+
height: contentItem.height
28+
radius: contentItem.radius
29+
color: "orange"
30+
}
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)