quickshell: fix dropdown sizing to match wrapper rects

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
rope 2026-05-27 11:33:43 +01:00
parent dfc4a6b509
commit 3752a13d92

View file

@ -1319,8 +1319,8 @@ in
id: contextMenu id: contextMenu
alignRight: true alignRight: true
property var trayItem: null property var trayItem: null
fullWidth: menuItems.width + 16 fullWidth: ctxWrap.width + 8
fullHeight: menuItems.height + 12 fullHeight: ctxWrap.height + 10
onVisibleChanged: { onVisibleChanged: {
if (!visible) menuOpener.menu = null; if (!visible) menuOpener.menu = null;
@ -1331,9 +1331,10 @@ in
} }
Rectangle { Rectangle {
id: ctxWrap
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 6 anchors.topMargin: 4
width: menuItems.width + 16 width: menuItems.width + 16
height: menuItems.height + 12 height: menuItems.height + 12
radius: 10 radius: 10
@ -1408,14 +1409,15 @@ in
BarDropdown { BarDropdown {
id: volDropdown id: volDropdown
alignRight: true alignRight: true
fullWidth: volDropdownCol.width + 24 fullWidth: volWrap.width + 8
fullHeight: volDropdownCol.height + 16 fullHeight: volWrap.height + 10
autoCloseMs: 3000 autoCloseMs: 3000
Rectangle { Rectangle {
id: volWrap
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 8 anchors.topMargin: 4
width: volDropdownCol.width + 20 width: volDropdownCol.width + 20
height: volDropdownCol.height + 16 height: volDropdownCol.height + 16
radius: 10 radius: 10
@ -1610,13 +1612,14 @@ in
BarDropdown { BarDropdown {
id: netDropdown id: netDropdown
alignRight: true alignRight: true
fullWidth: netDropdownCol.width + 24 fullWidth: netWrap.width + 8
fullHeight: netDropdownCol.height + 16 fullHeight: netWrap.height + 10
Rectangle { Rectangle {
id: netWrap
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 8 anchors.topMargin: 4
width: netDropdownCol.width + 20 width: netDropdownCol.width + 20
height: netDropdownCol.height + 16 height: netDropdownCol.height + 16
radius: 10 radius: 10
@ -1762,13 +1765,14 @@ in
BarDropdown { BarDropdown {
id: batteryDropdown id: batteryDropdown
alignRight: true alignRight: true
fullWidth: batteryDropdownCol.width + 24 fullWidth: batWrap.width + 8
fullHeight: batteryDropdownCol.height + 16 fullHeight: batWrap.height + 10
Rectangle { Rectangle {
id: batWrap
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 8 anchors.topMargin: 4
width: batteryDropdownCol.width + 20 width: batteryDropdownCol.width + 20
height: batteryDropdownCol.height + 16 height: batteryDropdownCol.height + 16
radius: 10 radius: 10
@ -1889,14 +1893,14 @@ in
BarDropdown { BarDropdown {
id: calPopup id: calPopup
dropdownX: bar.width / 2 dropdownX: bar.width / 2
fullWidth: calCol.width + 32 fullWidth: calCol.width + 8
fullHeight: calCol.height + 24 fullHeight: calCol.height + 10
Column { Column {
id: calCol id: calCol
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 12 anchors.topMargin: 4
spacing: 8 spacing: 8
opacity: calPopup.open ? 1.0 : 0.0 opacity: calPopup.open ? 1.0 : 0.0