From 0309c13e04072aaeca19462d176fefc7e7d4de2c Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 13 Oct 2026 11:25:07 +0200 Subject: 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 --- desktop/island/Island.qml | 3 ++- desktop/island/StatusPill.qml | 61 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 57 insertions(+), 7 deletions(-) (limited to 'desktop') diff --git a/desktop/island/Island.qml b/desktop/island/Island.qml index 61701d8..dba995d 100644 --- a/desktop/island/Island.qml +++ b/desktop/island/Island.qml @@ -36,7 +36,7 @@ PanelWindow { WlrLayershell.namespace: "quickshell-island" WlrLayershell.keyboardFocus: panel !== "" ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None - // "", "sound", "controls" or "calendar". + // "", "sound", "controls", "perf" or "calendar". property string panel: "" // --- reveal and hide ------------------------------------------------- @@ -220,6 +220,7 @@ PanelWindow { onOpenSound: win.panel = win.panel === "sound" ? "" : "sound" onOpenDrawer: { win.panel = ""; win.drawer.show("sound"); } onOpenControls: win.toggleControls() + onOpenPerf: win.panel = win.panel === "perf" ? "" : "perf" onOpenPage: page => { win.panel = ""; win.drawer.show(page); } } } 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 } } + } } -- cgit v1.2.3