5
5
import QtQuick 2.15
6
6
import QtQuick.Controls 2.15
7
7
import QtQuick.Layouts 1.15
8
+ import org.bitcoincore.qt 1.0
8
9
import "../../controls"
9
10
import "../../components"
10
11
@@ -132,14 +133,53 @@ Page {
132
133
}
133
134
134
135
delegate: Item {
136
+ id: delegate
135
137
required property int nodeId;
136
138
required property string address;
137
139
required property string subversion;
138
140
required property string direction;
139
141
required property string connectionType;
140
142
required property string network;
143
+ property color stateColor;
141
144
implicitHeight: 60
142
145
implicitWidth: listView .width
146
+ state: " FILLED"
147
+
148
+ states: [
149
+ State {
150
+ name: " FILLED"
151
+ PropertyChanges { target: delegate; stateColor: Theme .color .neutral9 }
152
+ },
153
+ State {
154
+ name: " HOVER"
155
+ PropertyChanges { target: delegate; stateColor: Theme .color .orangeLight1 }
156
+ },
157
+ State {
158
+ name: " ACTIVE"
159
+ PropertyChanges { target: delegate; stateColor: Theme .color .orange }
160
+ }
161
+ ]
162
+
163
+ MouseArea {
164
+ anchors .fill : parent
165
+ hoverEnabled: AppMode .isDesktop
166
+ onEntered: {
167
+ delegate .state = " HOVER"
168
+ }
169
+ onExited: {
170
+ delegate .state = " FILLED"
171
+ }
172
+ onPressed: {
173
+ delegate .state = " ACTIVE"
174
+ }
175
+ onReleased: {
176
+ if (mouseArea .containsMouse ) {
177
+ delegate .state = " HOVER"
178
+ } else {
179
+ delegate .state = " FILLED"
180
+ }
181
+ }
182
+ }
143
183
144
184
Connections {
145
185
target: peerListModelProxy
@@ -200,7 +240,7 @@ Page {
200
240
Layout .alignment : Qt .AlignLeft
201
241
id: primary
202
242
font .pixelSize : 18
203
- color: Theme . color . neutral9
243
+ color: delegate . stateColor
204
244
}
205
245
CoreText {
206
246
Layout .alignment : Qt .AlignLeft
@@ -215,7 +255,7 @@ Page {
215
255
Layout .alignment : Qt .AlignRight
216
256
id: secondary
217
257
font .pixelSize : 18
218
- color: Theme . color . neutral9
258
+ color: delegate . stateColor
219
259
}
220
260
CoreText {
221
261
Layout .alignment : Qt .AlignRight
0 commit comments