Skip to content

Commit 0cfcffd

Browse files
committed
qml: Introduce Skeleton.qml
1 parent 0e0a957 commit 0cfcffd

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

qml/bitcoin_qml.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
<file>controls/qmldir</file>
5151
<file>controls/SendOptionsPopup.qml</file>
5252
<file>controls/Setting.qml</file>
53+
<file>controls/Skeleton.qml</file>
5354
<file>controls/TextButton.qml</file>
5455
<file>controls/Theme.qml</file>
5556
<file>controls/ToggleButton.qml</file>

qml/controls/Skeleton.qml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Copyright (c) 2025 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+
7+
Rectangle {
8+
id: root
9+
property color baseColor: Theme.color.neutral1
10+
property color highlightColor: Theme.color.neutral2
11+
property int shimmerDuration: 2500
12+
13+
radius: 3
14+
15+
gradient: Gradient {
16+
orientation: Gradient.Horizontal
17+
GradientStop {
18+
id: stop1
19+
position: 0.0
20+
color: root.baseColor
21+
}
22+
GradientStop {
23+
id: stop2
24+
position: 0.5
25+
color: root.highlightColor
26+
}
27+
GradientStop {
28+
id: stop3;
29+
position: 1
30+
color: root.baseColor
31+
}
32+
}
33+
34+
ParallelAnimation {
35+
running: true
36+
loops: Animation.Infinite
37+
NumberAnimation {
38+
target: stop1
39+
property: "position"
40+
from: -1.0
41+
to: 1.0
42+
duration: root.shimmerDuration
43+
easing.type: Easing.Linear
44+
}
45+
NumberAnimation {
46+
target: stop2
47+
property: "position"
48+
from: -0.5
49+
to: 1.5
50+
duration: root.shimmerDuration;
51+
easing.type: Easing.Linear
52+
}
53+
NumberAnimation {
54+
target: stop3
55+
property: "position"
56+
from: 0.0
57+
to: 2.0
58+
duration: root.shimmerDuration
59+
easing.type: Easing.Linear
60+
}
61+
}
62+
}

0 commit comments

Comments
 (0)