make HoverPanel fullscreen to avoid Niri resize issues, fix cpu freq color
This commit is contained in:
parent
df53abcc43
commit
885e446bf4
3 changed files with 11 additions and 21 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -103,7 +103,6 @@ M.BarSection {
|
|||
accentColor: root.accentColor
|
||||
panelNamespace: "nova-mpris"
|
||||
contentWidth: 280
|
||||
animateHeight: true
|
||||
|
||||
// Album art
|
||||
Item {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue