Hang the Control Center where every other popover hangs

Five surfaces sat 12 pixels under the bar -- the date menu, the activity panel,
notification toasts, signal glass and the clipboard, all using barGap * 2. The
Control Center sat at 2, through a constant of its own, which left the widest
surface in the shell hanging ten pixels higher than the date menu beside it.

That constant arrived with the original Control Center and carried no reason,
while barGap directly above it explains itself. The clipboard even cites
QuickSettings in a comment for how it derived its own margin, and still landed
on 12. It reads as an early value nothing else converged on rather than a
decision, which is why it is going rather than being documented and kept.

The contract that guarded it pinned the literal, and that same file already
records where pinning a literal led: it once asserted the buggy margin
expression, so the code and the test agreed and a 38-pixel gap was invisible to
both. Replacing one number with another would have repeated it. It now reads the
top margin out of the Control Center and out of the date menu and requires them
to match, so drift in either direction fails -- verified by moving each one in
turn and watching it break.

Claude-Session: https://claude.ai/code/session_01BRvzt4H8XXLPVH5MyYdk9L
This commit is contained in:
Gabriel Brown
2026-08-20 13:41:12 -04:00
parent 495fb9b41b
commit 23141673a2
3 changed files with 18 additions and 8 deletions
@@ -30,7 +30,11 @@ PanelWindow {
// against the top edge rather than hanging under nothing.
anchors.top: true
anchors.right: true
margins.top: Theme.controlCenterTopGap
// The same gap every other popover uses. This had its own constant set to
// 2, which left the widest surface in the shell hanging ten pixels higher
// than the date menu beside it -- an early value nothing else converged on
// rather than a decision; it carried no reason, while barGap does.
margins.top: Theme.barGap * 2
margins.right: Theme.barSideMargin
exclusiveZone: 0