merge upstream

This commit is contained in:
Greyfeather
2025-05-21 00:22:49 -06:00
parent 08b9014ee2
commit 65b5ec93c7
87 changed files with 2119 additions and 1602 deletions
@@ -12,6 +12,7 @@ import Quickshell.Hyprland
Scope {
id: root
property bool showOsdValues: false
property var focusedScreen: Quickshell.screens.find(s => s.name === Hyprland.focusedMonitor?.name)
function triggerOsd() {
showOsdValues = true
@@ -47,70 +48,68 @@ Scope {
}
}
Variants {
model: Quickshell.screens
Loader {
id: osdLoader
active: showOsdValues
Loader {
id: osdLoader
property var modelData
active: showOsdValues
PanelWindow {
screen: modelData
exclusionMode: ExclusionMode.Normal
WlrLayershell.namespace: "quickshell:onScreenDisplay"
WlrLayershell.layer: WlrLayer.Overlay
color: "transparent"
PanelWindow {
id: osdRoot
anchors {
top: true
}
mask: Region {
item: osdValuesWrapper
Connections {
target: root
function onFocusedScreenChanged() {
osdRoot.screen = root.focusedScreen
}
}
implicitWidth: columnLayout.implicitWidth
implicitHeight: columnLayout.implicitHeight
visible: osdLoader.active
exclusionMode: ExclusionMode.Normal
WlrLayershell.namespace: "quickshell:onScreenDisplay"
WlrLayershell.layer: WlrLayer.Overlay
color: "transparent"
ColumnLayout {
id: columnLayout
anchors.horizontalCenter: parent.horizontalCenter
Item {
height: 1 // Prevent Wayland protocol error
anchors.top: true
mask: Region {
item: osdValuesWrapper
}
implicitWidth: Appearance.sizes.osdWidth
implicitHeight: columnLayout.implicitHeight
visible: osdLoader.active
ColumnLayout {
id: columnLayout
anchors.horizontalCenter: parent.horizontalCenter
Item {
id: osdValuesWrapper
// Extra space for shadow
implicitHeight: osdValues.implicitHeight + Appearance.sizes.elevationMargin * 2
implicitWidth: osdValues.implicitWidth
clip: true
MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: root.showOsdValues = false
}
Item {
id: osdValuesWrapper
// Extra space for shadow
implicitHeight: true ? (osdValues.implicitHeight + Appearance.sizes.elevationMargin * 2) : 0
implicitWidth: osdValues.implicitWidth + Appearance.sizes.elevationMargin * 2
clip: true
MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: root.showOsdValues = false
}
Behavior on implicitHeight {
NumberAnimation {
duration: Appearance.animation.menuDecel.duration
easing.type: Appearance.animation.menuDecel.type
}
}
OsdValueIndicator {
id: osdValues
anchors.centerIn: parent
value: Audio.sink?.audio.volume ?? 0
icon: Audio.sink?.audio.muted ? "volume_off" : "volume_up"
name: qsTr("Volume")
Behavior on implicitHeight {
NumberAnimation {
duration: Appearance.animation.menuDecel.duration
easing.type: Appearance.animation.menuDecel.type
}
}
}
OsdValueIndicator {
id: osdValues
anchors.fill: parent
anchors.margins: Appearance.sizes.elevationMargin
value: Audio.sink?.audio.volume ?? 0
icon: Audio.sink?.audio.muted ? "volume_off" : "volume_up"
name: qsTr("Volume")
}
}
}
}
}
IpcHandler {
@@ -130,7 +129,7 @@ Scope {
}
GlobalShortcut {
name: "osdVolumeTrigger"
description: "Triggers volume OSD on press"
description: qsTr("Triggers volume OSD on press")
onPressed: {
root.triggerOsd()
@@ -138,7 +137,7 @@ Scope {
}
GlobalShortcut {
name: "osdVolumeHide"
description: "Hides volume OSD on press"
description: qsTr("Hides volume OSD on press")
onPressed: {
root.showOsdValues = false