From 885e446bf4d3c23924d9c1fe9c548fecfd77c346 Mon Sep 17 00:00:00 2001 From: Damocles Date: Mon, 13 Apr 2026 22:49:38 +0200 Subject: [PATCH] make HoverPanel fullscreen to avoid Niri resize issues, fix cpu freq color --- modules/Cpu.qml | 2 +- modules/HoverPanel.qml | 29 ++++++++++------------------- modules/Mpris.qml | 1 - 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/modules/Cpu.qml b/modules/Cpu.qml index d49a9fc..815f2cd 100644 --- a/modules/Cpu.qml +++ b/modules/Cpu.qml @@ -222,7 +222,7 @@ M.BarSection { anchors.rightMargin: 12 anchors.verticalCenter: parent.verticalCenter text: parent._f.toFixed(2) - color: parent._barColor + color: M.Theme.base04 font.pixelSize: M.Theme.fontSize - 2 font.family: M.Theme.fontFamily width: 32 diff --git a/modules/HoverPanel.qml b/modules/HoverPanel.qml index 46b7e84..ace6472 100644 --- a/modules/HoverPanel.qml +++ b/modules/HoverPanel.qml @@ -4,7 +4,9 @@ import Quickshell.Wayland import "." as M // Shared hover/OSD panel PanelWindow — slides down from the bar on hover or -// external trigger. Parent module computes showPanel and reads panelHovered. +// external trigger. Fullscreen transparent window so content can resize freely +// without triggering Wayland surface resize events. Parent module computes +// showPanel and reads panelHovered. PanelWindow { id: root @@ -13,7 +15,6 @@ PanelWindow { required property color accentColor property string panelNamespace: "nova-panel" property real contentWidth: 220 - property bool animateHeight: false property bool panelHovered: false default property alias content: panelContent.children @@ -29,25 +30,16 @@ PanelWindow { anchors.top: true anchors.left: true + anchors.right: true + anchors.bottom: true margins.top: 0 - implicitWidth: panelContent.width - implicitHeight: panelContent.height - - Behavior on implicitHeight { - enabled: root.animateHeight - NumberAnimation { - duration: 100 - easing.type: Easing.OutCubic - } - } - function _updatePosition() { const pt = anchorItem.mapToGlobal(anchorItem.width / 2, 0); const scr = screen; const sw = scr?.width ?? 1920; - margins.left = Math.max(0, Math.min(Math.round(pt.x - (scr?.x ?? 0) - contentWidth / 2), sw - contentWidth)); + panelContent.x = Math.max(0, Math.min(Math.round(pt.x - (scr?.x ?? 0) - contentWidth / 2), sw - contentWidth)); } Timer { @@ -55,7 +47,6 @@ PanelWindow { interval: 50 onTriggered: { if (!root.showPanel) { - console.log("[hp:" + panelNamespace + "] hideTimer fired, starting hideAnim"); showAnim.stop(); hideAnim.start(); } @@ -111,10 +102,6 @@ PanelWindow { onFinished: root._winVisible = false } - HoverHandler { - onHoveredChanged: root.panelHovered = hovered - } - M.PopupBackground { x: panelContent.x y: panelContent.y @@ -129,6 +116,10 @@ PanelWindow { width: root.contentWidth opacity: 0 y: -height + + HoverHandler { + onHoveredChanged: root.panelHovered = hovered + } } // Border overlay — drawn on top of content so full-bleed items (e.g. album art) don't cover it diff --git a/modules/Mpris.qml b/modules/Mpris.qml index abf2a88..252a3cc 100644 --- a/modules/Mpris.qml +++ b/modules/Mpris.qml @@ -103,7 +103,6 @@ M.BarSection { accentColor: root.accentColor panelNamespace: "nova-mpris" contentWidth: 280 - animateHeight: true // Album art Item {