Skip to content

Commit 95fee66

Browse files
committed
qml: Replace NavButton with IconButton in Send
1 parent e583ae2 commit 95fee66

File tree

4 files changed

+57
-35
lines changed

4 files changed

+57
-35
lines changed

src/Makefile.qt.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,12 +425,12 @@ QML_RES_QML = \
425425
qml/controls/CoreCheckBox.qml \
426426
qml/controls/CoreText.qml \
427427
qml/controls/CoreTextField.qml \
428-
qml/controls/EllipsisMenuButton.qml \
429428
qml/controls/EllipsisMenuToggleItem.qml \
430429
qml/controls/ExternalLink.qml \
431430
qml/controls/FocusBorder.qml \
432431
qml/controls/Header.qml \
433432
qml/controls/Icon.qml \
433+
qml/controls/IconButton.qml \
434434
qml/controls/InformationPage.qml \
435435
qml/controls/IPAddressValueInput.qml \
436436
qml/controls/KeyValueRow.qml \

src/qml/bitcoin_qml.qrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
<file>controls/FocusBorder.qml</file>
3131
<file>controls/Header.qml</file>
3232
<file>controls/Icon.qml</file>
33+
<file>controls/IconButton.qml</file>
3334
<file>controls/InformationPage.qml</file>
3435
<file>controls/IPAddressValueInput.qml</file>
3536
<file>controls/KeyValueRow.qml</file>
3637
<file>controls/LabeledTextInput.qml</file>
3738
<file>controls/LabeledCoinControlButton.qml</file>
38-
<file>controls/EllipsisMenuButton.qml</file>
3939
<file>controls/EllipsisMenuToggleItem.qml</file>
4040
<file>controls/NavButton.qml</file>
4141
<file>controls/NavigationBar.qml</file>

src/qml/controls/EllipsisMenuButton.qml renamed to src/qml/controls/IconButton.qml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@ import org.bitcoincore.qt 1.0
1111
Button {
1212
id: root
1313

14+
property color iconColor: Theme.color.orange
1415
property color hoverColor: Theme.color.orange
1516
property color activeColor: Theme.color.orange
17+
property int size: 35
18+
property alias iconSource: icon.source
1619

1720
hoverEnabled: AppMode.isDesktop
18-
implicitHeight: 35
19-
implicitWidth: 35
21+
height: root.size
22+
width: root.size
23+
padding: 0
2024

2125
MouseArea {
2226
anchors.fill: parent
@@ -25,28 +29,44 @@ Button {
2529
cursorShape: Qt.PointingHandCursor
2630
}
2731

28-
background: null
32+
background: Rectangle {
33+
id: bg
34+
anchors.fill: parent
35+
radius: 5
36+
color: Theme.color.background
37+
38+
39+
Behavior on color {
40+
ColorAnimation { duration: 150 }
41+
}
42+
}
2943

3044
contentItem: Icon {
31-
id: ellipsisIcon
45+
id: icon
3246
anchors.fill: parent
3347
source: "image://images/ellipsis"
34-
color: Theme.color.neutral9
35-
size: 35
48+
size: root.size
49+
color: iconColor
50+
51+
Behavior on color {
52+
ColorAnimation { duration: 150 }
53+
}
3654
}
3755

3856
states: [
3957
State {
4058
name: "CHECKED"; when: root.checked
41-
PropertyChanges { target: ellipsisIcon; color: activeColor }
59+
PropertyChanges { target: icon; color: activeColor }
4260
},
4361
State {
4462
name: "HOVER"; when: root.hovered
45-
PropertyChanges { target: ellipsisIcon; color: hoverColor }
63+
PropertyChanges { target: icon; color: hoverColor }
64+
PropertyChanges { target: bg; color: Theme.color.neutral2 }
4665
},
4766
State {
4867
name: "DISABLED"; when: !root.enabled
49-
PropertyChanges { target: ellipsisIcon; color: Theme.color.neutral4 }
68+
PropertyChanges { target: icon; color: Theme.color.neutral2 }
69+
PropertyChanges { target: bg; color: Theme.color.background }
5070
}
5171
]
5272
}

src/qml/pages/wallet/Send.qml

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ PageStack {
6767
bold: true
6868
}
6969

70-
EllipsisMenuButton {
70+
IconButton {
7171
id: menuButton
7272
anchors.right: parent.right
7373
anchors.verticalCenter: parent.verticalCenter
7474
checked: sendOptionsPopup.opened
75+
iconSource: "image://images/ellipsis"
7576
onClicked: {
7677
sendOptionsPopup.open()
7778
}
@@ -91,54 +92,55 @@ PageStack {
9192
Layout.bottomMargin: 10
9293
visible: settings.multipleRecipientsEnabled
9394

94-
NavButton {
95+
CoreText {
96+
Layout.fillWidth: true
97+
Layout.alignment: Qt.AlignLeft
98+
id: selectAndAddRecipientsLabel
99+
text: qsTr("Recipient %1 of %2").arg(wallet.recipients.currentIndex).arg(wallet.recipients.count)
100+
horizontalAlignment: Text.AlignLeft
101+
font.pixelSize: 18
102+
color: Theme.color.neutral9
103+
}
104+
105+
IconButton {
95106
Layout.preferredWidth: 30
96107
Layout.preferredHeight: 30
97-
iconWidth: 30
98-
iconHeight: 30
108+
size: 30
99109
iconSource: "image://images/caret-left"
110+
enabled: wallet.recipients.currentIndex - 1 > 0
100111
onClicked: {
101112
wallet.recipients.prev()
113+
102114
}
103115
}
104116

105-
NavButton {
117+
IconButton {
106118
Layout.preferredWidth: 30
107119
Layout.preferredHeight: 30
108-
iconWidth: 30
109-
iconHeight: 30
120+
size: 30
110121
iconSource: "image://images/caret-right"
122+
enabled: wallet.recipients.currentIndex < wallet.recipients.count
111123
onClicked: {
112124
wallet.recipients.next()
113125
}
114126
}
115127

116-
CoreText {
117-
Layout.fillWidth: true
118-
Layout.alignment: Qt.AlignLeft
119-
id: selectAndAddRecipientsLabel
120-
text: qsTr("Recipient %1 of %2").arg(wallet.recipients.currentIndex).arg(wallet.recipients.count)
121-
font.pixelSize: 18
122-
color: Theme.color.neutral9
123-
}
124-
125-
NavButton {
128+
IconButton {
126129
Layout.preferredWidth: 30
127130
Layout.preferredHeight: 30
128-
iconWidth: 20
129-
iconHeight: 20
130-
iconSource: "image://images/plus"
131+
size: 30
132+
iconSource: "image://images/plus-big-filled"
131133
onClicked: {
132134
wallet.recipients.add()
133135
}
134136
}
135-
NavButton {
137+
138+
IconButton {
136139
Layout.preferredWidth: 30
137140
Layout.preferredHeight: 30
138-
iconWidth: 20
139-
iconHeight: 20
141+
size: 30
140142
iconSource: "image://images/minus"
141-
visible: wallet.recipients.count > 1
143+
enabled: wallet.recipients.count > 1
142144
onClicked: {
143145
wallet.recipients.remove()
144146
}

0 commit comments

Comments
 (0)