Skip to content

Commit 000837b

Browse files
committed
qml: use Icon control
1 parent 8dfe391 commit 000837b

File tree

5 files changed

+26
-60
lines changed

5 files changed

+26
-60
lines changed

src/qml/components/BlockClock.qml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,13 @@ Item {
6767
}
6868
}
6969

70-
Button {
70+
Icon {
7171
id: bitcoinIcon
72-
background: null
73-
icon.source: "image://images/bitcoin-circle"
74-
icon.color: Theme.color.neutral9
75-
icon.width: Math.max(dial.width / 5, 1)
76-
icon.height: Math.max(dial.width / 5, 1)
72+
source: "image://images/bitcoin-circle"
73+
color: Theme.color.neutral9
74+
size: Math.max(dial.width / 5, 1)
7775
anchors.bottom: mainText.top
7876
anchors.horizontalCenter: root.horizontalCenter
79-
80-
Behavior on icon.color {
81-
ColorAnimation { duration: 150 }
82-
}
8377
}
8478

8579
Label {

src/qml/components/CaretRightButton.qml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,13 @@
44

55
import QtQuick 2.15
66
import QtQuick.Controls 2.15
7+
import "../controls"
78

8-
Button {
9+
Icon {
910
id: root
1011
required property color stateColor
11-
12-
leftPadding: 0
13-
topPadding: 0
14-
bottomPadding: 0
15-
icon.source: "image://images/caret-right"
16-
icon.color: root.stateColor
17-
icon.height: 18
18-
icon.width: 18
19-
background: null
20-
21-
Behavior on icon.color {
22-
ColorAnimation { duration: 150 }
23-
}
12+
enabled: true
13+
source: "image://images/caret-right"
14+
color: root.stateColor
15+
size: 18
2416
}

src/qml/components/ThemeSettings.qml

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,12 @@ ColumnLayout {
1919
Setting {
2020
Layout.fillWidth: true
2121
header: qsTr("Light")
22-
actionItem: Button {
22+
actionItem: Icon {
2323
anchors.centerIn: parent
2424
visible: !Theme.dark
25-
icon.source: "image://images/check"
26-
icon.color: Theme.color.neutral9
27-
icon.height: 24
28-
icon.width: 24
29-
background: null
30-
31-
Behavior on icon.color {
32-
ColorAnimation { duration: 150 }
33-
}
25+
source: "image://images/check"
26+
color: Theme.color.neutral9
27+
size: 24
3428
}
3529
onClicked: {
3630
Theme.dark = false
@@ -40,18 +34,12 @@ ColumnLayout {
4034
Setting {
4135
Layout.fillWidth: true
4236
header: qsTr("Dark")
43-
actionItem: Button {
37+
actionItem: Icon {
4438
anchors.centerIn: parent
4539
visible: Theme.dark
46-
icon.source: "image://images/check"
47-
icon.color: Theme.color.neutral9
48-
icon.height: 24
49-
icon.width: 24
50-
background: null
51-
52-
Behavior on icon.color {
53-
ColorAnimation { duration: 150 }
54-
}
40+
source: "image://images/check"
41+
color: Theme.color.neutral9
42+
size: 24
5543
}
5644
onClicked: {
5745
Theme.dark = true;

src/qml/controls/OptionButton.qml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,12 @@ Button {
8484
Item {
8585
height: parent.height
8686
width: 40
87-
Button {
87+
Icon {
8888
anchors.centerIn: parent
8989
visible: button.checked
90-
icon.source: "image://images/check"
91-
icon.color: Theme.color.neutral9
92-
icon.height: 24
93-
icon.width: 24
94-
background: null
95-
96-
Behavior on icon.color {
97-
ColorAnimation { duration: 150 }
98-
}
90+
source: "image://images/check"
91+
color: Theme.color.neutral9
92+
size: 24
9993
}
10094
}
10195
}

src/qml/pages/node/Shutdown.qml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ Page {
1414
anchors.centerIn: parent
1515
width: parent.width
1616
spacing: 10
17-
Button {
17+
Icon {
1818
Layout.alignment: Qt.AlignCenter
1919
Layout.bottomMargin: 20
20-
background: null
21-
icon.source: "image://images/shutdown"
22-
icon.color: Theme.color.neutral9
23-
icon.width: 60
24-
icon.height: 60
20+
source: "image://images/shutdown"
21+
color: Theme.color.neutral9
22+
size: 60
2523
}
2624
Header {
2725
Layout.alignment: Qt.AlignCenter

0 commit comments

Comments
 (0)