diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-13 11:25:07 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-13 11:25:07 +0200 |
| commit | 0309c13e04072aaeca19462d176fefc7e7d4de2c (patch) | |
| tree | c27284d8b250b8e226089244b7340680cb4c52e8 /desktop/island/StatusPill.qml | |
| parent | 782c34578b6ea48ee27bff25e9c7b7d0efab5333 (diff) | |
| download | quickshell-0309c13e04072aaeca19462d176fefc7e7d4de2c.tar.gz quickshell-0309c13e04072aaeca19462d176fefc7e7d4de2c.zip | |
feat(island): the status pill opens the performance panel
A system monitor icon before the controls icon opens the panel in the
status pill's capsule at 600px. A dot on its corner shows the worst of
temperatures, RAM, disks and the public IP check, yellow or red, so a
problem shows without opening anything. The detailed sampling runs only
while the panel is open.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/island/StatusPill.qml')
| -rw-r--r-- | desktop/island/StatusPill.qml | 61 |
1 files changed, 55 insertions, 6 deletions
diff --git a/desktop/island/StatusPill.qml b/desktop/island/StatusPill.qml index 20529ef..dd97855 100644 --- a/desktop/island/StatusPill.qml +++ b/desktop/island/StatusPill.qml @@ -14,11 +14,13 @@ import Quickshell.Widgets import Quickshell.Services.SystemTray import QtQuick import ".." +import "perf" import "Logic.js" as Logic -// Controls icon, volume icon, tray, layout flag. The controls and volume -// icons open their panels in this capsule; the tray is a plain tray; the -// flag switches layout on scroll and ignores clicks. +// Performance icon, controls icon, volume icon, tray, layout flag. The +// performance, controls and volume icons open their panels in this capsule; +// the tray is a plain tray; the flag switches layout on scroll and ignores +// clicks. Capsule { id: pill @@ -29,16 +31,23 @@ Capsule { signal openSound() signal openControls() + signal openPerf() signal openDrawer() // A drawer page, from a control tile's right-click. signal openPage(string page) // Emitted just before a tray menu opens; the menu cannot report its close. signal menuShown() - expanded: panel === "sound" || panel === "controls" + expanded: panel === "sound" || panel === "controls" || panel === "perf" restWidth: restRow.implicitWidth + 24 - panelWidth: 320 - panelHeight: (panel === "controls" ? controlsPanel.implicitHeight : soundPanel.implicitHeight) + 28 + panelWidth: panel === "perf" ? 600 : 320 + panelHeight: (panel === "controls" ? controlsPanel.implicitHeight + : panel === "perf" ? perfPanel.implicitHeight + : soundPanel.implicitHeight) + 28 + + // The detailed sampling (per-core, network, VRAM) runs only while the + // panel shows it. + Binding { target: Perf; property: "detailed"; value: pill.panel === "perf" } // Edit mode never outlives its panel. onPanelChanged: controlsPanel.editing = false @@ -51,6 +60,36 @@ Capsule { visible: opacity > 0 Behavior on opacity { NumberAnimation { duration: 120 } } + // The worst severity as a dot on the corner: IconImage cannot be + // recoloured without an effect layer. Never the accent (AGENTS.md). + Item { + anchors.verticalCenter: parent.verticalCenter + width: 18 + height: 18 + + IconImage { + anchors.fill: parent + source: Quickshell.iconPath("utilities-system-monitor", true) + } + + Rectangle { + anchors { right: parent.right; top: parent.top; rightMargin: -2; topMargin: -2 } + width: 8 + height: 8 + radius: 4 + visible: Perf.severity !== "ok" + color: Perf.severity === "crit" ? Theme.red : Theme.yellow + border.width: 1 + border.color: Theme.base + } + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: pill.openPerf() + } + } + IconImage { anchors.verticalCenter: parent.verticalCenter implicitSize: 18 @@ -151,4 +190,14 @@ Capsule { Behavior on opacity { NumberAnimation { duration: 160 } } onOpenDrawer: page => pill.openPage(page) } + + PerfPanel { + id: perfPanel + x: 14 + y: 14 + width: 600 - 28 + opacity: pill.panel === "perf" ? 1 : 0 + visible: opacity > 0 + Behavior on opacity { NumberAnimation { duration: 160 } } + } } |
