Details
-
Task
-
Resolution: Done
-
P2: Important
-
None
-
None
-
4f3249f32dbe5c20aabbfd9b4f9c558aaf449e48
Description
Carbon and HITheme are going away. However, we can't remove those dependencies from QMacStyle straightaway, as they are very deeply ingrained.
Based on discussions and advice from the platform vendor, our mid-term plan before rewriting QMacStyle to remove the HITheme dependency, is to move the style into a plugin, so that the QtWidgets framework does not have a hard dependency on the Carbon framework or the HITheme APIs.
Because it's good architecture, we should move out the windowsxp, windowsvista, and android styles into plugins as well.
The QMacStyle is rather tightly coupled to QtWidgets compared to the other platform-specific style plugins. For now, we can do a runtime check if the QObject inherits from QMacStyle, but the dependencies should be properly decoupled. An overview of the problem cases (these are copied from handwritten notes and so may be rather sparse in some cases):
- QMdiSubWindowPrivate::updateCursor: use a style hint? We can return if the SH_OverrideMdiSubWindowCursor style hint is not set, or return if the QMdiSubWindowCursor style hint is a null QCursor (or null QVariant)
- QMdiSubWindowPrivate::processClickedSubControl: check for additional SC_ controls in the subControlRect in QMacStyle depending on the window state. The sub control returned should depend on its ACTION, not its APPEARANCE (macOS windows don't have a separate restore button; the minimize and maximize buttons fill that role depending on the window state)
- qmdisubwindow.cpp: ControllerWidget > getSubControl > should be QStyleOptionTitleBar
- QMdiSubWindowPrivate::getRegion: remove, no longer applies on macOS
- QMdiSubWindowPrivate::showEvent: remove the macOS block (setSizeGrip, setSizeGripVisible)
- QMdiSubWindow::mouseMoveEvent: just use the same behavior on all platforms
QMdiSubWindowPrivate::drawTitleBarWhenMaximized: return true for SH_Workspace_FillSpaceOnMaximize in QMacStyle? (we seem to have missed this one from last time; it even still has a hardcoded QT_CONFIG(style_mac))https://codereview.qt-project.org/#/c/190315/
Attachments
Issue Links
- resulted in
-
QTBUG-71826 No Visual Styles on Windows 7/8 in 5.12
-
- Closed
-