Use the Fusion Quick Controls style; drop the Material import

On the Steam Frame, the fixed 1200x800 layout lost about its bottom
quarter. Measured with --snapshot: fonts and DPI are as intended, but
the controls ran in the Material style. The qt6 branch changed
mainwidget.qml's "import QtQuick.Controls" into
"import QtQuick.Controls.Material", which fixes Material for all
controls and even overrides QT_QUICK_CONTROLS_STYLE. Material's insets
and padding make the navigation buttons 65 px tall instead of 45 px
(Fusion) or 49 px (Basic, Qt 5's default style renamed); nothing in the
file uses Material.

mainwidget.qml imports QtQuick.Controls again, and main.cpp sets Fusion
explicitly, so the sizes are the same on every platform instead of
depending on Qt 6's per-platform default. With Basic the last navigation
button is still cut off on the Frame; with Fusion everything fits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 00:14:57 +02:00
co-authored by Claude Opus 5.5
parent d664f86945
commit ff4ea8f455
4 changed files with 60 additions and 1 deletions
+24
View File
@@ -281,6 +281,30 @@ suspect; measuring needs the unwarped rendered image.
- `run.sh`: arguments after the graphics API go to the program
(`./run.sh opengl --snapshot /tmp/ovras.png`).
## 11. Quick Controls style: Fusion, no Material import (approved 2026-10-08)
**Finding (measured with `--snapshot`, DESIGN.md section 10):** the font is as intended (20 pt
= 27 px, 96 DPI, device pixel ratio 1). The controls run in the Material style: `qt6`
(`93c0851`) changed `mainwidget.qml`'s `import QtQuick.Controls` into
`import QtQuick.Controls.Material`. That import fixes Material for all controls and even
overrides `QT_QUICK_CONTROLS_STYLE`. Material's insets and padding make the navigation
buttons 65 px tall (75 px pitch), so the fixed 1200×800 root page loses about its bottom
quarter. Nothing in the file uses Material.
| Style (root page, navigation buttons) | Button | Pitch | Result |
|---|---|---|---|
| Material (`qt6` as is) | 65 px | 75 px | 9 of 12 buttons visible |
| Basic (Qt 5's "Default" renamed) | 49 px | 59 px | last button cut off (18 of 49 px) |
| Fusion (Qt 6's Linux default) | 45 px | 55 px | everything fits |
**Changes:**
- `mainwidget.qml`: `import QtQuick.Controls` again, as before `93c0851`, with a comment.
- `main.cpp`: `QQuickStyle::setStyle("Fusion")` after `QQuickWindow::setGraphicsApi()`,
before any QML is loaded. Explicit, so the look and sizes are the same on every platform
(without it Qt 6 picks Windows' own style there). Links `Qt6QuickControls2` directly
(already a dependency; present on the Frame: `/usr/lib/libQt6QuickControls2.so.6.8.0`).
- Upstream note: with Material, the layout overflows on Windows too.
## Tests
- **x86_64 locally:** the build succeeds; `objdump` check (R1).