From 12feb8068bf36d8d20e951b7ea72e00c61eff173 Mon Sep 17 00:00:00 2001 From: purian23 Date: Tue, 13 Oct 2026 16:09:03 -0400 Subject: [PATCH] island: center align satellites with the island instance --- quickshell/Modules/DBar/DBarBody.qml | 13 +++++++++++-- quickshell/Modules/DBar/DBarContent.qml | 5 +++++ quickshell/Modules/DBar/SectionSurface.qml | 5 +++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/quickshell/Modules/DBar/DBarBody.qml b/quickshell/Modules/DBar/DBarBody.qml index 4539ec384..a476a6f7f 100644 --- a/quickshell/Modules/DBar/DBarBody.qml +++ b/quickshell/Modules/DBar/DBarBody.qml @@ -57,6 +57,12 @@ Item { readonly property real islandChromeInset: islandSatelliteBackground ? islandChromePad : 0 readonly property real islandSatelliteSweep: islandSatelliteBackground && SettingsData.islandSetting(barConfig, "islandSatelliteGothCorners") ? islandGothRadius : 0 readonly property real islandFlareClearance: ((islandHost?.notch ?? false) ? islandHost.surface.joinRadius * 2.5 : 0) + islandSatelliteSweep + // Satellites centre on the idle pill face, not the strip; backed ones reach its far edge instead. + readonly property bool islandSatellitesTrackPill: isIsland && !!islandHost && !islandFree + readonly property real islandPillFace: islandSatellitesTrackPill ? islandHost.islandController.homeCompactFaceThickness : 0 + readonly property real islandSatelliteDepth: islandSatellitesTrackPill ? Theme.px(Math.min(islandStripThickness, islandHost.outerGap + islandPillFace), _dpr) : islandStripThickness + readonly property real islandSatelliteCrossCenter: !islandSatellitesTrackPill || islandSatelliteBackground ? islandSatelliteDepth / 2 : islandHost.outerGap + islandPillFace / 2 + readonly property real islandSatelliteCrossShift: Theme.px(islandSatelliteCrossCenter - islandStripThickness / 2, _dpr) * (axis.edge === "bottom" || axis.edge === "right" ? -1 : 1) readonly property bool islandSatellitesClipToIsland: islandSatelliteBackground && !islandSatellitesHugIsland && !!islandHost readonly property bool islandMotionRunning: islandHost?.motionRunning ?? false onIslandMotionRunningChanged: { @@ -1123,7 +1129,8 @@ Item { alongPos: barWindow.isVertical ? topBarContent.y + (barWindow._leftSection?.y ?? 0) : topBarContent.x + (barWindow._leftSection?.x ?? 0) alongSize: barWindow.leadingSectionSize alongExtent: barWindow.isVertical ? barUnitInset.height : barUnitInset.width - crossSize: barWindow.isVertical ? barUnitInset.width : barUnitInset.height + crossSize: barWindow.islandSatelliteDepth + crossExtent: barWindow.isVertical ? barUnitInset.width : barUnitInset.height isVertical: barWindow.isVertical crossFar: axis.edge === "bottom" || axis.edge === "right" edgeAligned: !barWindow.islandSatellitesHugIsland @@ -1142,7 +1149,8 @@ Item { alongPos: barWindow.isVertical ? topBarContent.y + (barWindow._rightSection?.y ?? 0) : topBarContent.x + (barWindow._rightSection?.x ?? 0) alongSize: barWindow.trailingSectionSize alongExtent: barWindow.isVertical ? barUnitInset.height : barUnitInset.width - crossSize: barWindow.isVertical ? barUnitInset.width : barUnitInset.height + crossSize: barWindow.islandSatelliteDepth + crossExtent: barWindow.isVertical ? barUnitInset.width : barUnitInset.height isVertical: barWindow.isVertical crossFar: axis.edge === "bottom" || axis.edge === "right" edgeAligned: !barWindow.islandSatellitesHugIsland @@ -1190,6 +1198,7 @@ Item { visible: barWindow.islandSatellitesEnabled leadingSectionOffset: barWindow.islandLeadingOffset trailingSectionOffset: barWindow.islandTrailingOffset + sectionCrossOffset: barWindow.islandSatelliteCrossShift reservedStart: barWindow.islandReservesStrip ? barWindow.islandReachStart - barWindow.islandStripClearance - barWindow.contentAlongStart : NaN reservedEnd: barWindow.islandReservesStrip ? barWindow.islandReachEnd + barWindow.islandStripClearance - barWindow.contentAlongStart : NaN } diff --git a/quickshell/Modules/DBar/DBarContent.qml b/quickshell/Modules/DBar/DBarContent.qml index 051e3157f..2f032a35a 100644 --- a/quickshell/Modules/DBar/DBarContent.qml +++ b/quickshell/Modules/DBar/DBarContent.qml @@ -21,6 +21,7 @@ Item { property var hoverSections: null property real leadingSectionOffset: 0 property real trailingSectionOffset: 0 + property real sectionCrossOffset: 0 property real reservedStart: NaN property real reservedEnd: NaN readonly property bool fitToWidgets: _hasBarWindow && (barWindow.fitToWidgets ?? false) @@ -477,6 +478,7 @@ Item { left: parent.left leftMargin: topBarContent.leadingSectionOffset verticalCenter: parent.verticalCenter + verticalCenterOffset: topBarContent.sectionCrossOffset } axis: barWindow.axis barContent: topBarContent @@ -493,6 +495,7 @@ Item { right: parent.right rightMargin: topBarContent.trailingSectionOffset verticalCenter: parent.verticalCenter + verticalCenterOffset: topBarContent.sectionCrossOffset } axis: barWindow.axis barContent: topBarContent @@ -530,6 +533,7 @@ Item { top: parent.top topMargin: topBarContent.leadingSectionOffset horizontalCenter: parent.horizontalCenter + horizontalCenterOffset: topBarContent.sectionCrossOffset } axis: barWindow.axis barContent: topBarContent @@ -563,6 +567,7 @@ Item { bottom: parent.bottom bottomMargin: topBarContent.trailingSectionOffset horizontalCenter: parent.horizontalCenter + horizontalCenterOffset: topBarContent.sectionCrossOffset } axis: barWindow.axis barContent: topBarContent diff --git a/quickshell/Modules/DBar/SectionSurface.qml b/quickshell/Modules/DBar/SectionSurface.qml index fe05db4e4..5ff44ed38 100644 --- a/quickshell/Modules/DBar/SectionSurface.qml +++ b/quickshell/Modules/DBar/SectionSurface.qml @@ -9,6 +9,7 @@ Item { property real alongSize: 0 property real alongExtent: 0 property real crossSize: 0 + property real crossExtent: crossSize property bool isVertical: false property bool crossFar: false property bool trailing: false @@ -58,8 +59,8 @@ Item { } visible: chromeAlongSize > 0 - x: isVertical ? 0 : chromeAlongPos - y: isVertical ? chromeAlongPos : 0 + x: isVertical ? (crossFar ? crossExtent - crossSize : 0) : chromeAlongPos + y: isVertical ? chromeAlongPos : (crossFar ? crossExtent - crossSize : 0) width: isVertical ? crossSize : chromeAlongSize height: isVertical ? chromeAlongSize : crossSize