12 - required property QtObject theme
13 - required property QtObject surfaces
14 - required property QtObject niriService
15 - required property QtObject timeService
16 - property QtObject caldavService
17 - required property QtObject resourceService
18 - required property QtObject notificationService
19 - required property QtObject trayService
20 - required property QtObject mediaService
21 - required property QtObject clipboardService
22 - required property QtObject launcherService
23 - required property QtObject audioService
24 - required property QtObject brightnessService
25 - required property QtObject networkService
26 - required property QtObject bluetoothService
27 - required property QtObject powerService
28 - required property QtObject lockService
12 + readonly property
var sys: Sys
14 + required property Theme theme
15 + required property SurfaceManager surfaces
16 + required property Niri niriService
17 + required property Time timeService
18 + property CalDav caldavService
19 + required property Resources resourceService
20 + required property Notifications notificationService
21 + required property Tray trayService
22 + required property Media mediaService
23 + required property Clipboard clipboardService
24 + required property Launcher launcherService
25 + required property Audio audioService
26 + required property Brightness brightnessService
27 + required property Network networkService
28 + required property Bluetooth bluetoothService
29 + required property Power powerService
30 + required property Lock lockService
29 31 required property
var barWindow
30 32 readonly property
var contentSize: surfaces
? surfaces.popoutContentSize(surfaces.popoutName)
: ({
34 36 readonly property
var popupAnchorRect: surfaces
? surfaces.popupWindowAnchorRect()
: ({
40 42 readonly property
var cardFrame: surfaces
? surfaces.popupCardFrame(surfaces.popoutProgress)
: ({
49 51 readonly property
var currentRect: cardFrame.currentRect
50 52 readonly property string
activeName: surfaces
? surfaces.popoutName
: "" 51 53 readonly property string
removingName: surfaces
? surfaces.removingLoaderName
: "" 55 57 readonly property int surfaceWidth: surfaces
&& surfaces.screenWidth
> 0 ? (root.vertical
? Math.
max(
1, surfaces.screenWidth
- surfaces.barHeight)
: surfaces.screenWidth)
: contentSize.width
56 58 readonly property int surfaceHeight: surfaces
&& surfaces.screenHeight
> 0 ? (root.vertical
? surfaces.screenHeight
: Math.
max(
1, surfaces.screenHeight
- surfaces.barHeight))
: contentSize.height
60 + function screenByName(name) {
61 + const want
= String(name
|| "");
62 + const screens
= Quickshell.screens;
63 + for (
let i
= 0; i
< screens.length; i
++)
64 + if (
String(screens[i].name)
=== want)
67 + return root.barWindow
? root.barWindow.screen
: null;
58 70 function contentComponent(name) {
59 71 switch (
String(name)) {
87 99 visible: surfaces
&& (surfaces.popoutOpen
|| surfaces.popoutClosing)
88 - screen: root.barWindow
? root.barWindow.screen
: null 100 + screen: root.screenByName(root.surfaces
? root.surfaces.popoutOutput
: "")
89 101 implicitWidth: root.surfaceWidth
90 102 implicitHeight: root.surfaceHeight
91 103 color:
"transparent" 96 108 onVisibleChanged: {
97 109 if (
!visible
&& root.surfaces
&& root.surfaces.popoutOpen
&& !root.surfaces.popoutClosing)
98 110 root.surfaces.closePopout(
"focus-grab-outside");
102 113 if (root.surfaces)
103 114 root.surfaces.closePopout(
"popup-closed");
118 128 if (root.surfaces)
119 129 root.surfaces.closePopout(
"escape-key");
140 149 width: popoutInputRegion.width
141 150 height: popoutInputRegion.height
142 151 acceptedButtons:
Qt.LeftButton
| Qt.RightButton
| Qt.MiddleButton
143 - onPressed: (mouse)
=> {
152 + onPressed: mouse =
> {
172 181 onVisibleChanged: {
174 183 forceActiveFocus();
177 - Keys.onEscapePressed: (event)
=> {
185 + Keys.onEscapePressed: event =
> {
178 186 event.accepted
= true;
179 187 if (root.surfaces)
180 188 root.surfaces.
closePopout(
"escape-key");
206 213 duration: root.theme
&& root.theme.lowPowerMode
? 0 : 180 207 214 easing.type:
Easing.OutCubic
223 228 duration: root.theme
&& root.theme.lowPowerMode
? 0 : 180 224 229 easing.type:
Easing.OutCubic
237 238 duration: root.theme
&& root.theme.lowPowerMode
? 0 : 130 238 239 easing.type:
Easing.InOutCubic
243 243 Behavior on opacity {
245 245 duration: root.theme
&& root.theme.lowPowerMode
? 0 : 90 246 246 easing.type:
Easing.InOutCubic
259 - property
var state: root.timeService
? Util.parseJson(root.timeService.stateJson(), {
257 + property
var panelState: root.timeService
? Util.parseJson(root.timeService.stateJson(), {})
: ({})
262 258 property date
localNow:
new Date()
263 259 property
var calendar: root.timeService
? Util.parseJson(root.timeService.calendar(localNow.getFullYear(), localNow.getMonth()
+ 1, localNow.getDate()), {
268 264 property
var days: calendar.weeks
? [].concat.apply([], calendar.weeks)
: []
270 266 readonly property bool
setupMode: root.caldavService
&& root.caldavService.status
=== "needs-setup" 298 294 for (const k
in map)
299 - map[k].sort(
function (a, b) {
return (b.allDay
? 1 : 0)
- (a.allDay
? 1 : 0); });
295 + map[k].sort(
function (a, b) {
296 + return (b.allDay
? 1 : 0)
- (a.allDay
? 1 : 0);
304 302 readonly property var bandLayout: {
305 303 const gs
= root.caldavService
? root.caldavService.gridStartDate()
: null;
307 - return {
"segments": [],
"laneCount":
0 };
308 309 return Ical.buildSegments(caldavEvents
|| [], gs);
311 312 readonly property string todayIso: {
312 313 const d
= clockCol.localNow;
313 - function p(n) {
return (n
< 10 ? "0" : "")
+ n; }
314 - return d.getFullYear()
+ "-" + p(d.getMonth()
+ 1)
+ "-" + p(d.getDate());
314 + const month
= d.getMonth()
+ 1;
315 + const day
= d.getDate();
316 + return d.getFullYear()
+ "-" + (month
< 10 ? "0" : "")
+ month
+ "-" + (day
< 10 ? "0" : "")
+ day;
317 319 readonly property var todayItems: {
333 335 width: parent
? parent.width
: 0 335 - Component.onCompleted:
if (root.caldavService) root.caldavService.refresh()
337 + Component.onCompleted:
if (root.caldavService)
338 + root.caldavService.refresh()
338 341 width: parent
? parent.width
: 0 339 342 horizontalAlignment:
Text.AlignHCenter
340 343 theme: root.theme
342 - text: clockCol.state.clock
? clockCol.state.clock.statusDisplay
: "--:--:--" 345 + text: clockCol.panelState.clock
? clockCol.panelState.clock.statusDisplay
: "--:--:--" 347 350 horizontalAlignment:
Text.AlignHCenter
348 351 theme: root.theme
350 - text: (clockCol.state.date
? clockCol.state.date.line
: "calendar")
+ (root.caldavService
&& root.caldavService.stale
? " ·" : "")
353 + text: (clockCol.panelState.date
? clockCol.panelState.date.line
: "calendar")
+ (root.caldavService
&& root.caldavService.stale
? " ·" : "")
383 386 opacity: index
>= 5 ? 0.4 : 0.7 393 393 width: monthGrid.width
394 394 height: monthGrid.height
399 - objectName:
"calendar-grid" 401 - spacing: clockCol.gridSpacing
404 - model: clockCol.days
409 - readonly property
var markers: clockCol.eventsByDate[modelData.iso]
|| []
411 - width: clockCol.cellW
412 - height: clockCol.cellH
416 - visible:
!!modelData.today
417 - anchors.horizontalCenter: parent.horizontalCenter
418 - anchors.verticalCenter: parent.verticalCenter
419 - anchors.verticalCenterOffset:
-5 423 - color: root.theme
? root.theme.ui.accent
: "transparent" 427 - anchors.horizontalCenter: parent.horizontalCenter
428 - anchors.verticalCenter: parent.verticalCenter
429 - anchors.verticalCenterOffset:
-5 432 - text: modelData.day
? String(modelData.day)
: "" 433 - color: modelData.today
&& root.theme
? root.theme.content.backdrop
: (root.theme
? root.theme.content.normal
: "white")
434 - opacity: modelData.inMonth
? 1 : 0.3 439 - anchors.horizontalCenter: parent.horizontalCenter
440 - anchors.bottom: parent.bottom
441 - anchors.bottomMargin:
7 399 + objectName:
"calendar-grid" 401 + spacing: clockCol.gridSpacing
445 - model:
Math.
min(cell.markers.length,
3)
404 + model: clockCol.days
409 + readonly property
var markers: clockCol.eventsByDate[modelData.iso]
|| []
411 + width: clockCol.cellW
412 + height: clockCol.cellH
416 + visible:
!!modelData.today
417 + anchors.horizontalCenter: parent.horizontalCenter
418 + anchors.verticalCenter: parent.verticalCenter
419 + anchors.verticalCenterOffset:
-5 423 + color: root.theme
? root.theme.ui.accent
: "transparent" 427 + anchors.horizontalCenter: parent.horizontalCenter
428 + anchors.verticalCenter: parent.verticalCenter
429 + anchors.verticalCenterOffset:
-5 432 + text: modelData.day
? String(modelData.day)
: "" 433 + color: modelData.today
&& root.theme
? root.theme.content.backdrop
: (root.theme
? root.theme.content.normal
: "white")
434 + opacity: modelData.inMonth
? 1 : 0.3 439 + anchors.horizontalCenter: parent.horizontalCenter
440 + anchors.bottom: parent.bottom
441 + anchors.bottomMargin:
7 445 + model:
Math.
min(cell.markers.length,
3)
448 + readonly property
var m: cell.markers[index]
449 + readonly property bool
overflow: index
=== 2 && cell.markers.length
> 3 451 + width: overflow
? 5 : (m.allDay
? 8 : 4)
454 + color: overflow
? (root.theme
? root.theme.content.minor
: "gray")
: m.color
466 + anchors.fill: monthGrid
470 + model: clockCol.bandLayout.segments
448 - readonly property
var m: cell.markers[index]
449 - readonly property bool
overflow: index
=== 2 && cell.markers.length
> 3 473 + readonly property
var seg: modelData
451 - width: overflow
? 5 : (m.allDay
? 8 : 4)
454 - color: overflow
? (root.theme
? root.theme.content.minor
: "gray")
: m.color
475 + x: seg.colStart
* clockCol.pitchX
476 + y: seg.row
* clockCol.pitchY
+ clockCol.cellH
- 17 - seg.lane
* 9 477 + width: (seg.colEnd
- seg.colStart
+ 1)
* clockCol.pitchX
- clockCol.gridSpacing
479 + color:
Qt.alpha(seg.color,
0.9)
480 + topLeftRadius: seg.roundLeft
? 3 : 0 481 + bottomLeftRadius: seg.roundLeft
? 3 : 0 482 + topRightRadius: seg.roundRight
? 3 : 0 483 + bottomRightRadius: seg.roundRight
? 3 : 0 471 - anchors.fill: monthGrid
475 - model: clockCol.bandLayout.segments
478 - readonly property
var seg: modelData
480 - x: seg.colStart
* clockCol.pitchX
481 - y: seg.row
* clockCol.pitchY
+ clockCol.cellH
- 17 - seg.lane
* 9 482 - width: (seg.colEnd
- seg.colStart
+ 1)
* clockCol.pitchX
- clockCol.gridSpacing
484 - color:
Qt.alpha(seg.color,
0.9)
485 - topLeftRadius: seg.roundLeft
? 3 : 0 486 - bottomLeftRadius: seg.roundLeft
? 3 : 0 487 - topRightRadius: seg.roundRight
? 3 : 0 488 - bottomRightRadius: seg.roundRight
? 3 : 0 511 501 width: clockCol.gridW
515 - model: clockCol.todayItems
505 + model: clockCol.todayItems
521 - anchors.verticalCenter: parent.verticalCenter
525 - color: modelData.color
511 + anchors.verticalCenter: parent.verticalCenter
515 + color: modelData.color
532 - const ev
= modelData;
533 - const mark
= ev.kind
=== "task" ? (ev.done
? "✓ " : "○ ")
: "";
535 - if (
!ev.allDay
&& ev.startMs
!= null) {
536 - const d
= new Date(ev.startMs);
537 - const p = function (n) {
return (n
< 10 ? "0" : "")
+ n; };
538 - t
= p(d.getHours())
+ ":" + p(d.getMinutes())
+ " ";
522 + const ev
= modelData;
523 + const mark
= ev.kind
=== "task" ? (ev.done
? "✓ " : "○ ")
: "";
525 + if (
!ev.allDay
&& ev.startMs
!= null) {
526 + const d
= new Date(ev.startMs);
527 + const p = function (n) {
528 + return (n
< 10 ? "0" : "")
+ n;
530 + t
= p(d.getHours())
+ ":" + p(d.getMinutes())
+ " ";
532 + return t
+ mark
+ (ev.summary
|| "(ohne Titel)");
540 - return t
+ mark
+ (ev.summary
|| "(ohne Titel)");
539 + visible: clockCol.todayItems.length
=== 0 542 + text:
"Keine Termine" 549 - visible: clockCol.todayItems.length
=== 0 552 - text:
"Keine Termine" 571 - onVisibleChanged:
if (visible)
Qt.callLater(urlField.field.forceActiveFocus)
572 - Component.onCompleted:
if (visible)
Qt.callLater(urlField.field.forceActiveFocus)
574 - component
Field:
Rectangle {
575 - property alias
field: ti
576 - property string
placeholder:
"" 577 - property bool
secret:
false 579 - width: setupForm.width
582 - color: root.theme
? root.theme.withAlpha(root.theme.ui.minor,
0.14)
: "transparent" 587 - anchors.fill: parent
588 - anchors.leftMargin:
10 589 - anchors.rightMargin:
10 590 - verticalAlignment:
TextInput.AlignVCenter
591 - color: root.theme
? root.theme.content.normal
: "white" 592 - selectionColor: root.theme
? root.theme.ui.focus
: "#ffffff" 593 - selectedTextColor: root.theme
? root.theme.content.backdrop
: "black" 594 - font.family:
"IBM Plex Sans" 596 - echoMode: parent.secret
? TextInput.Password
: TextInput.Normal
601 - anchors.left: parent.left
602 - anchors.leftMargin:
10 603 - anchors.verticalCenter: parent.verticalCenter
604 - visible: ti.text.length
=== 0 607 - text: parent.placeholder
559 + onVisibleChanged:
if (visible)
560 + Qt.callLater(urlField.field.forceActiveFocus)
561 + Component.onCompleted:
if (visible)
562 + Qt.callLater(urlField.field.forceActiveFocus)
613 565 theme: root.theme
651 603 anchors.fill: parent
652 604 cursorShape:
Qt.PointingHandCursor
653 - onClicked:
if (root.caldavService) root.caldavService.saveSetup(urlField.field.text, userField.field.text, pwField.field.text)
605 + onClicked:
if (root.caldavService)
606 + root.caldavService.saveSetup(urlField.field.text, userField.field.text, pwField.field.text)
662 614 color: root.theme
? root.theme.error
: "red" 663 615 text: root.caldavService
? root.caldavService.secretError
: "" 621 + component
Field:
Rectangle {
622 + property alias
field: ti
623 + property string
placeholder:
"" 624 + property bool
secret:
false 626 + width: setupForm.width
629 + color: root.theme
? root.theme.withAlpha(root.theme.ui.minor,
0.14)
: "transparent" 634 + anchors.fill: parent
635 + anchors.leftMargin:
10 636 + anchors.rightMargin:
10 637 + verticalAlignment:
TextInput.AlignVCenter
638 + color: root.theme
? root.theme.content.normal
: "white" 639 + selectionColor: root.theme
? root.theme.ui.focus
: "#ffffff" 640 + selectedTextColor: root.theme
? root.theme.content.backdrop
: "black" 641 + font.family:
"IBM Plex Sans" 643 + echoMode: parent.secret
? TextInput.Password
: TextInput.Normal
648 + anchors.left: parent.left
649 + anchors.leftMargin:
10 650 + anchors.verticalCenter: parent.verticalCenter
651 + visible: ti.text.length
=== 0 654 + text: parent.placeholder
680 666 readonly property var rs: root.resourceService
681 - readonly property
var identity: rs
? rs.identity
: ({
667 + readonly property
var identity: rs
? rs.identity
: ({})
685 670 readonly property
var issueList: {
704 689 Component.onCompleted: {
706 691 rs.popoutOpen
= true;
709 693 Component.onDestruction: {
711 695 rs.popoutOpen
= false;
935 914 const ring
= systemPanel.rs.netRing
|| [];
937 - for (let i
= 0; i
< ring.length; i
++) m
= Math.
max(m,
Number(ring[i])
|| 0)
916 + for (let i
= 0; i
< ring.length; i
++)
917 + m
= Math.
max(m,
Number(ring[i])
|| 0);
938 918 const cur
= systemPanel.rs.networkRxRate
+ systemPanel.rs.networkTxRate;
939 919 return m
> 0 ? Math.
min(
1, cur
/ m)
: 0;
958 938 const ring
= systemPanel.rs.diskRing
|| [];
960 - for (let i
= 0; i
< ring.length; i
++) m
= Math.
max(m,
Number(ring[i])
|| 0)
940 + for (let i
= 0; i
< ring.length; i
++)
941 + m
= Math.
max(m,
Number(ring[i])
|| 0);
961 942 const cur
= systemPanel.rs.diskReadRate
+ systemPanel.rs.diskWriteRate;
962 943 return m
> 0 ? Math.
min(
1, cur
/ m)
: 0;
976 957 text: systemPanel.rs
? `load ${systemPanel.rs.loadOne.toFixed(
2)}
· ${systemPanel.rs.loadFive.toFixed(
2)}
· ${systemPanel.rs.loadFifteen.toFixed(
2)}
(${systemPanel.rs.cores}
cores)` : "load —" 1017 995 text:
"disk · memory · battery · updates ok" 1099 1075 width: parent.width
1100 1076 text:
String(issueCard.modelData.detail
|| "")
1136 1111 if (systemPanel.rs)
1137 1112 systemPanel.rs.runIssueAction(issueCard.modelData.id);
1183 1153 color: root.theme
? root.theme.ui.accent
: "white" 1184 1154 text:
`${
Number(procChip.modelData.cpu
|| 0).toFixed(
0)}
%` 1204 1168 notificationService: root.notificationService
1205 1169 width: parent
? parent.width
: 0 1215 1178 trayService: root.trayService
1216 1179 width: parent
? parent.width
: 0 1226 1188 mediaService: root.mediaService
1227 1189 width: parent
? parent.width
: 0 1237 1198 clipboardService: root.clipboardService
1238 1199 width: parent
? parent.width
: 0 1246 1206 LauncherPanel {
1247 1207 theme: root.theme
1248 1208 launcherService: root.launcherService
1209 + surfaces: root.surfaces
1249 1210 width: parent
? parent.width
: 0 1259 1219 audioService: root.audioService
1260 1220 width: parent
? parent.width
: 0 1270 1229 brightnessService: root.brightnessService
1271 1230 width: parent
? parent.width
: 0 1283 1241 bluetoothService: root.bluetoothService
1284 1242 width: parent
? parent.width
: 0 1294 1251 powerService: root.powerService
1295 1252 width: parent
? parent.width
: 0 1310 1266 width: parent.width
1311 1267 wrapMode:
Text.WordWrap
1322 1276 component
NuguText:
Text {
1323 - required property QtObject theme
1277 + required property Theme theme
1324 1278 property string
variant:
"body" 1325 1279 property bool
selected:
false 1336 1290 duration: root.theme
&& root.theme.lowPowerMode
? 0 : 180 1337 1291 easing.type:
Easing.OutCubic
1342 1295 Behavior on implicitHeight {
1344 1297 duration: root.theme
&& root.theme.lowPowerMode
? 0 : 180 1345 1298 easing.type:
Easing.OutCubic
1350 1302 component
IdentityRow:
Row {
1353 - required property QtObject theme
1305 + required property Theme theme
1354 1306 property string
glyph:
"" 1355 1307 property string
value:
"" 1371 1323 text: irow.value
1372 1324 width:
Math.max(
1, parent.width
- 27)
1381 1332 component
Sparkline:
Item {
1384 - required property QtObject theme
1335 + required property Theme theme
1385 1336 property
var values: []
1386 1337 property
var valuesDown: []
1387 1338 property color
barColor: theme
? theme.ui.accent
: "white" 1404 1355 return spark.scaleMax;
1406 1357 const a
= spark.slice;
1407 - for (let i
= 0; i
< a.length; i
++) m
= Math.
max(m,
Number(a[i])
|| 0)
1358 + for (let i
= 0; i
< a.length; i
++)
1359 + m
= Math.
max(m,
Number(a[i])
|| 0);
1408 1360 if (spark.split) {
1409 1361 const b
= spark.sliceDown;
1410 - for (
let j
= 0; j
< b.length; j
++) m
= Math.
max(m,
Number(b[j])
|| 0)
1362 + for (
let j
= 0; j
< b.length; j
++)
1363 + m
= Math.
max(m,
Number(b[j])
|| 0);
1438 1391 height:
Math.max(spark.split
? 0 : 1, spark.budget
* (spark.maxV
> 0 ? Math.
min(
1, (
Number(modelData)
|| 0)
/ spark.maxV)
: 0))
1439 1392 color: spark.barColor
1470 1420 height:
Math.max(
0, spark.budget
* (spark.maxV
> 0 ? Math.
min(
1, (
Number(modelData)
|| 0)
/ spark.maxV)
: 0))
1471 1421 color: spark.barColorDown
1483 1429 component
MetricRow:
Item {
1486 - required property QtObject theme
1432 + required property Theme theme
1487 1433 property string
label:
"" 1488 1434 property string
value:
"" 1489 1435 property real
fraction:
0 1561 1507 duration: mrow.theme
&& mrow.theme.lowPowerMode
? 0 : 160 1562 1508 easing.type:
Easing.OutCubic
1573 - component
LauncherPanel:
Column {
1515 + component
LauncherPanel:
FocusScope {
1576 - required property QtObject theme
1577 - required property QtObject launcherService
1518 + required property Theme theme
1519 + required property Launcher launcherService
1520 + required property SurfaceManager surfaces
1578 1521 property string
query:
"" 1579 - property
var state: launcherService
? Util.parseJson(launcherService.search(query), {
1522 + property
var panelState: launcherService
? Util.parseJson(launcherService.search(query), {
1581 1524 "selectedIndex":
-1,
1582 - "providerIntent":
"all",
1525 + "providerIntent":
"app",
1586 - "selectedIndex":
-1,
1587 - "providerIntent":
"all",
1590 - readonly property
var results: state.results
|| []
1592 - readonly property int
rowHeight:
54 1593 - readonly property int
rowSpacing:
6 1529 + "selectedIndex":
-1,
1530 + "providerIntent":
"app",
1533 + readonly property
var results: panelState.results
|| []
1534 + readonly property int
selectedIndex:
Math.
max(
0,
Math.
min(results.length
- 1,
Number(panelState.selectedIndex
|| 0)))
1535 + readonly property
var selectedRow: results.length
> 0 ? results[selectedIndex]
: ({})
1536 + readonly property
var selectedActions: selectedRow.actions
|| []
1537 + readonly property
var selectedDetails: selectedRow.details
|| []
1538 + readonly property int
rowHeight:
52 1539 + readonly property int
rowSpacing:
4 1594 1540 readonly property int
rowStride: rowHeight
+ rowSpacing
1541 + readonly property int
rightWidth:
Math.
min(
300,
Math.
max(
260,
Math.
round(width
* 0.36)))
1597 1543 function refresh() {
1598 1544 if (launcherService)
1599 - state
= Util.parseJson(launcherService.search(query), state);
1545 + panelState
= Util.parseJson(launcherService.search(query), panelState);
1603 1548 function setQuery(text) {
1553 + function close() {
1555 + surfaces.closePopout(
"launcher-activated");
1558 + function activateSelected() {
1559 + if (
!launcherService
|| results.length
=== 0)
1562 + launcherService.activate(
JSON.
stringify(selectedRow));
1566 + function activateAction(index) {
1567 + if (
!launcherService
|| results.length
=== 0 || index
< 0 || index
>= selectedActions.length)
1570 + launcherService.activateAction(
JSON.
stringify(selectedRow), index);
1608 1574 function select(index) {
1609 1575 if (results.length
=== 0)
1612 1578 const i
= Math.
max(
0,
Math.
min(results.length
- 1,
Number(index)));
1613 - const next
= Object.
assign({
1579 + const next
= Object.
assign({}, panelState);
1615 1580 next.selectedIndex
= i;
1581 + panelState
= next;
1618 1582 const top
= i
* rowStride;
1619 1583 const bottom
= top
+ rowHeight;
1620 1584 if (top
< resultsFlick.contentY)
1626 1590 function wheelSelect(deltaY) {
1627 1591 if (results.length
<= 1)
1630 - const current
= Math.
max(
0,
Math.
min(results.length
- 1,
Number(state.selectedIndex
|| 0)));
1632 1594 const direction
= Number(deltaY)
>= 0 ? -1 : 1;
1633 - const next
= Math.
max(
0,
Math.
min(results.length
- 1, current
+ direction));
1595 + select(selectedIndex
+ direction);
1637 - function providerColor(provider) {
1641 - if (provider
=== "calculator")
1642 - return theme.info;
1644 - if (provider
=== "action")
1645 - return theme.warning;
1647 - if (provider
=== "clipboard")
1648 - return theme.ui.focus;
1650 - if (provider
=== "window")
1651 - return theme.content.accent;
1653 - return theme.ui.accent;
1598 + function keyAction(event) {
1599 + if (event.modifiers
& Qt.ControlModifier) {
1600 + const n
= Number(event.text);
1601 + if (n
>= 1 && n
<= selectedActions.length) {
1602 + event.accepted
= true;
1603 + activateAction(n
- 1);
1656 1608 width: parent
? parent.width
: 0 1609 + height: parent
? parent.height
: 0 1611 + Component.onCompleted:
Qt.callLater(searchInput.forceActiveFocus)
1612 + onVisibleChanged:
if (visible)
1613 + Qt.callLater(searchInput.forceActiveFocus)
1615 + Keys.onUpPressed: event =
> {
1616 + event.accepted
= true;
1617 + select(selectedIndex -
1);
1619 + Keys.onDownPressed: event =
> {
1620 + event.accepted
= true;
1621 + select(selectedIndex +
1);
1623 + Keys.onReturnPressed: event =
> {
1624 + event.accepted
= true;
1625 + activateSelected();
1627 + Keys.onEnterPressed: event =
> {
1628 + event.accepted
= true;
1629 + activateSelected();
1631 + Keys.onPressed:
keyAction(event)
1661 - onWheel: (event)
=> {
1635 + onWheel: event
=> {
1662 1636 event.accepted
= true;
1663 1637 root.wheelSelect(event.angleDelta.y);
1672 - objectName:
"launcherResultList" 1642 + anchors.fill: parent
1644 + color: root.theme
? root.theme.ui.backdrop
: "#242424" 1646 + border.color: root.theme
? root.theme.withAlpha(root.theme.ui.normal,
0.34)
: "#666666" 1674 - width: parent.width
1677 - height:
Math.
max(
120, (root.parent
? root.parent.height
: 460)
- 84)
1678 - contentHeight: resultColumn.implicitHeight
1679 - interactive:
false 1681 - boundsBehavior:
Flickable.StopAtBounds
1650 + anchors.left: parent.left
1651 + anchors.right: parent.right
1652 + anchors.bottom: parent.bottom
1654 + color: root.theme
? root.theme.ui.accent
: "#d86dd8" 1683 - Behavior on contentY {
1685 - duration: root.theme
&& root.theme.lowPowerMode
? 0 : 140 1686 - easing.type:
Easing.OutCubic
1658 + anchors.fill: parent
1659 + anchors.margins:
1 1662 + width:
Math.
max(
1, parent.width
- root.rightWidth)
1663 + height: parent.height
1668 + anchors.left: parent.left
1669 + anchors.right: parent.right
1670 + anchors.top: parent.top
1672 + color:
"transparent" 1675 + anchors.left: parent.left
1676 + anchors.leftMargin:
20 1677 + anchors.verticalCenter: parent.verticalCenter
1679 + color: root.theme
? root.theme.ui.accent
: "#d86dd8" 1680 + font.pixelSize:
21 1686 + anchors.left: parent.left
1687 + anchors.leftMargin:
60 1688 + anchors.right: parent.right
1689 + anchors.rightMargin:
18 1690 + anchors.verticalCenter: parent.verticalCenter
1691 + color: root.theme
? root.theme.content.normal
: "white" 1692 + selectionColor: root.theme
? root.theme.ui.focus
: "#ffffff" 1693 + selectedTextColor: root.theme
? root.theme.content.backdrop
: "black" 1694 + font.family:
"IBM Plex Mono" 1695 + font.pixelSize:
25 1700 + if (text
!== root.query)
1701 + root.setQuery(text);
1703 + onAccepted: root.activateSelected()
1704 + Keys.onUpPressed: event
=> {
1705 + event.accepted
= true;
1706 + root.select(root.selectedIndex
- 1);
1708 + Keys.onDownPressed: event
=> {
1709 + event.accepted
= true;
1710 + root.select(root.selectedIndex
+ 1);
1712 + Keys.onReturnPressed: event
=> {
1713 + event.accepted
= true;
1714 + root.activateSelected();
1716 + Keys.onEnterPressed: event
=> {
1717 + event.accepted
= true;
1718 + root.activateSelected();
1720 + Keys.onPressed: root.keyAction(event)
1724 + anchors.left: parent.left
1725 + anchors.right: parent.right
1726 + anchors.bottom: parent.bottom
1728 + color: root.theme
? root.theme.withAlpha(root.theme.ui.normal,
0.22)
: "#444444" 1734 + objectName:
"launcherResultList" 1736 + anchors.left: parent.left
1737 + anchors.right: parent.right
1738 + anchors.top: searchBox.bottom
1739 + anchors.bottom: parent.bottom
1740 + anchors.margins:
8 1741 + contentHeight: resultColumn.implicitHeight
1742 + interactive:
false 1744 + boundsBehavior:
Flickable.StopAtBounds
1746 + Behavior on contentY {
1748 + duration: root.theme
&& root.theme.lowPowerMode
? 0 : 120 1749 + easing.type:
Easing.OutCubic
1756 + width: resultsFlick.width
1757 + spacing: root.rowSpacing
1760 + model: root.results.slice(
0,
60)
1762 + delegate: Rectangle {
1765 + required property int index
1766 + required property
var modelData
1767 + readonly property bool
isSelected: index
=== root.selectedIndex
1769 + width: parent.width
1770 + height: root.rowHeight
1772 + color: root.theme
? (isSelected
? root.theme.ui.focus
: "transparent")
: (isSelected
? "#9aabae" : "transparent")
1777 + anchors.left: parent.left
1778 + anchors.leftMargin:
11 1779 + anchors.verticalCenter: parent.verticalCenter
1784 + anchors.fill: parent
1786 + color: root.theme
? root.theme.content.backdrop
: "#121212" 1792 + anchors.fill: parent
1793 + anchors.margins:
4 1794 + visible: appIcon.status
=== Image.Ready
1795 + source:
String(rrow.modelData.icon
|| "").length
> 0 ? Quickshell.iconPath(
String(rrow.modelData.icon),
true)
: "" 1799 + anchors.centerIn: parent
1800 + visible:
!appIcon.visible
1801 + text:
String(rrow.modelData.glyph
|| "")
1802 + font.family:
"Symbols Nerd Font Mono" 1803 + font.pixelSize:
17 1804 + color: root.theme
? root.theme.ui.accent
: "#d86dd8" 1809 + anchors.left: iconSlot.right
1810 + anchors.leftMargin:
12 1811 + anchors.right: ordinal.left
1812 + anchors.rightMargin:
10 1813 + anchors.verticalCenter: parent.verticalCenter
1818 + selected: rrow.isSelected
1819 + text: rrow.modelData.title
|| rrow.modelData.id
|| "app" 1820 + width: parent.width
1826 + selected: rrow.isSelected
1827 + text: rrow.modelData.subtitle
|| rrow.modelData.comment
|| rrow.modelData.desktopId
|| "app" 1828 + width: parent.width
1829 + opacity: rrow.isSelected
? 0.82 : 0.72 1836 + anchors.right: parent.right
1837 + anchors.rightMargin:
12 1838 + anchors.verticalCenter: parent.verticalCenter
1841 + selected: rrow.isSelected
1842 + text: rrow.index
=== 0 ? "enter" : String(rrow.index
+ 1)
1844 + horizontalAlignment:
Text.AlignRight
1845 + opacity: rrow.isSelected
? 0.8 : 0.52 1849 + anchors.fill: parent
1850 + onClicked: root.select(rrow.index)
1851 + onDoubleClicked: root.activateSelected()
1852 + onWheel: wheel
=> {
1853 + wheel.accepted
= true;
1854 + root.wheelSelect(wheel.angleDelta.y);
1864 + width: root.rightWidth
1865 + height: parent.height
1866 + color:
"transparent" 1693 - width: resultsFlick.width
1694 - spacing: root.rowSpacing
1870 + anchors.left: parent.left
1871 + anchors.top: parent.top
1872 + anchors.bottom: parent.bottom
1874 + color: root.theme
? root.theme.withAlpha(root.theme.ui.normal,
0.22)
: "#444444" 1697 - model: root.results.slice(
0,
60)
1699 - delegate: Rectangle {
1702 - required property int index
1703 - required property
var modelData
1704 - readonly property bool
isSelected: index
=== (root.state.selectedIndex
|| 0)
1705 - readonly property bool
isCalc: modelData.provider
=== "calculator" 1706 - readonly property color
tint: root.providerColor(modelData.provider)
1878 + anchors.fill: parent
1879 + anchors.margins:
22 1708 1883 width: parent.width
1709 - height: root.rowHeight
1714 - color: root.theme
? root.theme.withAlpha(root.theme.ui.backdrop, rrow.isSelected
? 0.82 : 0.55)
: "transparent" 1715 - border.width: rrow.isSelected
? 2 : 1 1716 - border.color: root.theme
? (rrow.isSelected
? root.theme.ui.focus
: root.theme.withAlpha(rrow.tint,
0.45))
: "transparent" 1720 - anchors.left: parent.left
1721 - anchors.top: parent.top
1722 - anchors.bottom: parent.bottom
1723 - anchors.margins:
2 1727 - opacity: rrow.isSelected
? 1 : 0.7 1737 - anchors.left: parent.left
1738 - anchors.leftMargin:
10 1739 - anchors.verticalCenter: parent.verticalCenter
1892 + anchors.fill: parent
1894 + color: root.theme
? root.theme.content.backdrop
: "#121212" 1746 1900 anchors.fill: parent
1747 - visible: rrow.modelData.provider
=== "app" && appIcon.status
=== Image.Ready
1748 - source: (rrow.modelData.provider
=== "app" && String(rrow.modelData.icon
|| "").length
> 0)
? Quickshell.iconPath(
String(rrow.modelData.icon),
true)
: "" 1901 + anchors.margins:
8 1902 + visible: detailIcon.status
=== Image.Ready
1903 + source:
String(root.selectedRow.icon
|| "").length
> 0 ? Quickshell.iconPath(
String(root.selectedRow.icon),
true)
: "" 1752 1907 anchors.centerIn: parent
1753 - visible:
!appIcon.visible
1754 - text:
String(rrow.modelData.glyph
|| "")
1908 + visible:
!detailIcon.visible
1909 + text:
String(root.selectedRow.glyph
|| "")
1755 1910 font.family:
"Symbols Nerd Font Mono" 1756 - font.pixelSize:
18 1911 + font.pixelSize:
27 1912 + color: root.theme
? root.theme.ui.accent
: "#d86dd8" 1764 - visible: rrow.isCalc
1765 - anchors.left: iconSlot.right
1766 - anchors.leftMargin:
12 1767 - anchors.right: parent.right
1768 - anchors.rightMargin:
12 1917 + width:
Math.
max(
1, parent.width
- 70)
1769 1918 anchors.verticalCenter: parent.verticalCenter
1773 1922 theme: root.theme
1775 - text: rrow.modelData.subtitle
|| rrow.modelData.id
|| "expression" 1924 + text: root.selectedRow.title
|| "No apps" 1776 1925 width: parent.width
1781 - width: parent.width
1782 - text:
String(rrow.modelData.value
|| rrow.modelData.title
|| "0")
1783 - color: rrow.isSelected
&& root.theme
? root.theme.content.backdrop
: (root.theme
? root.theme.content.normal
: "white")
1784 - font.family:
"IBM Plex Mono" 1785 1926 font.pixelSize:
22 1787 - elide:
Text.ElideRight
1932 + text: root.selectedRow.genericName
|| root.selectedRow.desktopId
|| "app" 1933 + width: parent.width
1943 + width: parent.width
1950 + width: parent.width
1953 + color: root.theme
? root.theme.content.backdrop
: "#121212" 1956 + anchors.left: parent.left
1957 + anchors.leftMargin:
12 1958 + anchors.verticalCenter: parent.verticalCenter
1961 + width: parent.width
- 78 1794 - visible:
!rrow.isCalc
1795 - anchors.left: iconSlot.right
1796 - anchors.leftMargin:
12 1797 1965 anchors.right: parent.right
1798 1966 anchors.rightMargin:
12 1799 1967 anchors.verticalCenter: parent.verticalCenter
1804 - selected: rrow.isSelected
1805 - text: rrow.modelData.title
|| rrow.modelData.id
|| "result" 1806 - width: parent.width
1812 - text:
`${rrow.modelData.verb
|| "activate"}
· ${rrow.modelData.subtitle
|| rrow.modelData.provider}
` 1813 - width: parent.width
1972 + horizontalAlignment:
Text.AlignRight
1820 1977 anchors.fill: parent
1821 - onClicked: root.select(rrow.index)
1822 - onWheel: (wheel)
=> {
1823 - wheel.accepted
= true;
1824 - root.wheelSelect(wheel.angleDelta.y);
1978 + onClicked: root.activateSelected()
1983 + model: root.selectedActions.slice(
0,
4)
1985 + delegate: Rectangle {
1986 + required property int index
1987 + required property
var modelData
1989 + width: parent.width
1992 + color: root.theme
? root.theme.content.backdrop
: "#121212" 1995 + anchors.left: parent.left
1996 + anchors.leftMargin:
12 1997 + anchors.verticalCenter: parent.verticalCenter
1999 + text: modelData.title
|| modelData.id
|| "action" 2000 + width: parent.width
- 78 2004 + anchors.right: parent.right
2005 + anchors.rightMargin:
12 2006 + anchors.verticalCenter: parent.verticalCenter
2009 + text:
"ctrl " + (index
+ 1)
2011 + horizontalAlignment:
Text.AlignRight
2016 + anchors.fill: parent
2017 + onClicked: root.activateAction(index)
2025 + text:
"desktop entry" 2026 + width: parent.width
2033 + width: parent.width
2034 + height: detailColumn.implicitHeight
+ 20 2036 + color: root.theme
? root.theme.content.backdrop
: "#121212" 2041 + anchors.left: parent.left
2042 + anchors.right: parent.right
2043 + anchors.top: parent.top
2044 + anchors.margins:
10 2048 + model: root.selectedDetails
2051 + required property
var modelData
2053 + width: parent.width
2059 + text: modelData.label
|| "" 2067 + text: modelData.value
|| "—" 2068 + width:
Math.
max(
1, parent.width
- 80)
2069 + horizontalAlignment:
Text.AlignRight
1837 - objectName:
"searchFieldDockedBottom" 1838 - width: parent.width
1841 - color: root.theme
? root.theme.withAlpha(root.theme.ui.focus,
0.14)
: "transparent" 1843 - border.color: root.theme
? root.theme.ui.focus
: "transparent" 1846 - anchors.left: parent.left
1847 - anchors.leftMargin:
14 1848 - anchors.verticalCenter: parent.verticalCenter
1856 - anchors.left: parent.left
1857 - anchors.leftMargin:
72 1858 - anchors.right: parent.right
1859 - anchors.rightMargin:
14 1860 - anchors.verticalCenter: parent.verticalCenter
1861 - color: root.theme
? root.theme.content.normal
: "white" 1862 - selectionColor: root.theme
? root.theme.ui.focus
: "#ffffff" 1863 - selectedTextColor: root.theme
? root.theme.content.backdrop
: "black" 1864 - font.family:
"IBM Plex Mono" 1868 - if (text
!== root.query)
1869 - root.setQuery(text);
1872 - Keys.onUpPressed: root.select((root.state.selectedIndex
|| 0)
- 1)
1873 - Keys.onDownPressed: root.select((root.state.selectedIndex
|| 0)
+ 1)
1874 - Keys.onReturnPressed: (event)
=> {
1875 - event.accepted
= true;
1877 - Keys.onEnterPressed: (event)
=> {
1878 - event.accepted
= true;
1885 - objectName:
"keyboardNavigation" 1888 - text:
"↑↓ select · Enter activate" 1889 - width: parent.width
1890 - elide:
Text.ElideRight
1895 2080 component
NotificationGroup:
Column {
1898 - required property QtObject theme
1899 - required property QtObject notificationService
1900 - property
var state: notificationService
? Util.parseJson(notificationService.stateJson(), {
"groups": [],
"dnd":
false,
"activeCount":
0})
: ({
"groups": [],
"dnd":
false,
"activeCount":
0})
1901 - readonly property
var groups: state.groups
|| []
2083 + required property Theme theme
2084 + required property Notifications notificationService
2085 + property
var panelState: notificationService
? Util.parseJson(notificationService.stateJson(), {
2094 + readonly property
var groups: panelState.groups
|| []
1937 2130 anchors.verticalCenter: parent.verticalCenter
1938 2131 theme: root.theme
1939 2132 variant:
"title" 1940 - text:
`Notifications${root.state.activeCount
? " · " + root.state.activeCount
: ""}
` 2133 + text:
`Notifications${root.panelState.activeCount
? " · " + root.panelState.activeCount
: ""}
` 1943 2136 anchors.right: parent.right
1947 2140 width: dndLabel.implicitWidth
+ 18 1950 - color: root.theme
? root.theme.withAlpha(root.state.dnd
? root.theme.ui.accent
: root.theme.ui.minor, root.state.dnd
? 0.3 : 0.12)
: "transparent" 1951 - NuguText {
id:
dndLabel; anchors.centerIn: parent; theme: root.theme; variant:
"meta"; text: root.state.dnd
? "DND on" : "DND" }
1952 - MouseArea { anchors.fill: parent; onClicked: root.toggleDnd() }
2143 + color: root.theme
? root.theme.withAlpha(root.panelState.dnd
? root.theme.ui.accent
: root.theme.ui.minor, root.panelState.dnd
? 0.3 : 0.12)
: "transparent" 2146 + anchors.centerIn: parent
2149 + text: root.panelState.dnd
? "DND on" : "DND" 2152 + anchors.fill: parent
2153 + onClicked: root.toggleDnd()
1955 2157 width: clearLabel.implicitWidth
+ 18 1958 - visible: (root.state.activeCount
|| 0)
> 0 2160 + visible: (root.panelState.activeCount
|| 0)
> 0 1959 2161 color: clearArea.containsMouse
&& root.theme
? root.theme.withAlpha(root.theme.error,
0.24)
: (root.theme
? root.theme.withAlpha(root.theme.ui.minor,
0.12)
: "transparent")
1960 - NuguText {
id: clearLabel; anchors.centerIn: parent;
theme: root.theme;
variant:
"meta";
text:
"Clear all" }
1961 - MouseArea {
id: clearArea; anchors.fill: parent;
hoverEnabled:
true;
onClicked: root.clearAll() }
2164 + anchors.centerIn: parent
2171 + anchors.fill: parent
2172 + hoverEnabled:
true 2173 + onClicked: root.clearAll()
1993 2206 anchors.centerIn: parent
1995 - NuguText { anchors.horizontalCenter: parent.horizontalCenter;
theme: root.theme;
variant:
"title";
text:
"No notifications" }
1996 - NuguText { anchors.horizontalCenter: parent.horizontalCenter;
theme: root.theme;
variant:
"meta";
text:
"You're all caught up" }
2209 + anchors.horizontalCenter: parent.horizontalCenter
2212 + text:
"No notifications" 2215 + anchors.horizontalCenter: parent.horizontalCenter
2218 + text:
"You're all caught up" 2005 2228 width: root.width
2013 - width: parent.width
2014 - height: (groupDelegate.modelData.count
|| 0)
> 1 ? 26 : 0 2015 - visible: (groupDelegate.modelData.count
|| 0)
> 1 2017 - color: grpArea.containsMouse
&& root.theme
? root.theme.withAlpha(root.theme.ui.minor,
0.16)
: "transparent" 2018 - Behavior on color { ColorAnimation {
duration: root.theme
&& root.theme.lowPowerMode
? 0 : 120 } }
2020 - anchors.left: parent.left
2021 - anchors.leftMargin:
8 2022 - anchors.verticalCenter: parent.verticalCenter
2024 - NuguText {
theme: root.theme;
variant:
"meta";
text: groupDelegate.modelData.appName
|| "" }
2025 - NuguText {
theme: root.theme;
variant:
"meta";
text:
`· ${groupDelegate.modelData.count}
` }
2028 - anchors.right: parent.right
2029 - anchors.rightMargin:
8 2030 - anchors.verticalCenter: parent.verticalCenter
2035 - opacity: grpArea.containsMouse
? 1 : 0.7 2036 - text: groupDelegate.modelData.expanded
? "Show less" : `Show ${
Math.
max(
1, (groupDelegate.modelData.count
|| 1)
- (groupDelegate.modelData.previewCount
|| 1))}
more` 2041 - opacity: grpArea.containsMouse
? 1 : 0.7 2042 - text: groupDelegate.modelData.expanded
? "⌃" : "⌄" 2045 - MouseArea {
id: grpArea; anchors.fill: parent;
hoverEnabled:
true;
onClicked: root.toggleGroup(groupDelegate.modelData.appName
|| "") }
2236 + width: parent.width
2237 + height: (groupDelegate.modelData.count
|| 0)
> 1 ? 26 : 0 2238 + visible: (groupDelegate.modelData.count
|| 0)
> 1 2240 + color: grpArea.containsMouse
&& root.theme
? root.theme.withAlpha(root.theme.ui.minor,
0.16)
: "transparent" 2241 + Behavior on color {
2243 + duration: root.theme
&& root.theme.lowPowerMode
? 0 : 120 2247 + anchors.left: parent.left
2248 + anchors.leftMargin:
8 2249 + anchors.verticalCenter: parent.verticalCenter
2254 + text: groupDelegate.modelData.appName
|| "" 2259 + text:
`· ${groupDelegate.modelData.count}
` 2263 + anchors.right: parent.right
2264 + anchors.rightMargin:
8 2265 + anchors.verticalCenter: parent.verticalCenter
2270 + opacity: grpArea.containsMouse
? 1 : 0.7 2271 + text: groupDelegate.modelData.expanded
? "Show less" : `Show ${
Math.
max(
1, (groupDelegate.modelData.count
|| 1)
- (groupDelegate.modelData.previewCount
|| 1))}
more` 2276 + opacity: grpArea.containsMouse
? 1 : 0.7 2277 + text: groupDelegate.modelData.expanded
? "⌃" : "⌄" 2282 + anchors.fill: parent
2283 + hoverEnabled:
true 2284 + onClicked: root.toggleGroup(groupDelegate.modelData.appName
|| "")
2049 - model: groupDelegate.modelData.visibleNotifications
|| []
2052 - required property
var modelData
2054 - implicitHeight: cardInner.implicitHeight
2055 - height: implicitHeight
2056 - NotificationCard {
2058 - width: parent.width
2060 - modelData: cardWrap.modelData
2061 - onDismiss: (id)
=> root.runAction(id,
"close")
2062 - onInvokeAction: (id, actionId)
=> root.runAction(id, actionId)
2063 - onSendReply: (id, text)
=> root.sendReply(id, text)
2289 + model: groupDelegate.modelData.visibleNotifications
|| []
2292 + required property
var modelData
2294 + implicitHeight: cardInner.implicitHeight
2295 + height: implicitHeight
2296 + NotificationCard {
2298 + width: parent.width
2300 + modelData: cardWrap.modelData
2301 + onDismiss: id
=> root.runAction(id,
"close")
2302 + onInvokeAction: (id, actionId)
=> root.runAction(id, actionId)
2303 + onSendReply: (id, text)
=> root.sendReply(id, text)
2096 2336 onActiveChanged: {
2098 2338 shake.restart();
2156 2395 duration: root.theme
&& root.theme.lowPowerMode
? 0 : 30 2157 2396 easing.type:
Easing.OutCubic
2162 2400 transform:
Translate {
2170 2407 component
ClipboardPanel:
Column {
2173 - required property QtObject theme
2174 - required property QtObject clipboardService
2410 + required property Theme theme
2411 + required property Clipboard clipboardService
2175 2412 property string
query:
"" 2176 - property
var state: clipboardService
? Util.parseJson(clipboardService.stateJson(), {
2413 + property
var panelState: clipboardService
? Util.parseJson(clipboardService.stateJson(), {
2178 2415 "privateMode":
false,
2179 2416 "privateRole":
"ui.accent",
2184 - "privateMode":
false,
2185 - "privateRole":
"ui.accent",
2189 - readonly property
var rows: state.rows
|| []
2420 + "privateMode":
false,
2421 + "privateRole":
"ui.accent",
2424 + readonly property
var rows: panelState.rows
|| []
2192 2426 function refreshFrom(text) {
2193 - state
= Util.parseJson(text, state);
2427 + panelState
= Util.parseJson(text, panelState);
2196 2430 function search(text) {
2197 2431 query
= String(text);
2198 2432 if (clipboardService)
2199 2433 refreshFrom(clipboardService.search(query));
2203 2436 function copy(id) {
2204 2437 if (clipboardService)
2205 2438 refreshFrom(clipboardService.copy(id));
2209 2441 function paste(id) {
2210 2442 if (clipboardService)
2211 2443 refreshFrom(clipboardService.paste(id));
2215 2446 function togglePin(id) {
2216 2447 if (clipboardService)
2217 2448 refreshFrom(clipboardService.togglePin(id));
2221 2451 function deleteRow(id) {
2222 2452 if (clipboardService)
2223 2453 refreshFrom(clipboardService.deleteRow(id));
2227 2456 function setPrivateMode(enabled) {
2228 2457 if (clipboardService)
2229 2458 refreshFrom(clipboardService.setPrivateMode(enabled));
2284 2512 variant:
"meta" 2285 2513 text:
"search clipboard" 2295 - color: root.theme
? root.theme.withAlpha(root.state.privateMode
? root.theme.warning
: root.theme.ui.accent,
0.2)
: "transparent" 2522 + color: root.theme
? root.theme.withAlpha(root.panelState.privateMode
? root.theme.warning
: root.theme.ui.accent,
0.2)
: "transparent" 2296 2523 border.width:
0 2297 - border.color: root.theme
? (root.state.privateMode
? root.theme.warning
: root.theme.ui.accent)
: "transparent" 2524 + border.color: root.theme
? (root.panelState.privateMode
? root.theme.warning
: root.theme.ui.accent)
: "transparent" 2300 2527 anchors.centerIn: parent
2304 2531 anchors.verticalCenter: parent.verticalCenter
2305 - text: root.state.privateMode
? "" : "" 2306 - color: root.theme
? (root.state.privateMode
? root.theme.warning
: root.theme.ui.accent)
: "white" 2532 + text: root.panelState.privateMode
? "" : "" 2533 + color: root.theme
? (root.panelState.privateMode
? root.theme.warning
: root.theme.ui.accent)
: "white" 2307 2534 font.family:
"Symbols Nerd Font Mono" 2308 2535 font.pixelSize:
13 2312 2539 anchors.verticalCenter: parent.verticalCenter
2313 2540 theme: root.theme
2314 2541 variant:
"meta" 2315 - text: root.state.privateMode
? "private" : "normal" 2542 + text: root.panelState.privateMode
? "private" : "normal" 2321 2547 anchors.fill: parent
2322 - onClicked: root.setPrivateMode(
!root.state.privateMode)
2548 + onClicked: root.setPrivateMode(
!root.panelState.privateMode)
2425 2649 font.family:
"Symbols Nerd Font Mono" 2426 2650 font.pixelSize:
18 2450 2673 width: parent.width
2451 2674 elide:
Text.ElideRight
2483 2705 duration: root.theme
&& root.theme.lowPowerMode
? 0 : 120 2484 2706 easing.type:
Easing.OutCubic
2527 2748 root.deleteRow(clipRow.modelData.id);
2549 2761 component
BrightnessPanel:
Column {
2552 - required property QtObject theme
2553 - required property QtObject brightnessService
2554 - property
var state: brightnessService
? Util.parseJson(brightnessService.stateJson(), {
2764 + required property Theme theme
2765 + required property Brightness brightnessService
2766 + property
var panelState: brightnessService
? Util.parseJson(brightnessService.stateJson(), {
2557 2769 "label":
"Bright",
2558 2770 "role":
"ui.accent" 2563 - "label":
"Bright",
2564 - "role":
"ui.accent" 2775 + "label":
"Bright",
2776 + "role":
"ui.accent" 2568 - readonly property real
level:
Math.
max(
0,
Math.
min(
1,
Number(root.state.level
|| 0)))
2780 + readonly property real
level:
Math.
max(
0,
Math.
min(
1,
Number(root.panelState.level
|| 0)))
2569 2781 function roleColor(role) {
2570 2782 if (
!root.theme)
2571 2783 return "white";
2576 2788 return root.theme.ui.accent;
2578 2790 function applyAt(x, width) {
2579 - root.state
= Util.parseJson(root.brightnessService.setLevel(
Math.
max(
0,
Math.
min(
1, x
/ width))), root.state);
2791 + root.panelState
= Util.parseJson(root.brightnessService.setLevel(
Math.
max(
0,
Math.
min(
1, x
/ width))), root.panelState);
2598 2810 anchors.margins:
2 2599 2811 width:
Math.max(
0, (parent.width
- 4)
* root.level)
2600 2812 radius: parent.radius
- 2 2601 - color: root.theme
? root.theme.withAlpha(root.roleColor(root.state.compact
? root.state.compact.role
: "ui.accent"),
0.6)
: "white" 2813 + color: root.theme
? root.theme.withAlpha(root.roleColor(root.panelState.compact
? root.panelState.compact.role
: "ui.accent"),
0.6)
: "white" 2613 2825 anchors.fill: parent
2614 2826 onPressed: mouse
=> root.applyAt(mouse.x, width)
2615 - onPositionChanged: mouse
=> {
if (pressed) root.applyAt(mouse.x, width); }
2827 + onPositionChanged: mouse
=> {
2829 + root.applyAt(mouse.x, width);
2646 2860 anchors.fill: parent
2647 - onClicked: root.state
= Util.parseJson(root.brightnessService.setLevel(parent.modelData), root.state)
2861 + onClicked: root.panelState
= Util.parseJson(root.brightnessService.setLevel(parent.modelData), root.panelState)
2658 2868 component
ConnectivityPanel:
Column {
2661 - required property QtObject theme
2662 - required property QtObject resourceService
2663 - required property QtObject networkService
2664 - required property QtObject bluetoothService
2871 + required property Theme theme
2872 + required property Resources resourceService
2873 + required property Network networkService
2874 + required property Bluetooth bluetoothService
2665 2875 property
var networkState: networkService
? Util.parseJson(networkService.stateJson(), {
2666 2876 "networks": [],
2667 2877 "knownNetworks": [],
2674 - "knownNetworks": [],
2882 + "knownNetworks": [],
2680 2886 property
var bluetoothState: bluetoothService
? Util.parseJson(bluetoothService.stateJson(), {
2702 2906 function toggleWifi() {
2703 2907 if (networkService)
2704 2908 refreshNetwork(networkService.toggleWifi(
!(networkState.wifi
&& networkState.wifi.enabled)));
2708 2911 function scanWifi() {
2709 2912 if (networkService)
2710 2913 refreshNetwork(networkService.scan());
2714 2916 function selectNetwork(id) {
2715 2917 if (networkService)
2716 2918 refreshNetwork(networkService.select(id));
2720 2921 function forgetNetwork(id) {
2721 2922 if (networkService)
2722 2923 refreshNetwork(networkService.forget(id));
2729 2929 function connectSecured(ssid, passphrase) {
2730 2930 if (networkService)
2731 2931 refreshNetwork(networkService.connect(ssid, passphrase));
2735 2934 function disconnectNetwork() {
2736 2935 if (networkService)
2737 2936 refreshNetwork(networkService.disconnect());
2745 2943 expandedSsid
= willOpen
? row.ssid
: "";
2746 2944 if (willOpen
&& row.connected
&& networkService)
2747 2945 refreshNetwork(networkService.diagnostics());
2751 2948 function toggleBluetooth() {
2752 2949 if (bluetoothService)
2753 2950 refreshBluetooth(bluetoothService.toggle(
!(bluetoothState.adapter
&& bluetoothState.adapter.state
=== "powered")));
2757 2953 function scanBluetooth() {
2758 2954 if (bluetoothService)
2759 2955 refreshBluetooth(bluetoothService.scan());
2763 2958 function bluetoothAction(kind, id) {
2764 2959 if (bluetoothService)
2765 2960 refreshBluetooth(bluetoothService.deviceAction(kind, id));
2769 2963 function roleColor(role) {
2797 2991 function onRefreshed() {
2798 2992 if (root.networkService)
2799 2993 root.refreshNetwork(root.networkService.stateJson());
2814 3007 boundsBehavior:
Flickable.StopAtBounds
2815 3008 flickableDirection:
Flickable.VerticalFlick
2820 - width: parent.width
2824 - objectName:
"networkRateRow" 2825 - width: parent.width
2830 - text: root.resourceService
? `↓ ${
Sys.formatRate(root.resourceService.networkRxRate)}
` : "↓ 0 B/s" 2831 - color: root.theme
? root.theme.ui.accent
: "white" 2836 - text: root.resourceService
? `↑ ${
Sys.formatRate(root.resourceService.networkTxRate)}
` : "↑ 0 B/s" 2837 - color: root.theme
? root.theme.ui.focus
: "white" 2843 - objectName:
"wifiToggleScanList" 2844 - width: parent.width
2848 - width: parent.width
2855 - width: parent.width
- 132 2862 - color: root.theme
? root.theme.withAlpha(root.networkState.wifi
&& root.networkState.wifi.enabled
? root.theme.ui.focus
: root.theme.ui.minor,
0.22)
: "transparent" 2864 - border.color: root.roleColor(root.networkState.compact
? root.networkState.compact.role
: "ui.minor")
2867 - anchors.centerIn: parent
2870 - text: root.networkState.wifi
&& root.networkState.wifi.enabled
? "on" : "off" 2874 - anchors.fill: parent
2875 - onClicked: root.toggleWifi()
2884 - color: root.theme
? root.theme.withAlpha(root.theme.ui.accent, root.networkState.scanning
? 0.32 : 0.16)
: "transparent" 2886 - border.color: root.theme
? root.theme.ui.accent
: "transparent" 2889 - anchors.centerIn: parent
2892 - text: root.networkState.scanning
? "scan…" : "scan" 2896 - anchors.fill: parent
2897 - onClicked: root.scanWifi()
2905 3013 width: parent.width
2909 - model: root.networkState.networks
|| []
2911 - delegate: Column {
2914 - required property
var modelData
2915 - readonly property bool
active: modelData.connected
=== true 2916 - readonly property bool
revealed: root.expandedSsid
=== modelData.ssid
2917 - readonly property
var detail: root.networkState.connectionDetail
|| ({})
2919 - width: parent.width
2925 - width: parent.width
2928 - color: root.theme
? root.theme.withAlpha(root.theme.ui.backdrop, wifiRow.active
? 0.82 : 0.55)
: "#333333" 2929 - border.width: (wifiRow.active
|| wifiRow.revealed)
? 2 : 1 2930 - border.color: root.theme
? (wifiRow.active
? root.theme.ui.accent
: (wifiRow.modelData.state
=== "connecting" ? root.roleColor(
"warning")
: (wifiRow.revealed
? root.theme.withAlpha(root.theme.ui.accent,
0.6)
: root.theme.withAlpha(root.theme.ui.minor,
0.45))))
: "white" 2934 - anchors.left: parent.left
2935 - anchors.top: parent.top
2936 - anchors.bottom: parent.bottom
2937 - anchors.margins:
2 2940 - color: root.theme
? root.theme.ui.accent
: "transparent" 2941 - opacity: wifiRow.active
? 1 : 0 2947 - anchors.left: parent.left
2948 - anchors.leftMargin:
12 2949 - anchors.verticalCenter: parent.verticalCenter
2950 - font.family:
"Symbols Nerd Font Mono" 2951 - font.pixelSize:
18 2952 - text: wifiRow.modelData.signalGlyph
|| "" 2953 - color: root.roleColor(wifiRow.modelData.signalRole
|| "ui.minor")
2960 - anchors.right: parent.right
2961 - anchors.rightMargin:
12 2962 - anchors.verticalCenter: parent.verticalCenter
2963 - font.family:
"Symbols Nerd Font Mono" 2964 - font.pixelSize:
16 2966 - rotation: wifiRow.revealed
? 90 : 0 2967 - color: root.roleColor(wifiRow.active
? "content.accent" : "ui.minor")
2973 - anchors.right: wifiChevron.left
2974 - anchors.rightMargin:
10 2975 - anchors.verticalCenter: parent.verticalCenter
2978 - text: wifiRow.active
? "connected" : (wifiRow.modelData.securityLabel
|| "")
2979 - color: root.roleColor(wifiRow.active
? "content.accent" : "ui.minor")
2983 - anchors.left: wifiGlyph.right
2984 - anchors.leftMargin:
10 2985 - anchors.right: wifiLabel.left
2986 - anchors.rightMargin:
10 2987 - anchors.verticalCenter: parent.verticalCenter
2989 - text: wifiRow.modelData.ssid
2990 - elide:
Text.ElideRight
2994 - anchors.fill: parent
2995 - onClicked: root.expandRow(wifiRow.modelData)
3017 + objectName:
"networkRateRow" 3018 + width: parent.width
3023 + text: root.resourceService
? `↓ ${
Sys.formatRate(root.resourceService.networkRxRate)}
` : "↓ 0 B/s" 3024 + color: root.theme
? root.theme.ui.accent
: "white" 3029 + text: root.resourceService
? `↑ ${
Sys.formatRate(root.resourceService.networkTxRate)}
` : "↑ 0 B/s" 3030 + color: root.theme
? root.theme.ui.focus
: "white" 3004 - visible: wifiRow.revealed
3035 + objectName:
"wifiToggleScanList" 3036 + width: parent.width
3005 3040 width: parent.width
3006 - height: visible
? drawerCol.height
+ 16 : 0 3008 - color: root.theme
? root.theme.withAlpha(root.theme.ui.backdrop,
0.55)
: "#333333" 3010 - border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.4)
: "white" 3047 + width: parent.width
- 132 3018 - width: parent.width
- 24 3054 + color: root.theme
? root.theme.withAlpha(root.networkState.wifi
&& root.networkState.wifi.enabled
? root.theme.ui.focus
: root.theme.ui.minor,
0.22)
: "transparent" 3056 + border.color: root.roleColor(root.networkState.compact
? root.networkState.compact.role
: "ui.minor")
3059 + anchors.centerIn: parent
3023 3060 theme: root.theme
3024 3061 variant:
"meta" 3026 - const dbm
= wifiRow.modelData.signalDbm;
3027 - const sig
= (dbm
=== null || dbm
=== undefined)
? `${wifiRow.modelData.signal}
/4 bars` : `${dbm}
dBm`;
3028 - return `${wifiRow.modelData.securityLabel
|| "Open"}
· ${sig}
`;
3030 - color: root.theme
? root.theme.content.normal
: "white" 3062 + text: root.networkState.wifi
&& root.networkState.wifi.enabled
? "on" : "off" 3035 - visible: wifiRow.active
&& !!wifiRow.detail.bssid
3066 + anchors.fill: parent
3067 + onClicked: root.toggleWifi()
3075 + color: root.theme
? root.theme.withAlpha(root.theme.ui.accent, root.networkState.scanning
? 0.32 : 0.16)
: "transparent" 3077 + border.color: root.theme
? root.theme.ui.accent
: "transparent" 3080 + anchors.centerIn: parent
3083 + text: root.networkState.scanning
? "scan…" : "scan" 3087 + anchors.fill: parent
3088 + onClicked: root.scanWifi()
3094 + width: parent.width
3098 + model: root.networkState.networks
|| []
3100 + delegate: Column {
3103 + required property
var modelData
3104 + readonly property bool
active: modelData.connected
=== true 3105 + readonly property bool
revealed: root.expandedSsid
=== modelData.ssid
3106 + readonly property
var detail: root.networkState.connectionDetail
|| ({})
3036 3108 width: parent.width
3042 - text:
`${wifiRow.detail.band
|| "?"}${wifiRow.detail.channel
? " · ch " + wifiRow.detail.channel
: ""}${wifiRow.detail.mode
? " · " + wifiRow.detail.mode
: ""}
` 3049 - visible:
!!wifiRow.detail.rxRate
|| !!wifiRow.detail.txRate
3050 - text:
`↓ ${wifiRow.detail.rxRate
|| "?"}
↑ ${wifiRow.detail.txRate
|| "?"}
` 3057 - text: wifiRow.detail.bssid
3065 - visible:
!wifiRow.modelData.needsPassphrase
3069 - visible:
!wifiRow.active
3073 - color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.18)
: "transparent" 3075 - border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.7)
: "white" 3114 + width: parent.width
3117 + color: root.theme
? root.theme.withAlpha(root.theme.ui.backdrop, wifiRow.active
? 0.82 : 0.55)
: "#333333" 3118 + border.width: (wifiRow.active
|| wifiRow.revealed)
? 2 : 1 3119 + border.color: root.theme
? (wifiRow.active
? root.theme.ui.accent
: (wifiRow.modelData.state
=== "connecting" ? root.roleColor(
"warning")
: (wifiRow.revealed
? root.theme.withAlpha(root.theme.ui.accent,
0.6)
: root.theme.withAlpha(root.theme.ui.minor,
0.45))))
: "white" 3123 + anchors.left: parent.left
3124 + anchors.top: parent.top
3125 + anchors.bottom: parent.bottom
3126 + anchors.margins:
2 3129 + color: root.theme
? root.theme.ui.accent
: "transparent" 3130 + opacity: wifiRow.active
? 1 : 0 3136 + anchors.left: parent.left
3137 + anchors.leftMargin:
12 3138 + anchors.verticalCenter: parent.verticalCenter
3139 + font.family:
"Symbols Nerd Font Mono" 3140 + font.pixelSize:
18 3141 + text: wifiRow.modelData.signalGlyph
|| "" 3142 + color: root.roleColor(wifiRow.modelData.signalRole
|| "ui.minor")
3149 + anchors.right: parent.right
3150 + anchors.rightMargin:
12 3151 + anchors.verticalCenter: parent.verticalCenter
3152 + font.family:
"Symbols Nerd Font Mono" 3153 + font.pixelSize:
16 3155 + rotation: wifiRow.revealed
? 90 : 0 3156 + color: root.roleColor(wifiRow.active
? "content.accent" : "ui.minor")
3078 - anchors.centerIn: parent
3162 + anchors.right: wifiChevron.left
3163 + anchors.rightMargin:
10 3164 + anchors.verticalCenter: parent.verticalCenter
3079 3165 theme: root.theme
3080 3166 variant:
"meta" 3167 + text: wifiRow.active
? "connected" : (wifiRow.modelData.securityLabel
|| "")
3168 + color: root.roleColor(wifiRow.active
? "content.accent" : "ui.minor")
3172 + anchors.left: wifiGlyph.right
3173 + anchors.leftMargin:
10 3174 + anchors.right: wifiLabel.left
3175 + anchors.rightMargin:
10 3176 + anchors.verticalCenter: parent.verticalCenter
3178 + text: wifiRow.modelData.ssid
3179 + elide:
Text.ElideRight
3085 3183 anchors.fill: parent
3087 - root.expandedSsid
= "";
3088 - root.selectNetwork(wifiRow.modelData.id);
3184 + onClicked: root.expandRow(wifiRow.modelData)
3095 - visible: wifiRow.active
3099 - color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.18)
: "transparent" 3192 + visible: wifiRow.revealed
3193 + width: parent.width
3194 + height: visible
? drawerCol.height
+ 16 : 0 3196 + color: root.theme
? root.theme.withAlpha(root.theme.ui.backdrop,
0.55)
: "#333333" 3100 3197 border.width:
1 3101 - border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.7)
: "white" 3104 - anchors.centerIn: parent
3107 - text:
"disconnect" 3111 - anchors.fill: parent
3113 - root.expandedSsid
= "";
3114 - root.disconnectNetwork();
3121 - visible: wifiRow.active
|| wifiRow.modelData.known
3125 - color: root.theme
? root.theme.withAlpha(root.theme.error,
0.18)
: "transparent" 3127 - border.color: root.theme
? root.theme.withAlpha(root.theme.error,
0.7)
: "white" 3130 - anchors.centerIn: parent
3137 - anchors.fill: parent
3139 - root.expandedSsid
= "";
3140 - root.forgetNetwork(wifiRow.modelData.id);
3154 - function submit() {
3155 - root.connectSecured(wifiRow.modelData.ssid, wifiPp.text);
3157 - root.expandedSsid
= "";
3160 - visible: wifiRow.modelData.needsPassphrase
3161 - width: parent.width
3162 - height: visible
? 34 : 0 3164 - color: root.theme
? root.theme.withAlpha(root.theme.ui.backdrop,
0.7)
: "#333333" 3166 - border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.6)
: "white" 3167 - onVisibleChanged: {
3168 - if (visible
&& wifiRow.revealed)
3169 - Qt.callLater(
function() {
3170 - wifiPp.forceActiveFocus();
3177 - anchors.left: parent.left
3178 - anchors.leftMargin:
12 3179 - anchors.right: wifiPpConfirm.left
3180 - anchors.rightMargin:
10 3181 - anchors.verticalCenter: parent.verticalCenter
3182 - verticalAlignment:
TextInput.AlignVCenter
3183 - color: root.theme
? root.theme.content.normal
: "white" 3184 - selectionColor: root.theme
? root.theme.ui.focus
: "#ffffff" 3185 - selectedTextColor: root.theme
? root.theme.content.backdrop
: "black" 3186 - font.family:
"IBM Plex Sans" 3187 - font.pixelSize:
13 3188 - echoMode:
TextInput.Password
3198 + border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.4)
: "white" 3190 - onAccepted: wifiPpRow.submit()
3191 - Keys.onReturnPressed: (event)
=> {
3192 - event.accepted
= true;
3193 - wifiPpRow.submit();
3195 - Keys.onEnterPressed: (event)
=> {
3196 - event.accepted
= true;
3197 - wifiPpRow.submit();
3199 - Keys.onEscapePressed: (event)
=> {
3200 - event.accepted
= true;
3202 - root.expandedSsid
= "";
3206 + width: parent.width
- 24 3214 + const dbm
= wifiRow.modelData.signalDbm;
3215 + const sig
= (dbm
=== null || dbm
=== undefined)
? `${wifiRow.modelData.signal}
/4 bars` : `${dbm}
dBm`;
3216 + return `${wifiRow.modelData.securityLabel
|| "Open"}
· ${sig}
`;
3218 + color: root.theme
? root.theme.content.normal
: "white" 3223 + visible: wifiRow.active
&& !!wifiRow.detail.bssid
3224 + width: parent.width
3230 + text:
`${wifiRow.detail.band
|| "?"}${wifiRow.detail.channel
? " · ch " + wifiRow.detail.channel
: ""}${wifiRow.detail.mode
? " · " + wifiRow.detail.mode
: ""}
` 3237 + visible:
!!wifiRow.detail.rxRate
|| !!wifiRow.detail.txRate
3238 + text:
`↓ ${wifiRow.detail.rxRate
|| "?"}
↑ ${wifiRow.detail.txRate
|| "?"}
` 3245 + text: wifiRow.detail.bssid
3252 + visible:
!wifiRow.modelData.needsPassphrase
3256 + visible:
!wifiRow.active
3260 + color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.18)
: "transparent" 3262 + border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.7)
: "white" 3265 + anchors.centerIn: parent
3272 + anchors.fill: parent
3274 + root.expandedSsid
= "";
3275 + root.selectNetwork(wifiRow.modelData.id);
3281 + visible: wifiRow.active
3285 + color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.18)
: "transparent" 3287 + border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.7)
: "white" 3290 + anchors.centerIn: parent
3293 + text:
"disconnect" 3297 + anchors.fill: parent
3299 + root.expandedSsid
= "";
3300 + root.disconnectNetwork();
3306 + visible: wifiRow.active
|| wifiRow.modelData.known
3310 + color: root.theme
? root.theme.withAlpha(root.theme.error,
0.18)
: "transparent" 3312 + border.color: root.theme
? root.theme.withAlpha(root.theme.error,
0.7)
: "white" 3315 + anchors.centerIn: parent
3322 + anchors.fill: parent
3324 + root.expandedSsid
= "";
3325 + root.forgetNetwork(wifiRow.modelData.id);
3337 + function submit() {
3338 + root.connectSecured(wifiRow.modelData.ssid, wifiPp.text);
3340 + root.expandedSsid
= "";
3343 + visible: wifiRow.modelData.needsPassphrase
3344 + width: parent.width
3345 + height: visible
? 34 : 0 3347 + color: root.theme
? root.theme.withAlpha(root.theme.ui.backdrop,
0.7)
: "#333333" 3349 + border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.6)
: "white" 3350 + onVisibleChanged: {
3351 + if (visible
&& wifiRow.revealed)
3352 + Qt.callLater(
function () {
3353 + wifiPp.forceActiveFocus();
3360 + anchors.left: parent.left
3361 + anchors.leftMargin:
12 3362 + anchors.right: wifiPpConfirm.left
3363 + anchors.rightMargin:
10 3364 + anchors.verticalCenter: parent.verticalCenter
3365 + verticalAlignment:
TextInput.AlignVCenter
3366 + color: root.theme
? root.theme.content.normal
: "white" 3367 + selectionColor: root.theme
? root.theme.ui.focus
: "#ffffff" 3368 + selectedTextColor: root.theme
? root.theme.content.backdrop
: "black" 3369 + font.family:
"IBM Plex Sans" 3370 + font.pixelSize:
13 3371 + echoMode:
TextInput.Password
3373 + onAccepted: wifiPpRow.submit()
3374 + Keys.onReturnPressed: event
=> {
3375 + event.accepted
= true;
3376 + wifiPpRow.submit();
3378 + Keys.onEnterPressed: event
=> {
3379 + event.accepted
= true;
3380 + wifiPpRow.submit();
3382 + Keys.onEscapePressed: event
=> {
3383 + event.accepted
= true;
3385 + root.expandedSsid
= "";
3390 + anchors.left: parent.left
3391 + anchors.leftMargin:
12 3392 + anchors.verticalCenter: parent.verticalCenter
3393 + visible: wifiPp.text.length
=== 0 3396 + text:
"passphrase" 3403 + anchors.right: parent.right
3404 + anchors.rightMargin:
6 3405 + anchors.verticalCenter: parent.verticalCenter
3409 + color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.22)
: "transparent" 3411 + border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.7)
: "white" 3414 + anchors.centerIn: parent
3421 + anchors.fill: parent
3422 + onClicked: wifiPpRow.submit()
3433 + visible:
!!(root.networkState.wifi
&& root.networkState.wifi.enabled)
&& (
!root.networkState.networks
|| root.networkState.networks.length
=== 0)
3436 + text: root.networkState.scanning
? "scanning…" : "no networks" 3442 + width: parent.width
3444 + color: root.theme
? root.theme.ui.accent
: "transparent" 3448 + objectName:
"bluetoothToggleScanList" 3449 + width: parent.width
3453 + width: parent.width
3460 + width: parent.width
- 132 3467 + color: root.theme
? root.theme.withAlpha(root.bluetoothState.adapter
&& root.bluetoothState.adapter.state
=== "powered" ? root.theme.ui.focus
: root.theme.ui.minor,
0.22)
: "transparent" 3469 + border.color: root.roleColor(root.bluetoothState.compact
? root.bluetoothState.compact.role
: "ui.minor")
3472 + anchors.centerIn: parent
3475 + text: root.bluetoothState.adapter
&& root.bluetoothState.adapter.state
=== "powered" ? "on" : "off" 3479 + anchors.fill: parent
3480 + onClicked: root.toggleBluetooth()
3488 + color: root.theme
? root.theme.withAlpha(root.theme.ui.accent, root.bluetoothState.adapter
&& root.bluetoothState.adapter.discovering
? 0.32 : 0.16)
: "transparent" 3490 + border.color: root.theme
? root.theme.ui.accent
: "transparent" 3493 + anchors.centerIn: parent
3496 + text: root.bluetoothState.adapter
&& root.bluetoothState.adapter.discovering
? "scan…" : "scan" 3500 + anchors.fill: parent
3501 + onClicked: root.scanBluetooth()
3507 + width: parent.width
3511 + model: root.bluetoothState.devices
|| []
3513 + delegate: Rectangle {
3516 + required property
var modelData
3521 + color: root.theme
? root.theme.withAlpha(modelData.connected
? root.theme.ui.focus
: root.theme.ui.minor, modelData.connected
? 0.24 : 0.1)
: "transparent" 3523 + border.color: root.roleColor(modelData.blocked
? "error" : modelData.connected
? "ui.accent" : "ui.minor")
3207 3526 anchors.left: parent.left
3208 - anchors.leftMargin:
12 3527 + anchors.leftMargin:
8 3528 + anchors.verticalCenter: parent.verticalCenter
3530 + text: deviceRow.modelData.name
3531 + width: parent.width
- 136 3532 + elide:
Text.ElideRight
3536 + objectName:
"batteryBadges" 3537 + anchors.right: parent.right
3538 + anchors.rightMargin:
8 3209 3539 anchors.verticalCenter: parent.verticalCenter
3210 - visible: wifiPp.text.length
=== 0 3211 3540 theme: root.theme
3212 3541 variant:
"meta" 3213 - text:
"passphrase" 3542 + text: deviceRow.modelData.battery
>= 0 ? `${deviceRow.modelData.battery}
%` : "--" 3220 - anchors.right: parent.right
3221 - anchors.rightMargin:
6 3222 - anchors.verticalCenter: parent.verticalCenter
3226 - color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.22)
: "transparent" 3228 - border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.7)
: "white" 3231 - anchors.centerIn: parent
3546 + anchors.fill: parent
3547 + acceptedButtons:
Qt.LeftButton
| Qt.MiddleButton
| Qt.RightButton
3548 + onClicked: event
=> {
3549 + if (event.button
=== Qt.MiddleButton)
3550 + root.bluetoothAction(
"forget", deviceRow.modelData.id);
3551 + else if (event.button
=== Qt.RightButton)
3552 + root.bluetoothAction(deviceRow.modelData.trusted
? "block" : "trust", deviceRow.modelData.id);
3554 + root.bluetoothAction(deviceRow.modelData.connected
? "disconnect" : "connect", deviceRow.modelData.id);
3238 - anchors.fill: parent
3239 - onClicked: wifiPpRow.submit()
3257 - visible:
!!(root.networkState.wifi
&& root.networkState.wifi.enabled)
&& (
!root.networkState.networks
|| root.networkState.networks.length
=== 0)
3260 - text: root.networkState.scanning
? "scanning…" : "no networks" 3267 - width: parent.width
3269 - color: root.theme
? root.theme.ui.accent
: "transparent" 3273 - objectName:
"bluetoothToggleScanList" 3274 - width: parent.width
3278 - width: parent.width
3285 - width: parent.width
- 132 3292 - color: root.theme
? root.theme.withAlpha(root.bluetoothState.adapter
&& root.bluetoothState.adapter.state
=== "powered" ? root.theme.ui.focus
: root.theme.ui.minor,
0.22)
: "transparent" 3294 - border.color: root.roleColor(root.bluetoothState.compact
? root.bluetoothState.compact.role
: "ui.minor")
3297 - anchors.centerIn: parent
3300 - text: root.bluetoothState.adapter
&& root.bluetoothState.adapter.state
=== "powered" ? "on" : "off" 3304 - anchors.fill: parent
3305 - onClicked: root.toggleBluetooth()
3314 - color: root.theme
? root.theme.withAlpha(root.theme.ui.accent, root.bluetoothState.adapter
&& root.bluetoothState.adapter.discovering
? 0.32 : 0.16)
: "transparent" 3316 - border.color: root.theme
? root.theme.ui.accent
: "transparent" 3319 - anchors.centerIn: parent
3322 - text: root.bluetoothState.adapter
&& root.bluetoothState.adapter.discovering
? "scan…" : "scan" 3326 - anchors.fill: parent
3327 - onClicked: root.scanBluetooth()
3335 - width: parent.width
3339 - model: root.bluetoothState.devices
|| []
3341 - delegate: Rectangle {
3344 - required property
var modelData
3349 - color: root.theme
? root.theme.withAlpha(modelData.connected
? root.theme.ui.focus
: root.theme.ui.minor, modelData.connected
? 0.24 : 0.1)
: "transparent" 3351 - border.color: root.roleColor(modelData.blocked
? "error" : modelData.connected
? "ui.accent" : "ui.minor")
3354 - anchors.left: parent.left
3355 - anchors.leftMargin:
8 3356 - anchors.verticalCenter: parent.verticalCenter
3358 - text: deviceRow.modelData.name
3359 - width: parent.width
- 136 3360 - elide:
Text.ElideRight
3364 - objectName:
"batteryBadges" 3365 - anchors.right: parent.right
3366 - anchors.rightMargin:
8 3367 - anchors.verticalCenter: parent.verticalCenter
3370 - text: deviceRow.modelData.battery
>= 0 ? `${deviceRow.modelData.battery}
%` : "--" 3374 - anchors.fill: parent
3375 - acceptedButtons:
Qt.LeftButton
| Qt.MiddleButton
| Qt.RightButton
3376 - onClicked: (event)
=> {
3377 - if (event.button
=== Qt.MiddleButton)
3378 - root.bluetoothAction(
"forget", deviceRow.modelData.id);
3379 - else if (event.button
=== Qt.RightButton)
3380 - root.bluetoothAction(deviceRow.modelData.trusted
? "block" : "trust", deviceRow.modelData.id);
3382 - root.bluetoothAction(deviceRow.modelData.connected
? "disconnect" : "connect", deviceRow.modelData.id);
3400 3565 component
TrayPanel:
Column {
3403 - required property QtObject theme
3404 - required property QtObject trayService
3405 - property
var state: trayService
? Util.parseJson(trayService.stateJson(), {
3568 + required property Theme theme
3569 + required property Tray trayService
3570 + property
var panelState: trayService
? Util.parseJson(trayService.stateJson(), {
3410 - readonly property
var items: state.items
|| []
3575 + readonly property
var items: panelState.items
|| []
3411 3576 readonly property bool
hasItems: items.length
> 0 3413 3578 function refreshFrom(text) {
3414 - state
= Util.parseJson(text, state);
3579 + panelState
= Util.parseJson(text, panelState);
3417 3582 function activate(id) {
3418 3583 if (trayService)
3419 3584 refreshFrom(trayService.activateRow(id));
3471 3635 width: parent.width
- 34 3472 3636 elide:
Text.ElideRight
3478 3641 anchors.fill: parent
3479 3642 onClicked: root.activate(itemCell.modelData.id)
3525 3684 variant:
"meta" 3526 3685 text:
"Background apps show up here" 3535 3691 component
PowerPanel:
Column {
3538 - required property QtObject theme
3539 - required property QtObject powerService
3540 - property
var state: powerService
? Util.parseJson(powerService.stateJson(), {
3694 + required property Theme theme
3695 + required property Power powerService
3696 + property
var panelState: powerService
? Util.parseJson(powerService.stateJson(), {
3543 3698 "externalDevices": []
3547 - "externalDevices": []
3549 - readonly property
var battery: state.battery
|| ({
3551 - readonly property
var devices: state.externalDevices
|| []
3552 - readonly property
var sessionActions: state.sessionActions
|| [
"lock",
"suspend",
"monitor-off",
"monitor-on",
"logout",
"reboot",
"poweroff"]
3701 + "externalDevices": []
3703 + readonly property
var battery: panelState.battery
|| ({})
3704 + readonly property
var devices: panelState.externalDevices
|| []
3705 + readonly property
var sessionActions: panelState.sessionActions
|| [
"lock",
"suspend",
"monitor-off",
"monitor-on",
"logout",
"reboot",
"poweroff"]
3555 3707 function refreshFrom(text) {
3556 - state
= Util.parseJson(text, state);
3708 + panelState
= Util.parseJson(text, panelState);
3559 3711 function runSession(action) {
3560 3712 if (powerService)
3561 3713 refreshFrom(powerService.sessionAction(action));
3565 3716 function confirm(action) {
3566 3717 if (powerService)
3567 3718 refreshFrom(powerService.confirmAction(action));
3571 3721 function cancel() {
3572 3722 if (powerService)
3573 3723 refreshFrom(powerService.cancelAction());
3577 3726 function roleColor(role) {
3607 3756 width: parent
? parent.width
: 0 3609 3758 Keys.onEscapePressed: root.cancel()
3610 - Keys.onReturnPressed: root.state.pendingConfirmation
? root.confirm(root.state.pendingConfirmation)
: root.runSession(
"lock")
3611 - Keys.onEnterPressed: root.state.pendingConfirmation
? root.confirm(root.state.pendingConfirmation)
: root.runSession(
"lock")
3759 + Keys.onReturnPressed: root.panelState.pendingConfirmation
? root.confirm(root.panelState.pendingConfirmation)
: root.runSession(
"lock")
3760 + Keys.onEnterPressed: root.panelState.pendingConfirmation
? root.confirm(root.panelState.pendingConfirmation)
: root.runSession(
"lock")
3614 3763 objectName:
"batteryHero" 3643 3792 horizontalAlignment:
Text.AlignRight
3659 3807 radius: parent.radius
3660 3808 color: root.roleColor(root.battery.role
|| "ui.accent")
3682 3829 horizontalAlignment:
Text.AlignRight
3727 3871 variant:
"meta" 3728 3872 text:
`${deviceRow.modelData.percent}
%` 3751 3892 required property string modelData
3752 3893 readonly property bool destructive: [
"logout",
"reboot",
"poweroff"].indexOf(modelData)
>= 0 3753 - readonly property bool pending: root.state.pendingConfirmation
=== modelData
3894 + readonly property bool pending: root.panelState.pendingConfirmation
=== modelData
3755 3896 readonly property color accent: root.theme
? (pending
? root.theme.warning
: destructive
? root.theme.error
: root.theme.ui.accent)
: "transparent" 3756 3897 width:
Math.floor((root.width
- 18)
/ 4)
3772 3913 anchors.fill: parent
3773 3914 onClicked: root.runSession(actionButton.modelData)
3783 3921 objectName:
"confirmationStrip" 3784 3922 width: parent.width
3785 - height: root.state.pendingConfirmation
? 36 : 26 3923 + height: root.panelState.pendingConfirmation
? 36 : 26 3787 3925 color: root.theme
? root.theme.withAlpha(root.theme.ui.backdrop,
0.55)
: "transparent" 3788 3926 border.width:
1 3789 - border.color: root.theme
? root.theme.withAlpha(root.state.pendingConfirmation
? root.theme.warning
: root.theme.ui.minor,
0.6)
: "transparent" 3927 + border.color: root.theme
? root.theme.withAlpha(root.panelState.pendingConfirmation
? root.theme.warning
: root.theme.ui.minor,
0.6)
: "transparent" 3792 3930 anchors.left: parent.left
3794 3932 anchors.verticalCenter: parent.verticalCenter
3795 3933 theme: root.theme
3796 3934 variant:
"meta" 3797 - text: root.state.pendingConfirmation
? `Confirm ${root.state.pendingConfirmation}
? · Enter` : "Enter locks · Esc closes" 3798 - width: parent.width
- (root.state.pendingConfirmation
? 128 : 16)
3935 + text: root.panelState.pendingConfirmation
? `Confirm ${root.panelState.pendingConfirmation}
? · Enter` : "Enter locks · Esc closes" 3936 + width: parent.width
- (root.panelState.pendingConfirmation
? 128 : 16)
3799 3937 elide:
Text.ElideRight
3804 3942 anchors.rightMargin:
6 3805 3943 anchors.verticalCenter: parent.verticalCenter
3807 - visible:
!!root.state.pendingConfirmation
3945 + visible:
!!root.panelState.pendingConfirmation
3825 3963 anchors.fill: parent
3826 - onClicked: root.confirm(root.state.pendingConfirmation)
3964 + onClicked: root.confirm(root.panelState.pendingConfirmation)
3847 3984 anchors.fill: parent
3848 3985 onClicked: root.cancel()
3859 3992 component
AudioPanel:
Column {
3862 - required property QtObject theme
3863 - required property QtObject audioService
3864 - property
var state: audioService
? Util.parseJson(audioService.stateJson(), {
3995 + required property Theme theme
3996 + required property Audio audioService
3997 + property
var panelState: audioService
? Util.parseJson(audioService.stateJson(), {
3877 - readonly property
var sinks: state.sinks
|| []
3878 - readonly property
var sources: state.sources
|| []
3879 - readonly property
var streams: state.streams
|| []
4008 + readonly property
var sinks: panelState.sinks
|| []
4009 + readonly property
var sources: panelState.sources
|| []
4010 + readonly property
var streams: panelState.streams
|| []
3881 4012 property string
expandedSink:
"" 3882 4013 property string
expandedSource:
"" 3885 4015 function refreshFrom(text) {
3886 - state
= Util.parseJson(text, state);
4016 + panelState
= Util.parseJson(text, panelState);
3889 4019 function setVolume(id, ratio) {
3890 4020 if (audioService)
3891 4021 refreshFrom(audioService.setVolume(id,
Math.
max(
0,
Math.
min(
1.5, ratio))));
3895 4024 function toggleMute(id) {
3896 4025 if (audioService)
3897 4026 refreshFrom(audioService.toggleMute(id));
3901 4029 function selectSink(id) {
3902 4030 if (audioService)
3903 4031 refreshFrom(audioService.setDefaultSink(id));
3907 4034 function selectSource(id) {
3908 4035 if (audioService)
3909 4036 refreshFrom(audioService.setDefaultSource(id));
3913 4039 function roleColor(role) {
3942 4068 boundsBehavior:
Flickable.StopAtBounds
3943 4069 flickableDirection:
Flickable.VerticalFlick
3948 - width: parent.width
3955 - objectName:
"outputSection" 3956 - width: parent.width
3966 4074 width: parent.width
3972 - delegate: Column {
3975 - required property
var modelData
3976 - readonly property bool
revealed: root.expandedSink
=== modelData.id
3978 - width: parent.width
4081 + objectName:
"outputSection" 3982 4082 width: parent.width
3985 - color: root.theme
? root.theme.withAlpha(root.theme.ui.backdrop, sinkRow.modelData.isDefault
? 0.82 : 0.55)
: "transparent" 3986 - border.width: (sinkRow.modelData.isDefault
|| sinkRow.revealed)
? 2 : 1 3987 - border.color: root.theme
? (sinkRow.modelData.isDefault
? root.theme.ui.accent
: (sinkRow.revealed
? root.theme.withAlpha(root.theme.ui.accent,
0.6)
: root.theme.withAlpha(root.theme.ui.minor,
0.45)))
: "transparent" 3993 - anchors.fill: parent
3994 - onClicked: root.expandedSink
= sinkRow.revealed
? "" : sinkRow.modelData.id
3999 - anchors.left: parent.left
4000 - anchors.top: parent.top
4001 - anchors.bottom: parent.bottom
4002 - anchors.margins:
2 4005 - color: root.theme
? root.theme.ui.accent
: "transparent" 4006 - opacity: sinkRow.modelData.isDefault
? 1 : 0 4012 - anchors.left: parent.left
4013 - anchors.leftMargin:
12 4014 - anchors.verticalCenter: parent.verticalCenter
4015 - font.family:
"Symbols Nerd Font Mono" 4016 - font.pixelSize:
18 4017 - text: sinkRow.modelData.glyph
4018 - color: root.roleColor(sinkRow.modelData.role)
4019 - opacity: sinkRow.modelData.muted
? 0.5 : 1 4023 4086 theme: root.theme
4024 - text: sinkRow.modelData.name
4025 - anchors.left: sinkGlyph.right
4026 - anchors.leftMargin:
10 4027 - anchors.right: sinkTrack.left
4028 - anchors.rightMargin:
10 4029 - anchors.verticalCenter: parent.verticalCenter
4030 - elide:
Text.ElideRight
4031 - opacity: sinkRow.modelData.muted
? 0.5 : 1 4037 - anchors.right: parent.right
4038 - anchors.rightMargin:
12 4039 - anchors.verticalCenter: parent.verticalCenter
4042 - text: sinkRow.modelData.muted
? "muted" : `${sinkRow.modelData.percent}
%` 4043 - color: root.roleColor(sinkRow.modelData.muted
? "ui.minor" : sinkRow.modelData.role)
4050 - anchors.right: sinkTrailing.left
4051 - anchors.rightMargin:
10 4052 - anchors.verticalCenter: parent.verticalCenter
4056 - color: root.theme
? root.theme.withAlpha(root.theme.ui.minor,
0.28)
: "transparent" 4059 - anchors.left: parent.left
4060 - anchors.top: parent.top
4061 - anchors.bottom: parent.bottom
4062 - width: parent.width
* (sinkRow.modelData.percent
/ 150)
4063 - radius: parent.radius
4064 - color: root.roleColor(sinkRow.modelData.role)
4065 - visible:
!sinkRow.modelData.muted
4069 - anchors.fill: parent
4070 - onClicked: (event)
=> {
4071 - return root.setVolume(sinkRow.modelData.id, event.x
/ Math.
max(
1, width)
* 1.5);
4073 - onPositionChanged: (event)
=> {
4075 - root.setVolume(sinkRow.modelData.id, event.x
/ Math.
max(
1, width)
* 1.5);
4086 - visible: sinkRow.revealed
4087 4092 width: parent.width
4088 - height: visible
? sinkOpts.height
+ 16 : 0 4090 - color: root.theme
? root.theme.withAlpha(root.theme.ui.backdrop,
0.55)
: "#333333" 4092 - border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.4)
: "white" 4098 + delegate: Column {
4103 - visible:
!sinkRow.modelData.isDefault
4107 - color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.18)
: "transparent" 4109 - border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.7)
: "white" 4101 + required property
var modelData
4102 + readonly property bool
revealed: root.expandedSink
=== modelData.id
4112 - anchors.centerIn: parent
4115 - text:
"set default" 4104 + width: parent.width
4119 - anchors.fill: parent
4121 - root.expandedSink
= "";
4122 - root.selectSink(sinkRow.modelData.id);
4108 + width: parent.width
4111 + color: root.theme
? root.theme.withAlpha(root.theme.ui.backdrop, sinkRow.modelData.isDefault
? 0.82 : 0.55)
: "transparent" 4112 + border.width: (sinkRow.modelData.isDefault
|| sinkRow.revealed)
? 2 : 1 4113 + border.color: root.theme
? (sinkRow.modelData.isDefault
? root.theme.ui.accent
: (sinkRow.revealed
? root.theme.withAlpha(root.theme.ui.accent,
0.6)
: root.theme.withAlpha(root.theme.ui.minor,
0.45)))
: "transparent" 4119 + anchors.fill: parent
4120 + onClicked: root.expandedSink
= sinkRow.revealed
? "" : sinkRow.modelData.id
4125 + anchors.left: parent.left
4126 + anchors.top: parent.top
4127 + anchors.bottom: parent.bottom
4128 + anchors.margins:
2 4131 + color: root.theme
? root.theme.ui.accent
: "transparent" 4132 + opacity: sinkRow.modelData.isDefault
? 1 : 0 4138 + anchors.left: parent.left
4139 + anchors.leftMargin:
12 4140 + anchors.verticalCenter: parent.verticalCenter
4141 + font.family:
"Symbols Nerd Font Mono" 4142 + font.pixelSize:
18 4143 + text: sinkRow.modelData.glyph
4144 + color: root.roleColor(sinkRow.modelData.role)
4145 + opacity: sinkRow.modelData.muted
? 0.5 : 1 4150 + text: sinkRow.modelData.name
4151 + anchors.left: sinkGlyph.right
4152 + anchors.leftMargin:
10 4153 + anchors.right: sinkTrack.left
4154 + anchors.rightMargin:
10 4155 + anchors.verticalCenter: parent.verticalCenter
4156 + elide:
Text.ElideRight
4157 + opacity: sinkRow.modelData.muted
? 0.5 : 1 4163 + anchors.right: parent.right
4164 + anchors.rightMargin:
12 4165 + anchors.verticalCenter: parent.verticalCenter
4168 + text: sinkRow.modelData.muted
? "muted" : `${sinkRow.modelData.percent}
%` 4169 + color: root.roleColor(sinkRow.modelData.muted
? "ui.minor" : sinkRow.modelData.role)
4176 + anchors.right: sinkTrailing.left
4177 + anchors.rightMargin:
10 4178 + anchors.verticalCenter: parent.verticalCenter
4182 + color: root.theme
? root.theme.withAlpha(root.theme.ui.minor,
0.28)
: "transparent" 4185 + anchors.left: parent.left
4186 + anchors.top: parent.top
4187 + anchors.bottom: parent.bottom
4188 + width: parent.width
* (sinkRow.modelData.percent
/ 150)
4189 + radius: parent.radius
4190 + color: root.roleColor(sinkRow.modelData.role)
4191 + visible:
!sinkRow.modelData.muted
4195 + anchors.fill: parent
4196 + onClicked: event
=> {
4197 + return root.setVolume(sinkRow.modelData.id, event.x
/ Math.
max(
1, width)
* 1.5);
4199 + onPositionChanged: event
=> {
4201 + root.setVolume(sinkRow.modelData.id, event.x
/ Math.
max(
1, width)
* 1.5);
4210 + visible: sinkRow.revealed
4211 + width: parent.width
4212 + height: visible
? sinkOpts.height
+ 16 : 0 4214 + color: root.theme
? root.theme.withAlpha(root.theme.ui.backdrop,
0.55)
: "#333333" 4216 + border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.4)
: "white" 4132 - color: root.theme
? root.theme.withAlpha(sinkRow.modelData.muted
? root.theme.warning
: root.theme.ui.accent,
0.18)
: "transparent" 4134 - border.color: root.theme
? root.theme.withAlpha(sinkRow.modelData.muted
? root.theme.warning
: root.theme.ui.accent,
0.7)
: "white" 4137 - anchors.centerIn: parent
4140 - text: sinkRow.modelData.muted
? "unmute" : "mute" 4227 + visible:
!sinkRow.modelData.isDefault
4231 + color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.18)
: "transparent" 4233 + border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.7)
: "white" 4236 + anchors.centerIn: parent
4239 + text:
"set default" 4243 + anchors.fill: parent
4245 + root.expandedSink
= "";
4246 + root.selectSink(sinkRow.modelData.id);
4255 + color: root.theme
? root.theme.withAlpha(sinkRow.modelData.muted
? root.theme.warning
: root.theme.ui.accent,
0.18)
: "transparent" 4257 + border.color: root.theme
? root.theme.withAlpha(sinkRow.modelData.muted
? root.theme.warning
: root.theme.ui.accent,
0.7)
: "white" 4260 + anchors.centerIn: parent
4263 + text: sinkRow.modelData.muted
? "unmute" : "mute" 4267 + anchors.fill: parent
4268 + onClicked: root.toggleMute(sinkRow.modelData.id)
4144 - anchors.fill: parent
4145 - onClicked: root.toggleMute(sinkRow.modelData.id)
4164 - objectName:
"inputSection" 4165 - width: parent.width
4175 - width: parent.width
4179 - model: root.sources
4181 - delegate: Column {
4184 - required property
var modelData
4185 - readonly property bool
revealed: root.expandedSource
=== modelData.id
4187 - width: parent.width
4280 + objectName:
"inputSection" 4191 4281 width: parent.width
4194 - color: root.theme
? root.theme.withAlpha(root.theme.ui.backdrop, sourceRow.modelData.isDefault
? 0.82 : 0.55)
: "transparent" 4195 - border.width: (sourceRow.modelData.isDefault
|| sourceRow.revealed)
? 2 : 1 4196 - border.color: root.theme
? (sourceRow.modelData.isDefault
? root.theme.ui.accent
: (sourceRow.revealed
? root.theme.withAlpha(root.theme.ui.accent,
0.6)
: root.theme.withAlpha(root.theme.ui.minor,
0.45)))
: "transparent" 4199 - anchors.fill: parent
4200 - onClicked: root.expandedSource
= sourceRow.revealed
? "" : sourceRow.modelData.id
4204 - anchors.left: parent.left
4205 - anchors.top: parent.top
4206 - anchors.bottom: parent.bottom
4207 - anchors.margins:
2 4210 - color: root.theme
? root.theme.ui.accent
: "transparent" 4211 - opacity: sourceRow.modelData.isDefault
? 1 : 0 4217 - anchors.left: parent.left
4218 - anchors.leftMargin:
12 4219 - anchors.verticalCenter: parent.verticalCenter
4220 - font.family:
"Symbols Nerd Font Mono" 4221 - font.pixelSize:
18 4222 - text: sourceRow.modelData.glyph
4223 - color: root.roleColor(sourceRow.modelData.role)
4224 - opacity: sourceRow.modelData.muted
? 0.5 : 1 4228 4285 theme: root.theme
4229 - text: sourceRow.modelData.name
4230 - anchors.left: sourceGlyph.right
4231 - anchors.leftMargin:
10 4232 - anchors.right: sourceTrack.left
4233 - anchors.rightMargin:
10 4234 - anchors.verticalCenter: parent.verticalCenter
4235 - elide:
Text.ElideRight
4236 - opacity: sourceRow.modelData.muted
? 0.5 : 1 4240 - id: sourceTrailing
4242 - anchors.right: parent.right
4243 - anchors.rightMargin:
12 4244 - anchors.verticalCenter: parent.verticalCenter
4247 - text: sourceRow.modelData.muted
? "muted" : `${sourceRow.modelData.percent}
%` 4248 - color: root.roleColor(sourceRow.modelData.muted
? "ui.minor" : sourceRow.modelData.role)
4254 - anchors.right: sourceTrailing.left
4255 - anchors.rightMargin:
10 4256 - anchors.verticalCenter: parent.verticalCenter
4260 - color: root.theme
? root.theme.withAlpha(root.theme.ui.minor,
0.28)
: "transparent" 4263 - anchors.left: parent.left
4264 - anchors.top: parent.top
4265 - anchors.bottom: parent.bottom
4266 - width: parent.width
* (sourceRow.modelData.percent
/ 150)
4267 - radius: parent.radius
4268 - color: root.roleColor(sourceRow.modelData.role)
4269 - visible:
!sourceRow.modelData.muted
4273 - anchors.fill: parent
4274 - onClicked: (event)
=> {
4275 - return root.setVolume(sourceRow.modelData.id, event.x
/ Math.
max(
1, width)
* 1.5);
4277 - onPositionChanged: (event)
=> {
4279 - root.setVolume(sourceRow.modelData.id, event.x
/ Math.
max(
1, width)
* 1.5);
4290 - visible: sourceRow.revealed
4291 4291 width: parent.width
4292 - height: visible
? sourceOpts.height
+ 16 : 0 4294 - color: root.theme
? root.theme.withAlpha(root.theme.ui.backdrop,
0.55)
: "#333333" 4296 - border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.4)
: "white" 4295 + model: root.sources
4297 + delegate: Column {
4307 - visible:
!sourceRow.modelData.isDefault
4311 - color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.18)
: "transparent" 4313 - border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.7)
: "white" 4300 + required property
var modelData
4301 + readonly property bool
revealed: root.expandedSource
=== modelData.id
4316 - anchors.centerIn: parent
4319 - text:
"set default" 4303 + width: parent.width
4323 - anchors.fill: parent
4325 - root.expandedSource
= "";
4326 - root.selectSource(sourceRow.modelData.id);
4307 + width: parent.width
4310 + color: root.theme
? root.theme.withAlpha(root.theme.ui.backdrop, sourceRow.modelData.isDefault
? 0.82 : 0.55)
: "transparent" 4311 + border.width: (sourceRow.modelData.isDefault
|| sourceRow.revealed)
? 2 : 1 4312 + border.color: root.theme
? (sourceRow.modelData.isDefault
? root.theme.ui.accent
: (sourceRow.revealed
? root.theme.withAlpha(root.theme.ui.accent,
0.6)
: root.theme.withAlpha(root.theme.ui.minor,
0.45)))
: "transparent" 4315 + anchors.fill: parent
4316 + onClicked: root.expandedSource
= sourceRow.revealed
? "" : sourceRow.modelData.id
4320 + anchors.left: parent.left
4321 + anchors.top: parent.top
4322 + anchors.bottom: parent.bottom
4323 + anchors.margins:
2 4326 + color: root.theme
? root.theme.ui.accent
: "transparent" 4327 + opacity: sourceRow.modelData.isDefault
? 1 : 0 4333 + anchors.left: parent.left
4334 + anchors.leftMargin:
12 4335 + anchors.verticalCenter: parent.verticalCenter
4336 + font.family:
"Symbols Nerd Font Mono" 4337 + font.pixelSize:
18 4338 + text: sourceRow.modelData.glyph
4339 + color: root.roleColor(sourceRow.modelData.role)
4340 + opacity: sourceRow.modelData.muted
? 0.5 : 1 4345 + text: sourceRow.modelData.name
4346 + anchors.left: sourceGlyph.right
4347 + anchors.leftMargin:
10 4348 + anchors.right: sourceTrack.left
4349 + anchors.rightMargin:
10 4350 + anchors.verticalCenter: parent.verticalCenter
4351 + elide:
Text.ElideRight
4352 + opacity: sourceRow.modelData.muted
? 0.5 : 1 4356 + id: sourceTrailing
4358 + anchors.right: parent.right
4359 + anchors.rightMargin:
12 4360 + anchors.verticalCenter: parent.verticalCenter
4363 + text: sourceRow.modelData.muted
? "muted" : `${sourceRow.modelData.percent}
%` 4364 + color: root.roleColor(sourceRow.modelData.muted
? "ui.minor" : sourceRow.modelData.role)
4370 + anchors.right: sourceTrailing.left
4371 + anchors.rightMargin:
10 4372 + anchors.verticalCenter: parent.verticalCenter
4376 + color: root.theme
? root.theme.withAlpha(root.theme.ui.minor,
0.28)
: "transparent" 4379 + anchors.left: parent.left
4380 + anchors.top: parent.top
4381 + anchors.bottom: parent.bottom
4382 + width: parent.width
* (sourceRow.modelData.percent
/ 150)
4383 + radius: parent.radius
4384 + color: root.roleColor(sourceRow.modelData.role)
4385 + visible:
!sourceRow.modelData.muted
4389 + anchors.fill: parent
4390 + onClicked: event
=> {
4391 + return root.setVolume(sourceRow.modelData.id, event.x
/ Math.
max(
1, width)
* 1.5);
4393 + onPositionChanged: event
=> {
4395 + root.setVolume(sourceRow.modelData.id, event.x
/ Math.
max(
1, width)
* 1.5);
4404 + visible: sourceRow.revealed
4405 + width: parent.width
4406 + height: visible
? sourceOpts.height
+ 16 : 0 4408 + color: root.theme
? root.theme.withAlpha(root.theme.ui.backdrop,
0.55)
: "#333333" 4410 + border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.4)
: "white" 4336 - color: root.theme
? root.theme.withAlpha(sourceRow.modelData.muted
? root.theme.warning
: root.theme.ui.accent,
0.18)
: "transparent" 4338 - border.color: root.theme
? root.theme.withAlpha(sourceRow.modelData.muted
? root.theme.warning
: root.theme.ui.accent,
0.7)
: "white" 4341 - anchors.centerIn: parent
4344 - text: sourceRow.modelData.muted
? "unmute" : "mute" 4421 + visible:
!sourceRow.modelData.isDefault
4425 + color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.18)
: "transparent" 4427 + border.color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.7)
: "white" 4430 + anchors.centerIn: parent
4433 + text:
"set default" 4437 + anchors.fill: parent
4439 + root.expandedSource
= "";
4440 + root.selectSource(sourceRow.modelData.id);
4449 + color: root.theme
? root.theme.withAlpha(sourceRow.modelData.muted
? root.theme.warning
: root.theme.ui.accent,
0.18)
: "transparent" 4451 + border.color: root.theme
? root.theme.withAlpha(sourceRow.modelData.muted
? root.theme.warning
: root.theme.ui.accent,
0.7)
: "white" 4454 + anchors.centerIn: parent
4457 + text: sourceRow.modelData.muted
? "unmute" : "mute" 4461 + anchors.fill: parent
4462 + onClicked: root.toggleMute(sourceRow.modelData.id)
4348 - anchors.fill: parent
4349 - onClicked: root.toggleMute(sourceRow.modelData.id)
4372 4475 component
MediaPanel:
Column {
4375 - required property QtObject theme
4376 - required property QtObject mediaService
4377 - property
var state: mediaService
? Util.parseJson(mediaService.stateJson(), {
4478 + required property Theme theme
4479 + required property Media mediaService
4480 + property
var panelState: mediaService
? Util.parseJson(mediaService.stateJson(), {
4481 + "activePlayer": {},
4381 - "mediaPanelContract": {
4483 + "mediaPanelContract": {}
4387 - "mediaPanelContract": {
4390 - readonly property
var player: state.activePlayer
|| ({
4392 - readonly property
var players: state.players
|| []
4485 + "activePlayer": {},
4487 + "mediaPanelContract": {}
4489 + readonly property
var player: panelState.activePlayer
|| ({})
4490 + readonly property
var players: panelState.players
|| []
4393 4491 readonly property bool
hasMedia: players.length
> 0 4394 - readonly property
var panel: state.mediaPanelContract
|| ({
4492 + readonly property
var panel: panelState.mediaPanelContract
|| ({})
4396 4493 readonly property
var transportActions: [
"shuffle",
"previous",
"playPause",
"next",
"repeat"]
4399 4495 function mmss(seconds) {
4400 4496 const total
= Math.
max(
0,
Math.
round(
Number(seconds
|| 0)));
4401 4497 const minutes
= Math.
floor(total
/ 60);
4406 4502 function refreshFrom(text) {
4407 - state
= Util.parseJson(text, state);
4503 + panelState
= Util.parseJson(text, panelState);
4410 4506 function runAction(kind) {
4411 4507 if (mediaService)
4412 4508 refreshFrom(mediaService.action(kind));
4416 4511 function seekByRatio(ratio) {
4417 4512 const length
= Math.
max(
0,
Number(player.length
|| 0));
4418 4513 if (mediaService
&& length
> 0)
4419 4514 refreshFrom(mediaService.seek(
Math.
round(
Math.
max(
0,
Math.
min(
1, ratio))
* length)));
4423 4517 function selectPlayer(id) {
4424 4518 if (mediaService)
4425 4519 refreshFrom(mediaService.select(id));
4462 4555 color: root.theme
? root.theme.ui.accent
: "transparent" 4463 4556 opacity: root.player.playbackState
=== "playing" ? 1 : 0.35 4529 4621 anchors.fill: parent
4530 - onClicked: (event)
=> {
4622 + onClicked: event
=> {
4531 4623 return root.seekByRatio(event.x
/ Math.
max(
1, width));
4540 4631 text: root.mmss(root.player.length)
4575 4665 anchors.fill: parent
4576 4666 onClicked: root.runAction(transportButton.modelData)
4622 4707 anchors.fill: parent
4623 4708 onClicked: root.selectPlayer(playerButton.modelData.id)
4669 4750 variant:
"meta" 4670 4751 text:
"Start a track — controls appear here"