fix(qt): keep the Qt 6.9 SafeArea/padding API macOS-only

Window.topPadding..rightPadding and the SafeArea attached type are Qt
6.9; on the Linux pin (6.8 LTS) declaring them on the ApplicationWindow
refuses the whole component at Main.qml:173 ("Cannot assign to
non-existent property"), measured on the CI VM 2026-08-25 and on a Pi 4
with Debian 13's Qt 6.8.2. The paddings are now set imperatively from a
Loader active only on macOS, and HeaderBar reads SafeArea.margins.left
through a macOS-only Loader into a plain property, so no binding names
the type on other platforms. Behaviour on macOS is unchanged.

cc
This commit is contained in:
vicrodh committed 2026-08-27 11:11:47 -06:00
1 parent ecc67e0256
commit eada3bd12e
2 files changed
+31 -5

No files matched your search

+18 -4
View File
@@ -167,10 +167,24 @@ ApplicationWindow {
// takes the safe area over from Qt entirely. `HeaderBar.chromeLeftInset`
// is where that responsibility is discharged: it reads
// `SafeArea.margins.left` to clear the traffic lights.
topPadding: 0
bottomPadding: 0
leftPadding: 0
rightPadding: 0
// The four Window paddings are Qt 6.9 API (SafeArea landed in 6.9). The
// Linux pin is Qt 6.8 LTS, where declaring them here refuses the whole
// component ("Cannot assign to non-existent property") — measured on the
// CI VM, 2026-08-25. They only matter on macOS, so they are set there,
// imperatively, from a Loader that never instantiates elsewhere.
Loader {
active: QbzShell.isMacos
sourceComponent: Component {
Item {
Component.onCompleted: {
window.topPadding = 0
window.bottomPadding = 0
window.leftPadding = 0
window.rightPadding = 0
}
}
}
}
color: "#1a1a1a"
// Phase 23: every domain singleton boots (registers its Qt-thread
+13 -1
View File
@@ -100,9 +100,21 @@ Rectangle {
// than the reference's estimate. The 78 stays only as the floor for the
// case where the margin reads 0 (nothing to lose, and it is the number
// the Slint build has used all along).
// `SafeArea` is Qt 6.9 API; the Linux pin is 6.8. The attached read lives
// in a macOS-only Loader so the binding never names the type elsewhere.
property real macSafeLeft: 0
Loader {
active: QbzShell.isMacos
sourceComponent: Component {
Item {
Component.onCompleted:
root.macSafeLeft = Qt.binding(function() { return root.SafeArea.margins.left })
}
}
}
readonly property int chromeLeftInset:
QbzShell.isMacos && !QbzShell.systemTitleBar
? Math.max(root.SafeArea.margins.left, 78)
? Math.max(root.macSafeLeft, 78)
: (root.chromeControls && root.wcOnLeft ? root.wcClusterWidth + 6 : 0)
// The section-nav dropdown (catalog + panel + open/close behaviour).