mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-16 16:24:00 -04:00
island: center align satellites with the island instance
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user