Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46f14d5d36 | ||
|
|
084ef1da75 |
7 changed files with 153 additions and 87 deletions
|
|
@ -47,6 +47,7 @@ M.BarSection {
|
||||||
property M.ProcessList _procs: M.ProcessList {
|
property M.ProcessList _procs: M.ProcessList {
|
||||||
sortBy: "cpu"
|
sortBy: "cpu"
|
||||||
active: root._showPanel
|
active: root._showPanel
|
||||||
|
onProcessesChanged: hoverPanel.keepOpen(300)
|
||||||
}
|
}
|
||||||
|
|
||||||
on_AnyHoverChanged: {
|
on_AnyHoverChanged: {
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ PanelWindow {
|
||||||
|
|
||||||
// Shared
|
// Shared
|
||||||
required property color accentColor
|
required property color accentColor
|
||||||
|
property string panelTitle: ""
|
||||||
property string panelNamespace: "nova-panel"
|
property string panelNamespace: "nova-panel"
|
||||||
property real contentWidth: 220
|
property real contentWidth: 220
|
||||||
|
|
||||||
|
|
@ -49,7 +50,7 @@ PanelWindow {
|
||||||
x: panelContainer.x + panelContainer.width - 28
|
x: panelContainer.x + panelContainer.width - 28
|
||||||
y: 0
|
y: 0
|
||||||
width: 28
|
width: 28
|
||||||
height: 28
|
height: 24
|
||||||
}
|
}
|
||||||
|
|
||||||
WlrLayershell.layer: WlrLayer.Overlay
|
WlrLayershell.layer: WlrLayer.Overlay
|
||||||
|
|
@ -91,6 +92,24 @@ PanelWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Content-change grace: call keepOpen(ms) when panel content is about to
|
||||||
|
// resize/rebuild (session switch, device list change, etc.) to prevent the
|
||||||
|
// hover-drop-on-resize from closing the panel.
|
||||||
|
property bool _contentBusy: false
|
||||||
|
Timer {
|
||||||
|
id: _contentBusyTimer
|
||||||
|
onTriggered: {
|
||||||
|
root._contentBusy = false;
|
||||||
|
if (!root.showPanel && !root._grace && !root._pinned)
|
||||||
|
root._hideTimer.restart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function keepOpen(ms) {
|
||||||
|
_contentBusy = true;
|
||||||
|
_contentBusyTimer.interval = ms ?? 400;
|
||||||
|
_contentBusyTimer.restart();
|
||||||
|
}
|
||||||
|
|
||||||
function _show() {
|
function _show() {
|
||||||
_updatePosition();
|
_updatePosition();
|
||||||
_winVisible = true;
|
_winVisible = true;
|
||||||
|
|
@ -114,7 +133,7 @@ PanelWindow {
|
||||||
Timer {
|
Timer {
|
||||||
id: _hideTimer
|
id: _hideTimer
|
||||||
interval: 150
|
interval: 150
|
||||||
onTriggered: if (!root.showPanel && !root._grace && !root._pinned)
|
onTriggered: if (!root.showPanel && !root._grace && !root._pinned && !root._contentBusy)
|
||||||
root.dismiss()
|
root.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -192,7 +211,7 @@ PanelWindow {
|
||||||
x: 0
|
x: 0
|
||||||
y: -height
|
y: -height
|
||||||
width: root.contentWidth
|
width: root.contentWidth
|
||||||
height: panelContent.height
|
height: _panelColumn.height
|
||||||
opacity: 0
|
opacity: 0
|
||||||
|
|
||||||
// Popup mode: eat clicks on panel background so outer dismiss doesn't fire
|
// Popup mode: eat clicks on panel background so outer dismiss doesn't fire
|
||||||
|
|
@ -209,18 +228,34 @@ PanelWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: panelContent
|
id: _panelColumn
|
||||||
width: root.contentWidth
|
width: root.contentWidth
|
||||||
|
|
||||||
|
// Header row: title (optional) + pin button — hover mode only
|
||||||
|
Item {
|
||||||
|
visible: !root.popupMode
|
||||||
|
width: parent.width
|
||||||
|
height: 24
|
||||||
|
|
||||||
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pin button — top-right corner, hover mode only
|
|
||||||
Item {
|
Item {
|
||||||
visible: !root.popupMode && (root.panelHovered || root._pinned)
|
visible: root.panelHovered || root._pinned
|
||||||
x: parent.width - width - 4
|
anchors.right: parent.right
|
||||||
y: 4
|
anchors.rightMargin: 4
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
width: 20
|
width: 20
|
||||||
height: 20
|
height: 20
|
||||||
z: 2
|
|
||||||
opacity: pinHover.hovered || root._pinned ? 1 : 0.35
|
opacity: pinHover.hovered || root._pinned ? 1 : 0.35
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
|
|
@ -258,6 +293,13 @@ PanelWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: panelContent
|
||||||
|
width: parent.width
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Border overlay — on top of content so full-bleed items don't cover it
|
// Border overlay — on top of content so full-bleed items don't cover it
|
||||||
Rectangle {
|
Rectangle {
|
||||||
x: panelContainer.x
|
x: panelContainer.x
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ M.BarSection {
|
||||||
property M.ProcessList _procs: M.ProcessList {
|
property M.ProcessList _procs: M.ProcessList {
|
||||||
sortBy: "mem"
|
sortBy: "mem"
|
||||||
active: root._showPanel
|
active: root._showPanel
|
||||||
|
onProcessesChanged: hoverPanel.keepOpen(300)
|
||||||
}
|
}
|
||||||
|
|
||||||
on_AnyHoverChanged: {
|
on_AnyHoverChanged: {
|
||||||
|
|
|
||||||
|
|
@ -355,8 +355,21 @@ M.BarSection {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Player switcher
|
// Player switcher
|
||||||
|
Item {
|
||||||
|
width: parent.width
|
||||||
|
height: _players.length > 1 ? 28 : 0
|
||||||
|
visible: _players.length > 1
|
||||||
|
|
||||||
|
Flickable {
|
||||||
|
id: _switcher
|
||||||
|
anchors.centerIn: parent
|
||||||
|
width: Math.min(_playerRow.implicitWidth, parent.width - 16)
|
||||||
|
height: 22
|
||||||
|
contentWidth: _playerRow.implicitWidth
|
||||||
|
clip: true
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
id: _playerRow
|
||||||
height: 22
|
height: 22
|
||||||
spacing: 6
|
spacing: 6
|
||||||
|
|
||||||
|
|
@ -393,7 +406,12 @@ M.BarSection {
|
||||||
}
|
}
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
onTapped: root._playerIdx = index
|
onTapped: {
|
||||||
|
root._playerIdx = index;
|
||||||
|
hoverPanel.keepOpen(400);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -98,12 +98,12 @@ M.BarSection {
|
||||||
|
|
||||||
required property var bar
|
required property var bar
|
||||||
|
|
||||||
readonly property bool _anyHover: root._hovered || networkMenu.panelHovered || networkMenu._busy
|
readonly property bool _anyHover: root._hovered || networkMenu.panelHovered
|
||||||
|
|
||||||
M.NetworkMenu {
|
M.NetworkMenu {
|
||||||
id: networkMenu
|
id: networkMenu
|
||||||
showPanel: root._anyHover
|
showPanel: root._anyHover
|
||||||
screen: root.bar.screen
|
screen: QsWindow.window?.screen ?? null
|
||||||
anchorItem: root
|
anchorItem: root
|
||||||
accentColor: root.accentColor
|
accentColor: root.accentColor
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,6 @@ M.HoverPanel {
|
||||||
onVisibleChanged: if (visible)
|
onVisibleChanged: if (visible)
|
||||||
scanner.running = true
|
scanner.running = true
|
||||||
|
|
||||||
readonly property bool _busy: connectProc.running || disconnectProc.running || radioProc.running
|
|
||||||
|
|
||||||
function triggerRefresh() {
|
function triggerRefresh() {
|
||||||
if (visible)
|
if (visible)
|
||||||
scanner.running = true;
|
scanner.running = true;
|
||||||
|
|
@ -85,24 +83,30 @@ M.HoverPanel {
|
||||||
id: radioProc
|
id: radioProc
|
||||||
property string _state: ""
|
property string _state: ""
|
||||||
command: ["nmcli", "radio", "wifi", _state]
|
command: ["nmcli", "radio", "wifi", _state]
|
||||||
onRunningChanged: if (!running)
|
onRunningChanged: if (!running) {
|
||||||
scanner.running = true
|
scanner.running = true;
|
||||||
|
menuWindow.keepOpen(500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property Process _connectProc: Process {
|
property Process _connectProc: Process {
|
||||||
id: connectProc
|
id: connectProc
|
||||||
property string uuid: ""
|
property string uuid: ""
|
||||||
command: ["nmcli", "connection", "up", uuid]
|
command: ["nmcli", "connection", "up", uuid]
|
||||||
onRunningChanged: if (!running)
|
onRunningChanged: if (!running) {
|
||||||
scanner.running = true
|
scanner.running = true;
|
||||||
|
menuWindow.keepOpen(500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property Process _disconnectProc: Process {
|
property Process _disconnectProc: Process {
|
||||||
id: disconnectProc
|
id: disconnectProc
|
||||||
property string uuid: ""
|
property string uuid: ""
|
||||||
command: ["nmcli", "connection", "down", uuid]
|
command: ["nmcli", "connection", "down", uuid]
|
||||||
onRunningChanged: if (!running)
|
onRunningChanged: if (!running) {
|
||||||
scanner.running = true
|
scanner.running = true;
|
||||||
|
menuWindow.keepOpen(500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wi-Fi radio toggle header
|
// Wi-Fi radio toggle header
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,7 @@ M.BarSection {
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
leftPadding: 12
|
leftPadding: 12
|
||||||
text: "Output Devices"
|
text: "Output Devices"
|
||||||
color: M.Theme.base04
|
color: root.accentColor
|
||||||
font.pixelSize: M.Theme.fontSize - 1
|
font.pixelSize: M.Theme.fontSize - 1
|
||||||
font.family: M.Theme.fontFamily
|
font.family: M.Theme.fontFamily
|
||||||
}
|
}
|
||||||
|
|
@ -279,7 +279,7 @@ M.BarSection {
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
leftPadding: 12
|
leftPadding: 12
|
||||||
text: "Applications"
|
text: "Applications"
|
||||||
color: M.Theme.base04
|
color: root.accentColor
|
||||||
font.pixelSize: M.Theme.fontSize - 1
|
font.pixelSize: M.Theme.fontSize - 1
|
||||||
font.family: M.Theme.fontFamily
|
font.family: M.Theme.fontFamily
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue