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.rightMargin: 12
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: parent._f.toFixed(2)
|
text: parent._f.toFixed(2)
|
||||||
color: parent._barColor
|
color: M.Theme.base04
|
||||||
font.pixelSize: M.Theme.fontSize - 2
|
font.pixelSize: M.Theme.fontSize - 2
|
||||||
font.family: M.Theme.fontFamily
|
font.family: M.Theme.fontFamily
|
||||||
width: 32
|
width: 32
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,9 @@ import Quickshell.Wayland
|
||||||
import "." as M
|
import "." as M
|
||||||
|
|
||||||
// Shared hover/OSD panel PanelWindow — slides down from the bar on hover or
|
// 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 {
|
PanelWindow {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
|
@ -13,7 +15,6 @@ PanelWindow {
|
||||||
required property color accentColor
|
required property color accentColor
|
||||||
property string panelNamespace: "nova-panel"
|
property string panelNamespace: "nova-panel"
|
||||||
property real contentWidth: 220
|
property real contentWidth: 220
|
||||||
property bool animateHeight: false
|
|
||||||
property bool panelHovered: false
|
property bool panelHovered: false
|
||||||
|
|
||||||
default property alias content: panelContent.children
|
default property alias content: panelContent.children
|
||||||
|
|
@ -29,25 +30,16 @@ PanelWindow {
|
||||||
|
|
||||||
anchors.top: true
|
anchors.top: true
|
||||||
anchors.left: true
|
anchors.left: true
|
||||||
|
anchors.right: true
|
||||||
|
anchors.bottom: true
|
||||||
|
|
||||||
margins.top: 0
|
margins.top: 0
|
||||||
|
|
||||||
implicitWidth: panelContent.width
|
|
||||||
implicitHeight: panelContent.height
|
|
||||||
|
|
||||||
Behavior on implicitHeight {
|
|
||||||
enabled: root.animateHeight
|
|
||||||
NumberAnimation {
|
|
||||||
duration: 100
|
|
||||||
easing.type: Easing.OutCubic
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _updatePosition() {
|
function _updatePosition() {
|
||||||
const pt = anchorItem.mapToGlobal(anchorItem.width / 2, 0);
|
const pt = anchorItem.mapToGlobal(anchorItem.width / 2, 0);
|
||||||
const scr = screen;
|
const scr = screen;
|
||||||
const sw = scr?.width ?? 1920;
|
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 {
|
Timer {
|
||||||
|
|
@ -55,7 +47,6 @@ PanelWindow {
|
||||||
interval: 50
|
interval: 50
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
if (!root.showPanel) {
|
if (!root.showPanel) {
|
||||||
console.log("[hp:" + panelNamespace + "] hideTimer fired, starting hideAnim");
|
|
||||||
showAnim.stop();
|
showAnim.stop();
|
||||||
hideAnim.start();
|
hideAnim.start();
|
||||||
}
|
}
|
||||||
|
|
@ -111,10 +102,6 @@ PanelWindow {
|
||||||
onFinished: root._winVisible = false
|
onFinished: root._winVisible = false
|
||||||
}
|
}
|
||||||
|
|
||||||
HoverHandler {
|
|
||||||
onHoveredChanged: root.panelHovered = hovered
|
|
||||||
}
|
|
||||||
|
|
||||||
M.PopupBackground {
|
M.PopupBackground {
|
||||||
x: panelContent.x
|
x: panelContent.x
|
||||||
y: panelContent.y
|
y: panelContent.y
|
||||||
|
|
@ -129,6 +116,10 @@ PanelWindow {
|
||||||
width: root.contentWidth
|
width: root.contentWidth
|
||||||
opacity: 0
|
opacity: 0
|
||||||
y: -height
|
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
|
// 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
|
accentColor: root.accentColor
|
||||||
panelNamespace: "nova-mpris"
|
panelNamespace: "nova-mpris"
|
||||||
contentWidth: 280
|
contentWidth: 280
|
||||||
animateHeight: true
|
|
||||||
|
|
||||||
// Album art
|
// Album art
|
||||||
Item {
|
Item {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue