fixed notifications font rendering

This commit is contained in:
SomeElse
2026-05-16 21:17:45 +00:00
parent 526607ee8d
commit 0c7b5188a8
15 changed files with 292 additions and 590 deletions

View File

@@ -5,24 +5,15 @@ import Quickshell.Wayland
import Quickshell.Services.UPower
import "../../config" as Cfg
import "../../components"
Rectangle {
ModuleChip {
id: root
property real panelRadius: Cfg.Config.radius / 2
property int borderWidth: Cfg.Config.panelBorderWidth
property bool isTop: true
property var targetScreen: null
property int barHeight: Cfg.Config.barHeight
property int barMargin: Cfg.Config.margin
readonly property var t: Cfg.Config.theme
readonly property var bat: UPower.displayDevice
readonly property bool batReady: bat && bat.ready && bat.isLaptopBattery
readonly property bool moduleEnabled: batReady
readonly property bool moduleEnabled: false
readonly property real pct: batReady ? bat.percentage * 100 : 72
readonly property int state: batReady ? bat.state : UPowerDeviceState.Unknown
@@ -163,53 +154,11 @@ Rectangle {
}
}
PanelWindow {
PopupPanel {
id: batteryPopup
screen: root.targetScreen
visible: false
color: "transparent"
property bool popupOpen: false
function open() { hideTimer.stop(); visible = true; popupOpen = true }
function close() { popupOpen = false; hideTimer.restart() }
function toggle() { popupOpen ? close() : open() }
Timer {
id: hideTimer
interval: Cfg.Config.popupAnimDuration + 70
onTriggered: batteryPopup.visible = false
}
anchors { top: true; bottom: true; left: true; right: true }
WlrLayershell.layer: WlrLayer.Top
WlrLayershell.namespace: "main-shell-battery"
WlrLayershell.exclusiveZone: -1
mask: popupOpen ? null : _noInput
Region { id: _noInput }
TapHandler { onTapped: batteryPopup.close() }
Item {
id: popupClipContainer
readonly property int cardW: 260
readonly property int screenPad: root.barMargin + 10
x: {
let centerX = root.mapToItem(null, 0, 0).x + root.width / 2
let desiredX = centerX - cardW / 2
return Math.max(screenPad,
Math.min(desiredX, parent.width - cardW - screenPad))
}
width: cardW
anchors.top: root.isTop ? parent.top : undefined
anchors.bottom: root.isTop ? undefined : parent.bottom
anchors.topMargin: root.isTop ? (root.barHeight + 10) : 0
anchors.bottomMargin: root.isTop ? 0 : (root.barHeight + 10)
height: parent.height - root.barHeight - 10
clip: true
ns: "battery"
chipRoot: root
cardWidth: 260
Rectangle {
id: cardShadow
@@ -584,6 +533,5 @@ Rectangle {
Item { height: 2 }
}
}
}
}
}