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
@@ -122,14 +123,53 @@ Page {
122
123
}
123
124
124
125
delegate: Item {
126
+ id: delegate
125
127
required property int nodeId;
126
128
required property string address;
127
129
required property string subversion;
128
130
required property string direction;
129
131
required property string connectionType;
130
132
required property string network;
133
+ property color stateColor;
131
134
implicitHeight: 60
132
135
implicitWidth: listView .width
136
+ state: " FILLED"
137
+
138
+ states: [
139
+ State {
140
+ name: " FILLED"
141
+ PropertyChanges { target: delegate; stateColor: Theme .color .neutral9 }
142
+ },
143
+ State {
144
+ name: " HOVER"
145
+ PropertyChanges { target: delegate; stateColor: Theme .color .orangeLight1 }
146
+ },
147
+ State {
148
+ name: " ACTIVE"
149
+ PropertyChanges { target: delegate; stateColor: Theme .color .orange }
150
+ }
151
+ ]
152
+
153
+ MouseArea {
154
+ anchors .fill : parent
155
+ hoverEnabled: AppMode .isDesktop
156
+ onEntered: {
157
+ delegate .state = " HOVER"
158
+ }
159
+ onExited: {
160
+ delegate .state = " FILLED"
161
+ }
162
+ onPressed: {
163
+ delegate .state = " ACTIVE"
164
+ }
165
+ onReleased: {
166
+ if (mouseArea .containsMouse ) {
167
+ delegate .state = " HOVER"
168
+ } else {
169
+ delegate .state = " FILLED"
170
+ }
171
+ }
172
+ }
133
173
134
174
Connections {
135
175
target: peerListModelProxy
@@ -190,7 +230,7 @@ Page {
190
230
Layout .alignment : Qt .AlignLeft
191
231
id: primary
192
232
font .pixelSize : 18
193
- color: Theme . color . neutral9
233
+ color: delegate . stateColor
194
234
}
195
235
CoreText {
196
236
Layout .alignment : Qt .AlignLeft
@@ -205,7 +245,7 @@ Page {
205
245
Layout .alignment : Qt .AlignRight
206
246
id: secondary
207
247
font .pixelSize : 18
208
- color: Theme . color . neutral9
248
+ color: delegate . stateColor
209
249
}
210
250
CoreText {
211
251
Layout .alignment : Qt .AlignRight
0 commit comments