@@ -20,146 +20,136 @@ PageStack {
20
20
}
21
21
}
22
22
23
- initialItem: Page {
24
- id: root
25
- background: null
23
+ initialItem: RowLayout {
24
+ Page {
25
+ Layout .alignment : Qt .AlignCenter
26
+ Layout .fillHeight : true
27
+ Layout .fillWidth : true
28
+ Layout .maximumWidth : 600
29
+ Layout .margins : 20
30
+ id: root
31
+ background: null
26
32
27
- CoreText {
28
- id: title
29
- text: qsTr (" Activity" )
30
- anchors .left : listView .left
31
- anchors .top : parent .top
32
- anchors .topMargin : 20
33
- font .pixelSize : 21
34
- bold: true
35
- }
33
+ header: CoreText {
34
+ id: title
35
+ horizontalAlignment: Text .AlignLeft
36
+ text: qsTr (" Activity" )
37
+ font .pixelSize : 21
38
+ bold: true
39
+ }
36
40
37
- ListView {
38
- id: listView
39
- clip: true
40
- width: Math .min (parent .width - 40 , 600 )
41
- anchors .horizontalCenter : parent .horizontalCenter
42
- anchors .top : title .bottom
43
- anchors .bottom : parent .bottom
41
+ contentItem: ListView {
42
+ id: listView
43
+ clip: true
44
+ model: walletController .selectedWallet .activityListModel
45
+ delegate: ItemDelegate {
46
+ id: delegate
47
+ required property string address;
48
+ required property string amount;
49
+ required property string date;
50
+ required property int depth;
51
+ required property string label;
52
+ required property int status;
53
+ required property int type;
44
54
45
- model: walletController .selectedWallet .activityListModel
46
- delegate: ItemDelegate {
47
- id: delegate
48
- required property string address;
49
- required property string amount;
50
- required property string date;
51
- required property int depth;
52
- required property string label;
53
- required property int status;
54
- required property int type;
55
+ HoverHandler {
56
+ cursorShape: Qt .PointingHandCursor
57
+ }
55
58
56
- width: listView .width
57
- height: 51
59
+ onClicked: stackView .push (detailsPage)
58
60
59
- background: Item {
60
- Separator {
61
- anchors .bottom : parent .bottom
62
- width: parent .width
61
+ width: ListView .view .width
62
+
63
+ background: Item {
64
+ Separator {
65
+ anchors .bottom : parent .bottom
66
+ width: parent .width
67
+ }
63
68
}
64
- }
65
69
66
- contentItem: Item {
67
- Icon {
68
- id: directionIcon
69
- anchors .left : parent .left
70
- anchors .margins : 6
71
- anchors .verticalCenter : parent .verticalCenter
72
- source: {
73
- if (delegate .type == Transaction .RecvWithAddress
74
- || delegate .type == Transaction .RecvFromOther ) {
75
- " qrc:/icons/triangle-down"
76
- } else if (delegate .type == Transaction .Generated ) {
77
- " qrc:/icons/coinbase"
78
- } else {
79
- " qrc:/icons/triangle-up"
70
+ contentItem: RowLayout {
71
+ Icon {
72
+ Layout .alignment : Qt .AlignCenter
73
+ Layout .margins : 6
74
+ source: {
75
+ if (delegate .type == Transaction .RecvWithAddress
76
+ || delegate .type == Transaction .RecvFromOther ) {
77
+ " qrc:/icons/triangle-down"
78
+ } else if (delegate .type == Transaction .Generated ) {
79
+ " qrc:/icons/coinbase"
80
+ } else {
81
+ " qrc:/icons/triangle-up"
82
+ }
80
83
}
81
- }
82
- color: {
83
- if (delegate .status == Transaction .Confirmed ) {
84
- if (delegate .type == Transaction .RecvWithAddress ||
85
- delegate .type == Transaction .RecvFromOther ||
86
- delegate .type == Transaction .Generated ) {
87
- Theme .color .green
84
+ color: {
85
+ if (delegate .status == Transaction .Confirmed ) {
86
+ if (delegate .type == Transaction .RecvWithAddress ||
87
+ delegate .type == Transaction .RecvFromOther ||
88
+ delegate .type == Transaction .Generated ) {
89
+ Theme .color .green
90
+ } else {
91
+ Theme .color .orange
92
+ }
88
93
} else {
89
- Theme .color .orange
94
+ Theme .color .blue
90
95
}
91
- } else {
92
- Theme .color .blue
93
96
}
97
+ size: 14
94
98
}
95
- size: 14
96
- }
97
- CoreText {
98
- id: label
99
- anchors .left : directionIcon .right
100
- anchors .right : date .left
101
- anchors .margins : 6
102
- anchors .verticalCenter : parent .verticalCenter
103
- elide: Text .ElideMiddle
104
- text: {
105
- if (delegate .label != " " ) {
106
- delegate .label
107
- } else {
108
- delegate .address
99
+ CoreText {
100
+ Layout .alignment : Qt .AlignCenter
101
+ Layout .fillWidth : true
102
+ Layout .preferredWidth : 0
103
+ Layout .margins : 6
104
+ color: delegate .hovered ? Theme .color .orange : Theme .color .neutral9
105
+ elide: Text .ElideMiddle
106
+ text: {
107
+ if (delegate .label != " " ) {
108
+ delegate .label
109
+ } else {
110
+ delegate .address
111
+ }
109
112
}
113
+ font .pixelSize : 15
114
+ horizontalAlignment: Text .AlignLeft
115
+ clip: true
110
116
}
111
- font .pixelSize : 15
112
- horizontalAlignment: Text .AlignLeft
113
- clip: true
114
- }
115
117
116
- CoreText {
117
- id: date
118
- anchors .right : amount .left
119
- anchors .margins : 6
120
- anchors .verticalCenter : parent .verticalCenter
121
- text: delegate .date
122
- font .pixelSize : 15
123
- horizontalAlignment: Text .AlignRight
124
- }
118
+ CoreText {
119
+ Layout .alignment : Qt .AlignCenter
120
+ Layout .margins : 6
121
+ text: delegate .date
122
+ font .pixelSize : 15
123
+ horizontalAlignment: Text .AlignRight
124
+ }
125
125
126
- CoreText {
127
- id: amount
128
- anchors .right : parent .right
129
- anchors .margins : 6
130
- anchors .verticalCenter : parent .verticalCenter
131
- text: delegate .amount
132
- font .pixelSize : 15
133
- horizontalAlignment: Text .AlignRight
134
- color: {
135
- if (delegate .type == Transaction .RecvWithAddress
136
- || delegate .type == Transaction .RecvFromOther
137
- || delegate .type == Transaction .Generated ) {
138
- Theme .color .green
139
- } else {
140
- Theme .color .neutral9
126
+ CoreText {
127
+ Layout .alignment : Qt .AlignCenter
128
+ Layout .margins : 6
129
+ text: delegate .amount
130
+ font .pixelSize : 15
131
+ horizontalAlignment: Text .AlignRight
132
+ color: {
133
+ if (delegate .type == Transaction .RecvWithAddress
134
+ || delegate .type == Transaction .RecvFromOther
135
+ || delegate .type == Transaction .Generated ) {
136
+ Theme .color .green
137
+ } else {
138
+ Theme .color .neutral9
139
+ }
141
140
}
142
141
}
143
- }
144
-
145
- MouseArea {
146
- anchors .fill : parent
147
- onClicked: stackView .push (detailsPage)
148
- hoverEnabled: true
149
- onEntered: label .color = Theme .color .orange
150
- onExited: label .color = Theme .color .neutral9
151
- cursorShape: Qt .PointingHandCursor
152
- }
153
142
154
- Component {
155
- id: detailsPage
156
- ActivityDetails {
157
- amount: delegate .amount
158
- date: delegate .date
159
- depth: delegate .depth
160
- type: delegate .type
161
- status: delegate .status
162
- address: delegate .address
143
+ Component {
144
+ id: detailsPage
145
+ ActivityDetails {
146
+ amount: delegate .amount
147
+ date: delegate .date
148
+ depth: delegate .depth
149
+ type: delegate .type
150
+ status: delegate .status
151
+ address: delegate .address
152
+ }
163
153
}
164
154
}
165
155
}
0 commit comments