fix weird mediacontrols positioning when bar autohides

This commit is contained in:
end-4
2025-08-12 10:28:54 +07:00
parent d73ba14154
commit fc31d5fd2f
@@ -109,12 +109,17 @@ Scope {
id: mediaControlsRoot id: mediaControlsRoot
visible: true visible: true
exclusionMode: ExclusionMode.Ignore
exclusiveZone: 0 exclusiveZone: 0
implicitWidth: ( margins {
(mediaControlsRoot.screen.width / 2) // Middle of screen top: Appearance.sizes.barHeight
- (osdWidth / 2) // Dodge OSD bottom: Appearance.sizes.barHeight
- (widgetWidth / 2) // Account for widget width left: (mediaControlsRoot.screen.width / 2) - (osdWidth / 2) - widgetWidth
) * 2 }
implicitWidth: {
console.log(root.widgetWidth)
return root.widgetWidth
}
implicitHeight: playerColumnLayout.implicitHeight implicitHeight: playerColumnLayout.implicitHeight
color: "transparent" color: "transparent"
WlrLayershell.namespace: "quickshell:mediaControls" WlrLayershell.namespace: "quickshell:mediaControls"
@@ -130,12 +135,7 @@ Scope {
ColumnLayout { ColumnLayout {
id: playerColumnLayout id: playerColumnLayout
anchors.top: parent.top anchors.fill: parent
anchors.bottom: parent.bottom
x: (mediaControlsRoot.screen.width / 2) // Middle of screen
- (osdWidth / 2) // Dodge OSD
- (widgetWidth) // Account for widget width
+ (Appearance.sizes.elevationMargin) // It's fine for shadows to overlap
spacing: -Appearance.sizes.elevationMargin // Shadow overlap okay spacing: -Appearance.sizes.elevationMargin // Shadow overlap okay
Repeater { Repeater {