Files
arthur-os/default/quickshell/bar/widgets/powerMenu.qml
T
Ryan Hughes fe73986a01 Address momus review: fix icons, vertical layout, popup coordination
- Replace nerd font glyphs that were stripped during the initial widget
  writes with verified codepoints sourced from the JetBrains Mono Nerd
  Font cmap (cpu-64-bit, scale-balance, notification-clear-all, etc).
- systemStats now switches to a Column layout when the bar is vertical
  so the widget no longer overflows a 28px-wide side bar.
- Remove notificationCenter from defaults: it registers a notification
  server and would collide with the mako daemon Omarchy autostarts.
- PopupCard owns the popout coordinator lifecycle and delegates close to
  its widget owner when provided; calendar and media now pass owner.
- brightness debounces brightnessctl writes through a coalescing timer
  to avoid spawning a process per slider tick.
- audioPanel tracks unfiltered Pipewire sinks/streams via PwObjectTracker
  so audio metadata becomes available before filtering.
- ModuleSlot re-injects bar/moduleName/settings whenever the bar config
  serial changes so widget settings update live with bar.json.
- Guard null bar references in workspacesPro and systemStats components
  that are constructed before bar injection.
2026-05-14 02:21:47 -04:00

107 lines
2.3 KiB
QML

import QtQuick
import Quickshell
import "../common" as Common
Item {
id: root
property QtObject bar: null
property string moduleName: "powerMenu"
property var settings: ({})
property bool popupOpen: false
function closePopout() { popupOpen = false }
implicitWidth: button.implicitWidth
implicitHeight: button.implicitHeight
function run(command) {
if (root.bar) root.bar.run(command)
popupOpen = false
}
Common.WidgetButton {
id: button
anchors.fill: parent
bar: root.bar
text: "󰐥"
fontSize: 14
tooltipText: "Power menu"
onPressed: function() { root.popupOpen = !root.popupOpen }
}
Common.PopupCard {
anchorItem: button
owner: root
bar: root.bar
open: root.popupOpen
contentWidth: 220
contentHeight: column.implicitHeight + 28
Column {
id: column
anchors.fill: parent
spacing: 6
Text {
text: "Power"
color: root.bar.foreground
font.family: root.bar.fontFamily
font.pixelSize: 12
font.bold: true
}
Common.PillButton {
width: parent.width
iconText: "󰌾"
text: "Lock"
foreground: root.bar.foreground
horizontalPadding: 10
verticalPadding: 8
onClicked: root.run("loginctl lock-session")
}
Common.PillButton {
width: parent.width
iconText: "󰒲"
text: "Suspend"
foreground: root.bar.foreground
horizontalPadding: 10
verticalPadding: 8
onClicked: root.run("systemctl suspend")
}
Common.PillButton {
width: parent.width
iconText: "󰍃"
text: "Log out"
foreground: root.bar.foreground
horizontalPadding: 10
verticalPadding: 8
onClicked: root.run("hyprctl dispatch exit")
}
Common.PillButton {
width: parent.width
iconText: "󰜉"
text: "Reboot"
foreground: root.bar.foreground
horizontalPadding: 10
verticalPadding: 8
onClicked: root.run("systemctl reboot")
}
Common.PillButton {
width: parent.width
iconText: "󰐥"
text: "Shut down"
foreground: root.bar.urgent
horizontalPadding: 10
verticalPadding: 8
onClicked: root.run("systemctl poweroff")
}
}
}
}