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).
+21
View File
@@ -288,6 +288,27 @@ URL: "steam://launch/1009850/openvroverlay" auto-launch: true`.
generated `run.sh` checked with `sh -n`. No new warnings in the changed lines.
- **Not tested yet:** on the Frame (log line "Font: …", PNG written).
### Fix: Quick Controls style Fusion (2026-10-08)
- **Measurements on the Frame** (snapshots of the root page, OpenGL):
- Log: `Font: "Noto Sans" 9 pt = 12 px (requested "Sans Serif" 9 pt); 20 pt = 27 px;
screen "gamescope" logical DPI 96 physical DPI 63.972 device pixel ratio 1`. Fonts, DPI
and scaling are as intended.
- The PNG itself is cut off: OVRAS renders the content too large; SteamVR doesn't crop.
- Navigation buttons: as `qt6` is, 65 px (pitch 75) = Material. With
`QT_QUICK_CONTROLS_STYLE=Basic` (verified in the process environment): identical, the
import overrides it. Test build without the Material import (not committed): 45 px
(pitch 55) = Fusion, **everything fits**. Same build with Basic: 49 px (pitch 59), the
last button is cut off.
- **Fix (DESIGN.md section 11):** `mainwidget.qml` imports `QtQuick.Controls` again;
`main.cpp` sets `QQuickStyle::setStyle("Fusion")`.
- **Result:** cross build and package succeed, `Qt_6_PRIVATE_API` without `QVulkan*`: 0.
- **Not tested yet:** the committed build on the Frame (expected as in the test build);
the other pages.
- **Seen, not changed:** on "Chaperone" and "Space Fix" the icon still overlaps the text
slightly (`MyPushButton`: icon as wide as the button is high, text only indented by
spaces).
### Test checklist on the Frame (step 5)
Deploy: `build_scripts/steamframe/deploy-to-frame.sh <user>@<frame>` (SteamVR running).