fix(qt): the immersive view trigger moves beside the window controls

It sat at the band's LEFT edge, which on macOS is the traffic lights' corner —
x ~ 7-85, the pill's exact spot. The band was therefore being inset sideways to
make room for one 44px control, and that inset is what read as wrong: the shell
HeaderBar's rule is right for the shell, where the lights head a full toolbar
row, and wrong here, where the row is three floating glass pills over artwork.

Moving the pill instead of the row is the smaller change and the better one. The
left half of the band goes empty and the lights get that corner to themselves;
the search field is CENTRED on the band rather than laid out after the trigger,
so nothing else shifts. Every other platform is unaffected — the trigger simply
changed sides.

Its right margin RESERVES the capsule's expanded width (112) plus a 12px gap
rather than anchoring to the capsule's live left edge. The capsule grows
leftward on hover, so anchoring to it would slide this pill sideways every time
the pointer crossed the other one — motion with no meaning. Reserving the
maximum keeps both still. The radius becomes height/2, the same silhouette as
the capsule it now sits next to.

An earlier attempt dropped the WHOLE band below the lights; it is reverted here.
It moved the search field and the capsule down to solve a problem only the
trigger had.

The capsule stays. Worth recording why, since it looks redundant on macOS and is
only half so: its fullscreen toggle writes `Window.visibility`, which the green
light already does — but its X calls `QbzImmersive.open = false`, which EXITS
IMMERSIVE, and no traffic light can do that. It is one of three exits (Escape
and the player bar are the others) and the only visible one in the chrome.

Built and smoked on Linux, built on the Mac mini M2. The macOS geometry needs
eyes on a Mac.

cc
This commit is contained in:
vicrodh committed 2026-08-19 16:31:16 -06:00
1 parent d1fd99f947
commit 9c47d5b2e7
2 files changed
+27 -42

No files matched your search

+17 -10
View File
@@ -35,22 +35,29 @@ Item {
// `fieldActive` seam).
readonly property bool searchActive: searchField.fieldActive
/// macOS: width of the native traffic-light cluster, so the view trigger
/// can match it while the band sits directly under the lights. 0 (every
/// other platform, and macOS with the system title bar) leaves the trigger
/// its natural 44px. The glyph stays centred either way.
property int triggerWidth: 0
// --- LEFT: the view menu ---------------------------------------------
Rectangle {
id: viewTrigger
anchors.left: parent.left
// ON THE RIGHT, beside the capsule — not at the band's left edge.
//
// It lived on the left and on macOS that is the traffic lights' corner,
// so the band was being shoved sideways to make room for one 44px pill.
// Moving the pill instead leaves that corner to the lights on macOS and
// costs nothing anywhere else: the search field is centred on the band,
// not laid out after the trigger, so the left half simply goes empty.
//
// The right margin RESERVES THE CAPSULE'S EXPANDED WIDTH (112) plus a
// 12px gap, rather than anchoring to the capsule's live left edge. The
// capsule grows leftward on hover, and anchoring to it would slide this
// pill sideways every time the pointer crossed the other one — motion
// with no meaning. Reserving the maximum keeps both still.
anchors.right: parent.right
anchors.rightMargin: 112 + 12
anchors.verticalCenter: parent.verticalCenter
width: header.triggerWidth > 0 ? header.triggerWidth : 44
width: 44
height: 36
// Half the HEIGHT, not a constant: at 44x36 the pill was a stadium and
// at 78x36 a hardcoded 18 would have left it a rounded rectangle with
// a different silhouette from the circle beside it.
// Half the height — same silhouette as the capsule it now sits beside.
radius: height / 2
// Slint glass #00000080 / border #ffffff2e (RRGGBBAA), converted.
color: "#80000000"
+10 -32
View File
@@ -200,30 +200,17 @@ Item {
hideTimer.restart()
}
// C1 macOS traffic lights (contract 03 §6). Only when the native lights
// float over client area, i.e. not with the system title bar.
// C1 macOS traffic lights (contract 03 §6): NOTHING TO CLEAR ANY MORE.
//
// The band used to be pushed to their RIGHT (`leftMargin: 24 + inset`,
// the shell HeaderBar's rule). On the shell that reads fine — the lights
// sit at the head of a full toolbar row. Here the row is three floating
// glass pills over artwork, and a 44px pill parked beside the lights read
// as debris rather than as chrome. It goes BELOW them now.
// The band used to be inset to their right (`leftMargin: 24 + inset`,
// the shell HeaderBar's rule) because the view trigger sat at the band's
// left edge — x ~ 7-85, exactly where the lights float. The trigger moved
// to the RIGHT of the band, beside the window-controls capsule, so the
// left half is empty and the lights have that corner to themselves.
//
// Vertical clearance from SafeArea's TOP margin, which is the same
// question the left inset asks in the other axis: with
// `ExpandedClientAreaHint` the client area covers the titlebar region and
// SafeArea reports how much of it is unsafe. The floor is the standard
// 28px title-bar height for the case where it reads 0.
readonly property int chromeTopInset:
QbzShell.isMacos && !QbzShell.systemTitleBar
? Math.max(root.SafeArea.margins.top, 28) : 0
// The cluster's WIDTH, handed to the header so the view trigger can match
// it: stacked, a 44px pill under a ~78px cluster reads as misaligned even
// when the left edges line up. 0 = leave the trigger its natural width.
readonly property int chromeClusterWidth:
QbzShell.isMacos && !QbzShell.systemTitleBar
? Math.max(root.SafeArea.margins.left, 78) : 0
// Dropping the whole row below the lights was tried and reverted: it moved
// the search field and the capsule down with it to solve a problem only
// the trigger had.
// Last hover position that WOKE the chrome. Load-bearing delta guard:
// Qt re-delivers HoverMove at the unchanged position whenever the scene
// under a stationary cursor updates (constant on any animated surface —
@@ -693,18 +680,9 @@ Item {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
// C1 macOS: the lights float over the top-left corner (x ~ 7-85,
// which is the view trigger's exact spot), so the band drops BELOW
// them instead of shifting right — see `chromeTopInset`. The left
// margin stays 24 on every platform, which puts the trigger's leading
// edge in the same 20-24 band the lights start in, so the two read as
// one column.
anchors.leftMargin: 24
anchors.rightMargin: 24
// 16 is the band's own gap from the window edge; reusing it as the gap
// UNDER the lights keeps the rhythm instead of inventing a number.
anchors.topMargin: 16 + root.chromeTopInset
triggerWidth: root.chromeClusterWidth
anchors.topMargin: 16
height: 36
opacity: root.chromeVisible ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 300 } }