55import QtQuick 2.15
66import QtQuick.Controls 2.15
77import QtQuick.Layouts 1.15
8+ import Qt.labs.settings 1.0
89
910import org.bitcoincore.qt 1.0
1011
1112import "../controls"
1213
1314Item {
1415 id: root
16+ property real parentWidth: 600
17+ property real parentHeight: 600
1518
16- implicitWidth : 200
17- implicitHeight : 200
19+ width : dial . width
20+ height : dial . height + networkIndicator . height + networkIndicator . anchors . topMargin
1821
1922 property alias header: mainText .text
2023 property alias headerSize: mainText .font .pixelSize
@@ -26,9 +29,18 @@ Item {
2629
2730 activeFocusOnTab: true
2831
32+ Settings {
33+ id: settings
34+ property alias blockclocksize: dial .scale
35+ }
36+
2937 BlockClockDial {
3038 id: dial
31- anchors .fill : parent
39+ anchors .horizontalCenter : root .horizontalCenter
40+ scale: Theme .blockclocksize
41+ width: Math .min ((root .parentWidth * dial .scale ), (root .parentHeight * dial .scale ))
42+ height: dial .width
43+ penWidth: dial .width / 50
3244 timeRatioList: chainModel .timeRatioList
3345 verificationProgress: nodeModel .verificationProgress
3446 paused: root .paused
5668 background: null
5769 icon .source : " image://images/bitcoin-circle"
5870 icon .color : Theme .color .neutral9
59- icon .width : 40
60- icon .height : 40
71+ icon .width : Math . max ( dial . width / 5 , 1 )
72+ icon .height : Math . max ( dial . width / 5 , 1 )
6173 anchors .bottom : mainText .top
6274 anchors .horizontalCenter : root .horizontalCenter
6375
@@ -68,10 +80,10 @@ Item {
6880
6981 Label {
7082 id: mainText
71- anchors .centerIn : parent
83+ anchors .centerIn : dial
7284 font .family : " Inter"
7385 font .styleName : " Semi Bold"
74- font .pixelSize : 32
86+ font .pixelSize : dial . width * ( 4 / 25 )
7587 color: Theme .color .neutral9
7688
7789 Behavior on color {
8597 anchors .horizontalCenter : root .horizontalCenter
8698 font .family : " Inter"
8799 font .styleName : " Semi Bold"
88- font .pixelSize : 18
100+ font .pixelSize : dial . width * ( 9 / 100 )
89101 color: Theme .color .neutral4
90102
91103 Behavior on color {
@@ -95,13 +107,22 @@ Item {
95107
96108 PeersIndicator {
97109 anchors .top : subText .bottom
98- anchors .topMargin : 20
110+ anchors .topMargin : dial . width / 10
99111 anchors .horizontalCenter : root .horizontalCenter
100112 numOutboundPeers: nodeModel .numOutboundPeers
101113 maxNumOutboundPeers: nodeModel .maxNumOutboundPeers
114+ indicatorDimensions: dial .width * (3 / 200 )
115+ indicatorSpacing: dial .width / 40
102116 paused: root .paused
103117 }
104118
119+ NetworkIndicator {
120+ id: networkIndicator
121+ anchors .top : dial .bottom
122+ anchors .topMargin : networkIndicator .visible ? 30 : 0
123+ anchors .horizontalCenter : root .horizontalCenter
124+ }
125+
105126 MouseArea {
106127 anchors .fill : dial
107128 cursorShape: Qt .PointingHandCursor
@@ -138,16 +159,16 @@ Item {
138159 PropertyChanges {
139160 target: root
140161 header: " Paused"
141- headerSize: 24
162+ headerSize: dial . width * ( 3 / 25 )
142163 subText: " Tap to resume"
143164 }
144165 PropertyChanges {
145166 target: bitcoinIcon
146- anchors .bottomMargin : 5
167+ anchors .bottomMargin : dial . width / 40
147168 }
148169 PropertyChanges {
149170 target: subText
150- anchors .topMargin : 4
171+ anchors .topMargin : dial . width / 50
151172 }
152173 },
153174
@@ -156,16 +177,16 @@ Item {
156177 PropertyChanges {
157178 target: root
158179 header: " Connecting"
159- headerSize: 24
180+ headerSize: dial . width * ( 3 / 25 )
160181 subText: " Please wait"
161182 }
162183 PropertyChanges {
163184 target: bitcoinIcon
164- anchors .bottomMargin : 5
185+ anchors .bottomMargin : dial . width / 40
165186 }
166187 PropertyChanges {
167188 target: subText
168- anchors .topMargin : 4
189+ anchors .topMargin : dial . width / 50
169190 }
170191 }
171192 ]
0 commit comments