Windows: only consider actual palette when selecting frame appearance
Even if dark mode has been requested by the application explicitly, a style, like the Vista style, might polish the palette to be light. In that case, the frame should be light as well. Amends 95d4e6bababfeb36fa8a355a8487b64eb3ffb587. Task-number: QTBUG-124490 Change-Id: I7ddb0a80a5f043e98cf184537bffe75e917c3d38 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
816071d440
commit
709e9d90ab
@ -33,7 +33,6 @@ public:
|
||||
|
||||
Qt::ColorScheme colorScheme() const override;
|
||||
void requestColorScheme(Qt::ColorScheme scheme) override;
|
||||
Qt::ColorScheme requestedColorScheme() const { return s_colorSchemeOverride; }
|
||||
|
||||
static void handleSettingsChanged();
|
||||
|
||||
|
@ -855,12 +855,6 @@ static inline bool shouldApplyDarkFrame(const QWindow *w)
|
||||
if (!QWindowsIntegration::instance()->darkModeHandling().testFlag(QWindowsApplication::DarkModeWindowFrames))
|
||||
return false;
|
||||
|
||||
// the application explicitly overrides the color scheme
|
||||
if (const auto requestedColorScheme = QWindowsTheme::instance()->requestedColorScheme();
|
||||
requestedColorScheme != Qt::ColorScheme::Unknown) {
|
||||
return requestedColorScheme == Qt::ColorScheme::Dark;
|
||||
}
|
||||
|
||||
// if the application supports a dark border, and the palette is dark (window background color
|
||||
// is darker than the text), then turn dark-border support on, otherwise use a light border.
|
||||
auto *dWindow = QWindowPrivate::get(const_cast<QWindow*>(w));
|
||||
|
Loading…
x
Reference in New Issue
Block a user