Building DotScramble Part 4: A New UI in One Stylesheet, 7 Languages With Real Plurals, and the Bugs Only a Clean Machine Found
Описание и применение
DotScramble 1.5 реализовал единый стиль, расширил языковую поддержку и улучшил взаимодействие с пользователем, устранив проблемы с темами и окнами.
Задача
The DotScramble 1.4 UI was fragmented, with colors and fonts set in Python, making theme changes cumbersome and inconsistent across widgets.
Результат
DotScramble 1.5 achieved a unified, theme‑driven UI, expanded language support, improved privacy guarantees, and resolved packaging bugs uncovered by a clean build machine.
Рабочий процесс
- 1. Define a token-based QSS template with placeholders for theme colors and opacity.
- 2. Store theme definitions in themes.json and use a regex to replace tokens with actual values.
- 3. Expose widget hooks (objectName, variant, role) to allow styling via the stylesheet.
- 4. Refactor UI components to remove inline styling and rely on the stylesheet.
- 5. Implement a canvas with Detect preview and Compare features for better user interaction.
- 6. Fix window tiling by adjusting toolbar size policy and adding an event filter to switch to icon-only mode when space is limited.
- 7. Add support for seven languages with correct CLDR plural forms.
- 8. Ensure the privacy tool never fails silently and integrate CI with GitHub Actions for builds, tests, and signing.
Доказательства
widgets never set a color or a font in Python.
The rule I set: widgets never set a color or a font in Python.
The old preview was a scaled label. The new canvas has mouse-wheel zoom around the cursor, pan, fit / 100 %, and two features that change how the app feels: Detect preview and Compare.
The toolbar no longer reports a minimum width (QSizePolicy.Policy.Ignored), and an event filter switches it to icon-only buttons when there isn't room for the labels.
- Дата записи: 2026-11-02T20:14:12.936Z