Windows: Enable dark mode system palette by default
Can be overwritten by setting the "darkmode" parameter of the QPA
platform to 0 or 1. The Windows Vista style (which is the
default on Windows) will overwrite the platform theme's palette with the
light system palette (see a2518b4140
), but
styles that support rendering in dark mode will just run with the dark
palette.
More work needed in qtdeclarative to make the Qt Quick native style for
Windows also overwrite the palette, and to handle palette changes in Qt.
[ChangeLog][Windows] Qt applications that use a style that supports
dark mode rendering (such as the classic Windows or Fusion styles) will
respect the dark appearance setting on Windows. Applications that use
the Vista style, which doesn't support rendering in dark mode, will
use the light system palette. On dark mode systems, the window frame
will be dark if the palette is dark.
Task-number: QTBUG-72028
Change-Id: I416b4fd59eb3f64701b403984c7ac2359536abbe
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
12b7eab4d2
commit
074a4e16a3
@ -572,6 +572,9 @@ static QWindowGeometrySpecification windowGeometrySpecification = Q_WINDOW_GEOME
|
||||
experimental pending the introduction of new style that
|
||||
properly adapts to dark mode.
|
||||
|
||||
As of Qt 6.5, the default value is 2; to disable dark mode
|
||||
support, set the value to 0 or 1.
|
||||
|
||||
\li \c {dialogs=[xp|none]}, \c xp uses XP-style native dialogs and
|
||||
\c none disables them.
|
||||
|
||||
|
@ -233,7 +233,8 @@ void QWindowsIntegrationPrivate::parseOptions(QWindowsIntegration *q, const QStr
|
||||
QtWindows::ProcessDpiAwareness dpiAwareness = QtWindows::ProcessPerMonitorV2DpiAware;
|
||||
|
||||
int tabletAbsoluteRange = -1;
|
||||
DarkModeHandling darkModeHandling = DarkModeHandlingFlag::DarkModeWindowFrames;
|
||||
DarkModeHandling darkModeHandling = DarkModeHandlingFlag::DarkModeWindowFrames
|
||||
| DarkModeHandlingFlag::DarkModeStyle;
|
||||
m_options = ::parseOptions(paramList, &tabletAbsoluteRange, &dpiAwareness, &darkModeHandling);
|
||||
q->setDarkModeHandling(darkModeHandling);
|
||||
QWindowsFontDatabase::setFontOptions(m_options);
|
||||
|
Loading…
Reference in New Issue
Block a user