-
-
Notifications
You must be signed in to change notification settings - Fork 978
Draft – Requesting Feedback on Architectural Direction #4731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
A main question is… for what? |
This work started from exploring how to add a menubar, which reveals that the existing UI architecture does not align well with Qt’s windowing model and makes standard Qt UI features awkward to implement. Rather than extending the custom window and dialog infrastructure further, I moved the UI closer to Qt’s intended usage (QMainWindow, QDialog). |
|
Why you need to see a menubar? |
I think this is intentional. Besides, what you're doing is not just switching to Qt-based window management, it separates Stellarium windows, turning Stellarium's behavior from MDI to a very different model, with separate window getting focus while deactivating the main window. This is a problem on some GPUs in Windows, where the exclusive full screen mode gets flicker when separate windows (even as simple as tooltips) appear, see the discussion in #4678. Also, how well do the global shortcuts like F4 work now? Do they open the corresponding dialog even when Stellarium window isn't active (e.g. minimized)? Or, if not, do they work when, say, the Help dialog is active? And, you will now have to implement full support for the Night mode in the CSS (and this will miss the window decorations (and possibly window glow), unless you implement them on the client side, which loses the native OS window dragging-by-titlebar you aimed to get). |
|
Stellarium's UI style is one of the original features that even predate Qt's use (not sure about the sliding bars, but the lower menu bar is ancient) and is one identifying feature of this program. While I would like to see somebody implement a working alternative GUI using QML which might fit better in an optional Android build on small-screen/vertical devices, I am not sure I want to see a "standard" menu bar just for the sake of having a menu bar. Are there any user benefits? How does that change full-screen mode? |
|
I think the menu bar is something we could have as an optional feature. This wouldn't require the drastic change of window management as is done in this PR, and it could just be a plugin, similarly to the TUI or Remote Control plugins.
IMO, QML would be unmanageable with the huge number of GUI options Stellarium has. Currently we can visually place all the checkboxes/radios/buttons etc. in the right places thanks to Qt Designer. But is there such a visual tool for QML? |
|
Menu bar as plugin: OK. Or even as CMake option fore self-builders whose lives depend on menu bars, as long as it can be maintained with low effort. |
|
Thanks for the detailed feedback. After considering the concerns raised here, I agree that this work should be split and the scope narrowed, while still clearly describing the intended behavior of each part. Concretely, I suggest splitting this into two parts:
This part is non-breaking and primarily housekeeping:
With the option disabled (default), behavior is identical to current
On macOS menubar has effectively no visual impact:
Beyond convention, the macOS menubar enables standard system features (notably Help-menu search) without introducing new workflows or UI concepts. This improves discoverability while keeping Stellarium’s existing interaction model intact.
I understand that Stellarium’s current MDI-like dialog model is intentional and historically motivated, particularly for fullscreen stability and visual consistency.
Agreed. The dialog refactor (moving fully to native
At the same time, this change has clear trade-offs, including:
Given those trade-offs, I’m happy to continue evaluating this dialog/windowing model downstream and report concrete findings (especially around Windows fullscreen behavior, night mode and platform-appropriate dialog presentation, such as native sheets where available) before proposing anything upstream. Summary
If this split sounds reasonable, I’ll rework this PR to contain only the |
|
There is some QML GUI design support, not tested: https://doc.qt.io/qtcreator/creator-qtquickdesigner-plugin.html. The full Qt Design Studio requires more than a FOSS license, though. :-( |
The optional menubar feature sounds OK. The windowing change needs more consideration. |
This PR migrates Stellarium’s UI from custom window/dialog infrastructure to standard Qt windowing (
QMainWindow,QDialog).The primary goal is to remove custom UI glue and rely on Qt’s native behavior for window management, focus, modality, and platform integration. No new UI concepts or workflows are introduced.
Description
Key changes include:
StelMainWindowas the owner of application-level UI concerns (menubar, window title/icon, geometry, window management).StelMainWindowto allow correct dialog parenting.StelDialoginheriting fromQDialog.StelDialogSeparate,TitleBar,ResizeableFrame, and related proxy logic).StelDialog,QWidget, orQDialog.main.cpp; UI responsibilities moved intoStelMainWindow.StelMainViewno longer manages window title or icon (further refactoring planned separately).StelAppremains largely unchanged.Because Qt windowing defines layout, focus, and stacking behavior, this migration results in broad UI changes. These are a direct consequence of removing custom infrastructure rather than an intentional redesign. A minimal Qt stylesheet is included to provide a functional baseline after the migration; it is not coupled to the architectural changes and can be freely modified or removed.
Screenshots (if appropriate):
Type of change
How Has This Been Tested?
Manual testing focused on functional parity and regression detection:
Test Configuration:
CC=clang CXX=clang++ cmake ../ -GNinja -DENABLE_QT6=ON -DENABLE_QTWEBENGINE=OFF -DENABLE_TESTING=ONTest Results:
Checklist: