fix panel pin button layout, network hover, mpris session switch, volume title colors

This commit is contained in:
Damocles 2026-04-16 18:28:50 +02:00
parent c81cddc38f
commit 084ef1da75
4 changed files with 122 additions and 73 deletions

View file

@ -31,6 +31,7 @@ PanelWindow {
// Shared
required property color accentColor
property string panelTitle: ""
property string panelNamespace: "nova-panel"
property real contentWidth: 220
@ -49,7 +50,7 @@ PanelWindow {
x: panelContainer.x + panelContainer.width - 28
y: 0
width: 28
height: 28
height: 24
}
WlrLayershell.layer: WlrLayer.Overlay
@ -192,7 +193,7 @@ PanelWindow {
x: 0
y: -height
width: root.contentWidth
height: panelContent.height
height: _panelColumn.height
opacity: 0
// Popup mode: eat clicks on panel background so outer dismiss doesn't fire
@ -209,52 +210,75 @@ PanelWindow {
}
Column {
id: panelContent
id: _panelColumn
width: root.contentWidth
}
// Pin button top-right corner, hover mode only
Item {
visible: !root.popupMode && (root.panelHovered || root._pinned)
x: parent.width - width - 4
y: 4
width: 20
height: 20
z: 2
opacity: pinHover.hovered || root._pinned ? 1 : 0.35
// Header row: title (optional) + pin button hover mode only
Item {
visible: !root.popupMode
width: parent.width
height: 24
Behavior on opacity {
NumberAnimation {
duration: 100
Text {
visible: root.panelTitle !== ""
anchors.left: parent.left
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
text: root.panelTitle
color: root.accentColor
font.pixelSize: M.Theme.fontSize - 1
font.bold: true
font.family: M.Theme.fontFamily
}
}
HoverHandler {
id: pinHover
}
Item {
visible: root.panelHovered || root._pinned
anchors.right: parent.right
anchors.rightMargin: 4
anchors.verticalCenter: parent.verticalCenter
width: 20
height: 20
opacity: pinHover.hovered || root._pinned ? 1 : 0.35
TapHandler {
cursorShape: Qt.PointingHandCursor
onTapped: {
root._pinned = !root._pinned;
if (!root._pinned && !root.showPanel)
root.dismiss();
}
}
Behavior on opacity {
NumberAnimation {
duration: 100
}
}
Text {
anchors.centerIn: parent
text: root._pinned ? "\uDB81\uDC03" : "\uDB82\uDD31"
color: root._pinned ? root.accentColor : M.Theme.base04
font.pixelSize: M.Theme.fontSize - 1
font.family: M.Theme.iconFontFamily
HoverHandler {
id: pinHover
}
Behavior on color {
ColorAnimation {
duration: 100
TapHandler {
cursorShape: Qt.PointingHandCursor
onTapped: {
root._pinned = !root._pinned;
if (!root._pinned && !root.showPanel)
root.dismiss();
}
}
Text {
anchors.centerIn: parent
text: root._pinned ? "\uDB81\uDC03" : "\uDB82\uDD31"
color: root._pinned ? root.accentColor : M.Theme.base04
font.pixelSize: M.Theme.fontSize - 1
font.family: M.Theme.iconFontFamily
Behavior on color {
ColorAnimation {
duration: 100
}
}
}
}
}
Column {
id: panelContent
width: parent.width
}
}
}