@@ -30,12 +30,12 @@ ApplicationWindow {
30
30
31
31
// Takes care of loading all default plugins
32
32
Component .onCompleted : {
33
- var historyView = addPlugin (" ./views/history.qml" , {title : " History " })
34
- var newTxView = addPlugin (" ./views/transaction.qml" , {title : " New Transaction " })
35
- var chainView = addPlugin (" ./views/chain.qml" , {title : " Block chain " })
36
- var infoView = addPlugin (" ./views/info.qml" , {title : " Info " })
37
- var pendingTxView = addPlugin (" ./views/pending_tx.qml" , {title : " Pending " , canClose : true })
38
- var pendingTxView = addPlugin (" ./views/javascript.qml" , {title : " JavaScript " , canClose : true })
33
+ var historyView = addPlugin (" ./views/history.qml" , {default : true })
34
+ var newTxView = addPlugin (" ./views/transaction.qml" , {default : true })
35
+ var chainView = addPlugin (" ./views/chain.qml" , {default : true })
36
+ var infoView = addPlugin (" ./views/info.qml" , {default : true })
37
+ var pendingTxView = addPlugin (" ./views/pending_tx.qml" , {default : true })
38
+ var pendingTxView = addPlugin (" ./views/javascript.qml" , {default : true })
39
39
40
40
// Call the ready handler
41
41
gui .done ()
@@ -250,12 +250,17 @@ ApplicationWindow {
250
250
anchors .fill : parent
251
251
resizing: false
252
252
253
- function setView (view ) {
253
+ function setView (view , menu ) {
254
254
for (var i = 0 ; i < views .length ; i++ ) {
255
- views[i].visible = false
256
- }
255
+ views[i][0 ].visible = false
257
256
257
+ views[i][1 ].border .color = " #00000000"
258
+ views[i][1 ].color = " #00000000"
259
+ }
258
260
view .visible = true
261
+
262
+ menu .border .color = " #CCCCCC"
263
+ menu .color = " #FFFFFFFF"
259
264
}
260
265
261
266
function addComponent (component , options ) {
@@ -265,8 +270,9 @@ ApplicationWindow {
265
270
return ;
266
271
}
267
272
268
- menu .createMenuItem (view .iconFile , view, options);
269
- mainSplit .views .push (view);
273
+ var menuItem = menu .createMenuItem (view .iconFile , view, options);
274
+
275
+ mainSplit .views .push ([view, menuItem]);
270
276
271
277
return view
272
278
}
@@ -276,96 +282,91 @@ ApplicationWindow {
276
282
********************/
277
283
Rectangle {
278
284
id: menu
279
- Layout .minimumWidth : 80
280
- Layout .maximumWidth : 80
285
+ Layout .minimumWidth : 180
286
+ Layout .maximumWidth : 180
281
287
anchors .top : parent .top
282
- color: " #252525 "
288
+ color: " #ececec "
283
289
284
290
Component {
285
291
id: menuItemTemplate
286
- Image {
292
+ Rectangle {
293
+ id: menuItem
287
294
property var view;
288
- anchors .horizontalCenter : parent .horizontalCenter
289
- MouseArea {
290
- anchors .fill : parent
291
- onClicked: {
292
- mainSplit .setView (view)
293
- }
294
- }
295
- }
296
- }
297
295
298
- /*
299
- Component {
300
- id: menuItemTemplate
296
+ property alias title: label .text
297
+ property alias secondary: secondary .text
301
298
302
- RowLayout {
303
- property var view;
304
- property alias source: icon.source;
305
- property alias title: title.text
306
- height: 25
307
-
308
- id: tab
299
+ width: 180
300
+ height: 28
301
+ border .color : " #00000000"
302
+ border .width : 1
303
+ radius: 5
304
+ color: " #00000000"
309
305
310
306
anchors {
311
307
left: parent .left
312
- right: parent.right
308
+ leftMargin : 4
313
309
}
314
310
315
311
Image {
316
312
id: icon
317
- //anchors.horizontalCenter: parent.horizontalCenter
318
- }
319
-
320
- MouseArea {
321
- anchors.fill: parent
322
- onClicked: {
323
- mainSplit.setView(view)
313
+ anchors {
314
+ left: parent .left
315
+ verticalCenter: parent .verticalCenter
324
316
}
317
+ source: " ../pick.png"
325
318
}
326
319
327
- Rectangle {
328
- color: "#bbbbbb"
329
- Label {
330
- id: title
331
- y: parent.height / 2 - this.height / 2
332
- //x: 5
333
- font.pixelSize: 10
320
+ Text {
321
+ id: label
322
+ anchors {
323
+ left: icon .right
324
+ verticalCenter: parent .verticalCenter
334
325
}
335
326
327
+ text: " Chain"
328
+ font .bold : true
329
+ color: " #0D0A01"
330
+ font .pixelSize : 12
331
+ }
336
332
337
- Image {
338
- id: closeButton
339
- y: parent.height / 2 - this.height / 2
340
- visible: false
341
-
342
- source: "../close.png"
343
- anchors {
344
- right: parent.right
345
- rightMargin: 5
346
- }
333
+ Text {
334
+ id: secondary
335
+ anchors {
336
+ right : parent . right
337
+ rightMargin : 8
338
+ verticalCenter : parent . verticalCenter
339
+ }
340
+ color : " #AEADBE "
341
+ font . pixelSize : 12
342
+ }
347
343
348
- MouseArea {
349
- anchors.fill: parent
350
- onClicked: {
351
- console.log("should close")
352
- }
353
- }
344
+ MouseArea {
345
+ anchors .fill : parent
346
+ onClicked: {
347
+ mainSplit .setView (view, menuItem)
354
348
}
355
349
}
356
350
}
357
351
}
358
- */
359
352
360
353
function createMenuItem (icon , view , options ) {
361
354
if (options === undefined ) {
362
355
options = {};
363
356
}
364
357
365
- var comp = menuItemTemplate .createObject (menuColumn)
358
+ if (options .default ) {
359
+ var comp = menuItemTemplate .createObject (menuDefault)
360
+ }
361
+
366
362
comp .view = view
367
- comp .source = icon
368
- // comp.title = options.title
363
+ comp .title = view .title
364
+ if (view .secondary !== undefined ) {
365
+ comp .secondary = view .secondary
366
+ }
367
+
368
+ return comp
369
+
369
370
/*
370
371
if(options.canClose) {
371
372
//comp.closeButton.visible = options.canClose
@@ -375,10 +376,87 @@ ApplicationWindow {
375
376
376
377
ColumnLayout {
377
378
id: menuColumn
378
- y: 50
379
+ y: 30
380
+ width: parent .width
379
381
anchors .left : parent .left
380
382
anchors .right : parent .right
381
- spacing: 10
383
+ spacing: 3
384
+
385
+ Text {
386
+ text: " ETHEREUM"
387
+ font .bold : true
388
+ anchors {
389
+ left: parent .left
390
+ leftMargin: 5
391
+ }
392
+ color: " #888888"
393
+ }
394
+
395
+ ColumnLayout {
396
+ id: menuDefault
397
+ spacing: 3
398
+ anchors {
399
+ left: parent .left
400
+ right: parent .right
401
+ }
402
+ }
403
+
404
+ Text {
405
+ text: " APPS"
406
+ font .bold : true
407
+ anchors {
408
+ left: parent .left
409
+ leftMargin: 5
410
+ }
411
+ color: " #888888"
412
+ }
413
+
414
+ /*
415
+ Rectangle {
416
+ width: 180
417
+ height: 28
418
+ border.color: "#CCCCCC"
419
+ border.width: 1
420
+ radius: 5
421
+ color: "#FFFFFF"
422
+
423
+ anchors {
424
+ left: parent.left
425
+ leftMargin: 4
426
+ }
427
+
428
+ Image {
429
+ id: icon
430
+ anchors {
431
+ left: parent.left
432
+ verticalCenter: parent.verticalCenter
433
+ }
434
+ source: "../pick.png"
435
+ }
436
+
437
+ Text {
438
+ anchors {
439
+ left: icon.right
440
+ verticalCenter: parent.verticalCenter
441
+ }
442
+
443
+ text: "Wallet"
444
+ font.bold: true
445
+ color: "#0D0A01"
446
+ }
447
+
448
+ Text {
449
+ anchors {
450
+ right: parent.right
451
+ rightMargin: 8
452
+ verticalCenter: parent.verticalCenter
453
+ }
454
+ color: "#AEADBE"
455
+ text: "12e15 Ξ"
456
+ font.pixelSize: 12
457
+ }
458
+ }
459
+ */
382
460
}
383
461
}
384
462
0 commit comments