| @@ -2,20 +2,17 @@ import QtQuick |
| 2 | 2 | | import Quickshell |
| 3 | 3 | | import Quickshell.Wayland |
| 4 | 4 | | import Quickshell.Hyprland |
| 5 | | − | import Quickshell.Bluetooth |
| 6 | | − | import Quickshell.Services.UPower |
| 7 | 5 | | |
| 8 | | − | // The home screen of one monitor (Bottom layer: above the wallpaper, under windows, never takes input): |
| 9 | | − | // a 300px Doto clock with a blinking colon, the date, a greeting, a meta line, and a bento of widgets |
| 10 | | − | // (Settings.homeWidgets, 3 x 3 cells of 220px; wide ones span cells, what doesn't fit is left out). |
| 11 | | − | // Laid out on a 1920 x 1080 canvas scaled to the screen. Clocks blink and the cover spins only while the workspace is empty. |
| 12 | | − | // After glyph-rice (github.com/Nebelung-cloud/glyph-rice, GPL-3.0), home/Home.qml. |
| 6 | + | // The desktop layer of one monitor (Bottom layer: above the wallpaper, under windows, never takes input), in the |
| 7 | + | // Nothing style: a Doto clock (colon blinks while the workspace is empty), the date in spaced caps behind the live dot, |
| 8 | + | // a stats line, what's playing; cava along the bottom as columns of dots while music plays (Settings.desktopViz). |
| 13 | 9 | | PanelWindow { |
| 14 | 10 | | id: win |
| 15 | 11 | | required property var modelData |
| 16 | 12 | | screen: modelData |
| 13 | + | readonly property bool showClock: Settings.desktopClock |
| 14 | + | readonly property bool showViz: Settings.desktopViz |
| 17 | 15 | | |
| 18 | | − | visible: Settings.desktopClock |
| 19 | 16 | | anchors { top: true; bottom: true; left: true; right: true } |
| 20 | 17 | | exclusionMode: ExclusionMode.Ignore |
| 21 | 18 | | color: "transparent" |
| @@ -28,361 +25,99 @@ PanelWindow { |
| 28 | 25 | | readonly property bool home: hmon && hmon.activeWorkspace ? hmon.activeWorkspace.toplevels.values.length === 0 : true |
| 29 | 26 | | |
| 30 | 27 | | SystemClock { id: clock; precision: SystemClock.Minutes } |
| 31 | | − | readonly property var en: Qt.locale("en_US") |
| 32 | | − | |
| 33 | | − | // blinking colon: two frames a second, not an animation on every vsync |
| 34 | | − | property bool dim: false |
| 35 | | − | Timer { running: win.home && Settings.blink && win.visible; interval: 500; repeat: true; onTriggered: win.dim = !win.dim } |
| 36 | | − | |
| 37 | 28 | | readonly property var player: Media.player |
| 38 | | − | function findBuds() { |
| 39 | | − | var l = Bluetooth.devices.values |
| 40 | | − | for (var i = 0; i < l.length; i++) if (l[i].connected && l[i].batteryAvailable) return l[i] |
| 41 | | − | return null |
| 42 | | − | } |
| 43 | | − | readonly property var buds: findBuds() |
| 44 | | − | readonly property var bat: UPower.displayDevice |
| 45 | | − | readonly property real batPct: bat && bat.isPresent ? (bat.percentage > 1 ? bat.percentage / 100 : bat.percentage) : 0 |
| 46 | 29 | | |
| 47 | | − | function week(d) { // ISO week |
| 48 | | − | var t = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate())) |
| 49 | | − | t.setUTCDate(t.getUTCDate() + 4 - (t.getUTCDay() || 7)) |
| 50 | | − | return Math.ceil(((t - Date.UTC(t.getUTCFullYear(), 0, 1)) / 86400000 + 1) / 7) |
| 51 | | − | } |
| 52 | | − | readonly property string hello: { |
| 53 | | − | var h = clock.date.getHours() |
| 54 | | − | return h < 5 ? "Good night" : h < 12 ? "Good morning" : h < 18 ? "Good afternoon" : "Good evening" |
| 55 | | − | } |
| 56 | | − | // widget id -> width in cells |
| 57 | | − | readonly property var kinds: ({ calendar: 1, cpu: 1, ram: 1, disk: 1, battery: 1, gpu: 1, player: 2, cava: 1, cat: 1, system: 3 }) |
| 58 | | − | function shows(id) { |
| 59 | | − | if (id === "cava") return Settings.desktopViz && Cava.available |
| 60 | | − | if (id === "battery") return bat !== null && bat.isPresent |
| 61 | | − | if (id === "gpu") return Gpu.mode !== "" |
| 62 | | − | return kinds[id] !== undefined |
| 63 | | − | } |
| 30 | + | // blinking colon: two frames a second, only while it can be seen |
| 31 | + | property bool dim: false |
| 32 | + | Timer { running: win.home && win.showClock && Settings.blink; interval: 500; repeat: true; onTriggered: win.dim = !win.dim } |
| 64 | 33 | | |
| 65 | | − | // the 1920 x 1080 canvas, scaled to the screen |
| 66 | | − | Item { |
| 67 | | − | id: stage |
| 68 | | − | readonly property real s: Math.min(win.width / 1920, win.height / 1080) |
| 69 | | − | width: win.width / s |
| 70 | | − | height: win.height / s |
| 71 | | − | scale: s |
| 72 | | − | transformOrigin: Item.TopLeft |
| 34 | + | Column { |
| 35 | + | visible: win.showClock |
| 36 | + | x: 56 |
| 37 | + | y: Theme.barHeight + 48 |
| 38 | + | spacing: 2 |
| 73 | 39 | | |
| 74 | 40 | | Row { |
| 75 | | − | x: 182 |
| 76 | | − | y: 150 |
| 77 | | − | Num { text: Theme.hh(clock.date); font.pixelSize: 300 } |
| 78 | | − | Num { text: ":"; font.pixelSize: 300; opacity: Settings.blink && win.dim ? 0.2 : 1 } |
| 79 | | − | Num { text: Qt.formatDateTime(clock.date, "mm"); font.pixelSize: 300 } |
| 80 | | − | } |
| 81 | | − | Lb { |
| 82 | | − | x: 190 |
| 83 | | − | y: 448 |
| 84 | | − | px: 14 |
| 85 | | − | text: win.en.toString(clock.date, "dddd · d MMMM") + " · week " + win.week(clock.date) |
| 86 | | − | } |
| 87 | | − | Text { |
| 88 | | − | x: 188 |
| 89 | | − | y: 560 |
| 90 | | − | textFormat: Text.StyledText |
| 91 | | − | text: win.hello + ",<br><font color=\"" + Theme.grey + "\">" + (Settings.name || Quickshell.env("USER") || "") + ".</font>" |
| 92 | | − | font.family: Theme.ui |
| 93 | | − | font.pixelSize: 54 |
| 94 | | − | font.weight: Font.Light |
| 95 | | − | font.letterSpacing: -1 |
| 96 | | − | lineHeight: 1.1 |
| 97 | | − | color: Theme.fg |
| 41 | + | Num { text: Theme.hh(clock.date); font.pixelSize: 96 } |
| 42 | + | Num { text: ":"; font.pixelSize: 96; opacity: Settings.blink && win.dim ? 0.2 : 1 } |
| 43 | + | Num { text: Qt.formatDateTime(clock.date, "mm"); font.pixelSize: 96 } |
| 98 | 44 | | } |
| 99 | 45 | | Row { |
| 100 | | − | x: 190 |
| 101 | | − | y: 716 |
| 102 | | − | spacing: 28 |
| 103 | | − | Meta { icon: Theme.iBell; text: Notifs.count + (Notifs.count === 1 ? " notification" : " notifications") } |
| 104 | | − | Meta { visible: win.buds !== null; icon: Theme.iHeadphones; text: win.buds ? (win.buds.name + " · " + Math.round(win.buds.battery * 100) + "%") : "" } |
| 105 | | − | Meta { visible: win.player !== null && win.player.isPlaying; icon: Theme.iMusic; text: win.player ? (win.player.trackTitle || "") : "" } |
| 106 | | − | } |
| 107 | | − | |
| 108 | | − | // bento: left to right, a widget that doesn't fit the row starts the next one, more than 3 rows are left out |
| 109 | | − | Repeater { |
| 110 | | − | model: { |
| 111 | | − | var out = [], r = 0, c = 0, l = Settings.homeWidgets |
| 112 | | − | for (var i = 0; i < l.length; i++) { |
| 113 | | − | var id = l[i], w = win.kinds[id] |
| 114 | | − | if (!w || !win.shows(id)) continue |
| 115 | | − | if (c + w > 3) { r++; c = 0 } |
| 116 | | − | if (r > 2) break |
| 117 | | − | out.push({ id: id, x: 1140 + c * 240, y: 150 + r * 240 }) |
| 118 | | − | c += w |
| 119 | | − | } |
| 120 | | − | return out |
| 121 | | − | } |
| 122 | | − | delegate: Loader { |
| 123 | | − | required property var modelData |
| 124 | | − | x: modelData.x |
| 125 | | − | y: modelData.y |
| 126 | | − | sourceComponent: ({ calendar: calendarW, cpu: cpuW, ram: ramW, disk: diskW, battery: batteryW, gpu: gpuW, |
| 127 | | − | player: playerW, cava: cavaW, cat: catW, system: systemW })[modelData.id] || null |
| 128 | | − | } |
| 129 | | − | } |
| 130 | | − | |
| 131 | | − | Component { |
| 132 | | − | id: calendarW |
| 133 | | − | W { |
| 134 | | − | Column { |
| 135 | | − | x: 24 |
| 136 | | − | y: 24 |
| 137 | | − | width: parent.width - 48 |
| 138 | | − | Lb { text: win.en.monthName(clock.date.getMonth()) } |
| 139 | | − | Num { topPadding: lead + 8; text: clock.date.getDate(); font.pixelSize: 118 } |
| 140 | | − | Row { |
| 141 | | − | width: parent.width |
| 142 | | − | topPadding: 14 |
| 143 | | − | Repeater { |
| 144 | | − | model: ["M", "T", "W", "T", "F", "S", "S"] |
| 145 | | − | Text { |
| 146 | | − | required property string modelData |
| 147 | | − | required property int index |
| 148 | | − | readonly property bool today: (clock.date.getDay() + 6) % 7 === index |
| 149 | | − | width: parent.width / 7 |
| 150 | | − | horizontalAlignment: Text.AlignHCenter |
| 151 | | − | text: modelData |
| 152 | | − | font.family: Theme.mono |
| 153 | | − | font.pixelSize: 11 |
| 154 | | − | color: today ? Theme.fill : Theme.grey |
| 155 | | − | Rectangle { |
| 156 | | − | visible: parent.today |
| 157 | | − | anchors.bottom: parent.bottom |
| 158 | | − | anchors.horizontalCenter: parent.horizontalCenter |
| 159 | | − | width: 10 |
| 160 | | − | height: 2 |
| 161 | | − | color: Theme.fill |
| 162 | | − | } |
| 163 | | − | } |
| 164 | | − | } |
| 165 | | − | } |
| 166 | | − | } |
| 167 | | − | } |
| 168 | | − | } |
| 169 | | − | Component { id: cpuW; RingW { f: SysStats.cpu; value: Math.round(SysStats.cpu * 100); label: "cpu %" } } |
| 170 | | − | Component { |
| 171 | | − | id: ramW |
| 172 | | − | RingW { |
| 173 | | − | f: SysStats.memTotal > 0 ? SysStats.memUsed / SysStats.memTotal : 0 |
| 174 | | − | value: Math.round(f * 100) |
| 175 | | − | label: "ram · " + SysStats.memUsed.toFixed(1) + "g" |
| 46 | + | topPadding: 14 |
| 47 | + | spacing: 12 |
| 48 | + | Rectangle { anchors.verticalCenter: parent.verticalCenter; width: 10; height: 10; radius: 5; color: Theme.live } |
| 49 | + | Lb { |
| 50 | + | anchors.verticalCenter: parent.verticalCenter |
| 51 | + | text: Qt.locale("en_US").toString(clock.date, "dddd · d MMMM") |
| 52 | + | px: 16 |
| 53 | + | color: Theme.fg |
| 176 | 54 | | } |
| 177 | 55 | | } |
| 178 | | − | Component { |
| 179 | | − | id: diskW |
| 180 | | − | RingW { |
| 181 | | − | readonly property var d: SysStats.disks.length ? SysStats.disks[0] : null |
| 182 | | − | f: d ? d.used / d.size : 0 |
| 183 | | − | value: Math.round(f * 100) |
| 184 | | − | label: "disk %" |
| 185 | | − | } |
| 186 | | − | } |
| 187 | | − | Component { |
| 188 | | − | id: batteryW |
| 189 | | − | RingW { |
| 190 | | − | readonly property bool charging: win.bat && win.bat.state === UPowerDeviceState.Charging |
| 191 | | − | f: win.batPct |
| 192 | | − | value: Math.round(win.batPct * 100) |
| 193 | | − | label: charging ? "charging" : "battery" |
| 194 | | − | on: !charging && win.batPct <= Settings.batLow / 100 ? Theme.err : Theme.fill |
| 195 | | − | } |
| 56 | + | Item { width: 1; height: 14 } |
| 57 | + | Row { |
| 58 | + | spacing: 22 |
| 59 | + | Stat { icon: Theme.iChip; text: Math.round(SysStats.cpu * 100) + "%" } |
| 60 | + | Stat { icon: Theme.iMem; text: SysStats.memUsed.toFixed(1) + " / " + SysStats.memTotal.toFixed(1) + "g" } |
| 61 | + | Stat { icon: Theme.iClock; text: "up " + Theme.fmtTime(SysStats.uptime) } |
| 196 | 62 | | } |
| 197 | | − | Component { |
| 198 | | − | id: gpuW |
| 199 | | − | W { |
| 200 | | − | round: true |
| 201 | | − | Column { |
| 202 | | − | anchors.centerIn: parent |
| 203 | | − | spacing: 14 |
| 204 | | − | Icon { anchors.horizontalCenter: parent.horizontalCenter; text: Theme.iGpu; font.pixelSize: 56; color: Theme.fill } |
| 205 | | − | Lb { anchors.horizontalCenter: parent.horizontalCenter; text: "gpu · " + Gpu.mode } |
| 206 | | − | } |
| 63 | + | Row { |
| 64 | + | topPadding: 8 |
| 65 | + | spacing: 10 |
| 66 | + | visible: win.player !== null && (win.player.trackTitle || "") !== "" |
| 67 | + | Icon { |
| 68 | + | anchors.verticalCenter: parent.verticalCenter |
| 69 | + | text: win.player && win.player.isPlaying ? Theme.iMusic : Theme.iPause |
| 70 | + | font.pixelSize: 15 |
| 71 | + | color: win.player && win.player.isPlaying ? Theme.fill : Theme.grey |
| 207 | 72 | | } |
| 208 | | − | } |
| 209 | | − | // the player: the cover as dots in a circle, spinning while it plays |
| 210 | | − | Component { |
| 211 | | − | id: playerW |
| 212 | | − | W { |
| 213 | | − | span: 2 |
| 214 | | − | Item { |
| 215 | | − | id: art |
| 216 | | − | x: 28 |
| 217 | | − | anchors.verticalCenter: parent.verticalCenter |
| 218 | | − | width: 164 |
| 219 | | − | height: 164 |
| 220 | | − | property real turn: 0 |
| 221 | | − | Timer { |
| 222 | | − | running: win.home && Media.playing |
| 223 | | − | interval: 33 |
| 224 | | − | repeat: true |
| 225 | | − | onTriggered: art.turn = (art.turn + 360 / 14 / 30) % 360 |
| 226 | | − | } |
| 227 | | − | DotArt { anchors.fill: parent; rotation: art.turn; url: win.player ? win.player.trackArtUrl : ""; step: 6 } |
| 228 | | − | } |
| 229 | | − | // MPRIS doesn't push the position: poke it while the progress shows |
| 230 | | − | Timer { |
| 231 | | − | running: win.home && Media.playing && Media.seekable |
| 232 | | − | interval: 1000 |
| 233 | | − | repeat: true |
| 234 | | − | onTriggered: win.player.positionChanged() |
| 235 | | − | } |
| 236 | | − | Column { |
| 237 | | − | anchors.left: art.right |
| 238 | | − | anchors.leftMargin: 26 |
| 239 | | − | anchors.right: parent.right |
| 240 | | − | anchors.rightMargin: 28 |
| 241 | | − | anchors.verticalCenter: parent.verticalCenter |
| 242 | | − | Lb { width: parent.width; elide: Text.ElideRight; text: "now playing · " + (win.player ? win.player.identity : "silence") } |
| 243 | | − | Text { |
| 244 | | − | width: parent.width |
| 245 | | − | topPadding: 10 |
| 246 | | − | elide: Text.ElideRight |
| 247 | | − | text: win.player ? (win.player.trackTitle || "Nothing on") : "Nothing on" |
| 248 | | − | font.family: Theme.ui |
| 249 | | − | font.pixelSize: 26 |
| 250 | | − | font.weight: Font.DemiBold |
| 251 | | − | color: Theme.fg |
| 252 | | − | } |
| 253 | | − | Text { |
| 254 | | − | width: parent.width |
| 255 | | − | elide: Text.ElideRight |
| 256 | | − | text: win.player ? (win.player.trackArtist || "") : "" |
| 257 | | − | font.family: Theme.ui |
| 258 | | − | font.pixelSize: 15 |
| 259 | | − | color: Theme.fgDim |
| 260 | | − | } |
| 261 | | − | Item { width: 1; height: 18 } |
| 262 | | − | Seg { |
| 263 | | − | width: parent.width |
| 264 | | − | height: 6 |
| 265 | | − | n: 24 |
| 266 | | − | f: win.player && win.player.lengthSupported && win.player.length > 0 ? win.player.position / win.player.length : 0 |
| 267 | | − | } |
| 268 | | − | Item { width: 1; height: 16 } |
| 269 | | − | PlayControls { size: 22; play: 52 } |
| 270 | | − | } |
| 73 | + | Text { |
| 74 | + | anchors.verticalCenter: parent.verticalCenter |
| 75 | + | text: win.player ? win.player.trackTitle + (win.player.trackArtist ? " · " + win.player.trackArtist : "") : "" |
| 76 | + | color: win.player && win.player.isPlaying ? Theme.fg : Theme.fgDim |
| 77 | + | font.family: Theme.ui |
| 78 | + | font.pixelSize: 15 |
| 271 | 79 | | } |
| 272 | 80 | | } |
| 273 | | − | // cava as a round Glyph Matrix: bass in the middle, highs to the sides, columns grow up and down from the middle |
| 274 | | − | Component { |
| 275 | | − | id: cavaW |
| 276 | | − | W { |
| 277 | | − | round: true |
| 278 | | − | Grid { |
| 279 | | − | anchors.centerIn: parent |
| 280 | | − | columns: 15 |
| 281 | | − | spacing: 4 |
| 282 | | − | Repeater { |
| 283 | | − | model: 15 * 15 |
| 284 | | − | Rectangle { |
| 285 | | − | required property int index |
| 286 | | − | readonly property int cx: index % 15 - 7 |
| 287 | | − | readonly property int cy: Math.floor(index / 15) - 7 |
| 288 | | − | readonly property int half: Math.floor(Math.sqrt(7.5 * 7.5 - cx * cx)) // half a column inside the circle |
| 289 | | − | readonly property int n: Cava.values.length |
| 290 | | − | readonly property real v: n ? Cava.values[Math.round(Math.abs(cx) / 7 * (n * 0.6 - 1))] || 0 : 0 |
| 291 | | − | width: 8 |
| 292 | | − | height: 8 |
| 293 | | − | radius: 4 |
| 294 | | − | // outside the circle: transparent, not invisible (Grid would close the gap) |
| 295 | | − | color: Math.abs(cy) > half ? "transparent" : Math.abs(cy) < v * (half + 1) ? Theme.fill : Theme.s3 |
| 296 | | − | } |
| 81 | + | } |
| 82 | + | |
| 83 | + | // visualizer: a column of dots per bar along the bottom, lit from the bottom up, the top dot of each column brightest |
| 84 | + | Row { |
| 85 | + | id: viz |
| 86 | + | visible: win.showViz && Cava.available && win.home |
| 87 | + | anchors.bottom: parent.bottom |
| 88 | + | anchors.bottomMargin: 18 |
| 89 | + | anchors.horizontalCenter: parent.horizontalCenter |
| 90 | + | readonly property int rows: 14 |
| 91 | + | readonly property real d: 6 |
| 92 | + | readonly property real gap: Math.max(2, (win.width - 72) / Cava.bars - d) |
| 93 | + | spacing: gap |
| 94 | + | Repeater { |
| 95 | + | model: Cava.bars |
| 96 | + | delegate: Column { |
| 97 | + | required property int index |
| 98 | + | readonly property real v: index < Cava.values.length ? Cava.values[index] : 0 |
| 99 | + | readonly property int lit: Math.round(v * viz.rows) |
| 100 | + | spacing: 4 |
| 101 | + | Repeater { |
| 102 | + | model: viz.rows |
| 103 | + | Rectangle { |
| 104 | + | required property int index |
| 105 | + | readonly property int up: viz.rows - index // rows .. 1, top to bottom |
| 106 | + | width: viz.d |
| 107 | + | height: viz.d |
| 108 | + | radius: viz.d / 2 |
| 109 | + | color: up === parent.lit ? Theme.fill : up < parent.lit ? Theme.fade(Theme.fill, 0.45) : Theme.fade(Theme.s3, 0.5) |
| 297 | 110 | | } |
| 298 | 111 | | } |
| 299 | 112 | | } |
| 300 | 113 | | } |
| 301 | | − | // the cat from the bar, big and as LED dots |
| 302 | | − | Component { |
| 303 | | − | id: catW |
| 304 | | − | W { |
| 305 | | − | CatLoop { |
| 306 | | − | anchors.centerIn: parent |
| 307 | | − | width: 180 |
| 308 | | − | height: 180 |
| 309 | | − | size: 120 |
| 310 | | − | layer.enabled: true |
| 311 | | − | layer.effect: DotMask { step: 5 } |
| 312 | | − | } |
| 313 | | − | } |
| 314 | | − | } |
| 315 | | − | // system: numbers, and the cpu history as a dot matrix |
| 316 | | − | Component { |
| 317 | | − | id: systemW |
| 318 | | − | W { |
| 319 | | − | span: 3 |
| 320 | | − | Grid { |
| 321 | | − | x: 34 |
| 322 | | − | anchors.verticalCenter: parent.verticalCenter |
| 323 | | − | columns: 2 |
| 324 | | − | columnSpacing: 10 |
| 325 | | − | rowSpacing: 22 |
| 326 | | − | Stat { label: "cpu"; value: Math.round(SysStats.cpu * 100) + "%" } |
| 327 | | − | Stat { label: "mem"; value: SysStats.memUsed.toFixed(1) + "G" } |
| 328 | | − | Stat { label: "up"; value: Math.floor(SysStats.uptime / 3600) + ":" + ("0" + Math.floor(SysStats.uptime / 60) % 60).slice(-2) } |
| 329 | | − | Stat { label: "disk"; value: SysStats.disks.length ? Math.round(SysStats.disks[0].used / SysStats.disks[0].size * 100) + "%" : "-" } |
| 330 | | − | } |
| 331 | | − | Column { |
| 332 | | − | x: 344 |
| 333 | | − | anchors.verticalCenter: parent.verticalCenter |
| 334 | | − | width: parent.width - x - 34 |
| 335 | | − | spacing: 12 |
| 336 | | − | Lb { text: "cpu · 40 s" } |
| 337 | | − | Spark { width: parent.width; height: 92; slots: 34; values: SysStats.history } |
| 338 | | − | } |
| 339 | | − | } |
| 340 | | − | } |
| 341 | 114 | | } |
| 342 | 115 | | |
| 343 | | − | // a bento cell: a square with radius 40, or a circle |
| 344 | | − | component W: Rectangle { |
| 345 | | − | property int span: 1 |
| 346 | | − | property bool round: false |
| 347 | | − | width: span * 220 + (span - 1) * 20 |
| 348 | | − | height: 220 |
| 349 | | − | radius: round ? 110 : 40 |
| 350 | | − | color: Theme.s1 |
| 351 | | − | border.width: 1 |
| 352 | | − | border.color: Theme.s2 |
| 353 | | − | } |
| 354 | | − | // round widget: a ring of dots lit by f, the number and a label inside |
| 355 | | − | component RingW: Rectangle { |
| 356 | | − | id: rw |
| 357 | | − | property real f |
| 358 | | − | property string value |
| 359 | | − | property string label |
| 360 | | − | property color on: Theme.fill |
| 361 | | − | width: 220 |
| 362 | | − | height: 220 |
| 363 | | − | radius: 110 |
| 364 | | − | color: Theme.s1 |
| 365 | | − | border.width: 1 |
| 366 | | − | border.color: Theme.s2 |
| 367 | | − | Ring { anchors.fill: parent; anchors.margins: 12; f: rw.f; on: rw.on } |
| 368 | | − | Column { |
| 369 | | − | anchors.centerIn: parent |
| 370 | | − | Num { anchors.horizontalCenter: parent.horizontalCenter; text: rw.value; font.pixelSize: 72 } |
| 371 | | − | Lb { anchors.horizontalCenter: parent.horizontalCenter; topPadding: 8; text: rw.label } |
| 372 | | − | } |
| 373 | | − | } |
| 374 | | − | component Meta: Row { |
| 116 | + | component Stat: Row { |
| 375 | 117 | | property string icon |
| 376 | 118 | | property string text |
| 377 | | − | spacing: 10 |
| 378 | | − | Icon { anchors.verticalCenter: parent.verticalCenter; text: parent.icon; font.pixelSize: 16 } |
| 379 | | − | Lb { anchors.verticalCenter: parent.verticalCenter; text: parent.text } |
| 380 | | − | } |
| 381 | | − | component Stat: Column { |
| 382 | | − | property string label |
| 383 | | − | property string value |
| 384 | | − | width: 130 |
| 385 | | − | Lb { text: parent.label } |
| 386 | | − | Num { topPadding: lead + 6; text: parent.value } |
| 119 | + | spacing: 8 |
| 120 | + | Icon { anchors.verticalCenter: parent.verticalCenter; text: parent.icon; font.pixelSize: 15; color: Theme.grey } |
| 121 | + | Lb { anchors.verticalCenter: parent.verticalCenter; text: parent.text; px: 12 } |
| 387 | 122 | | } |
| 388 | 123 | | } |