OSDN Git Service

apply palette from the QGuiPlatformPlugin instance if it is not null
authorIvailo Monev <xakepa10@gmail.com>
Mon, 21 Aug 2023 00:18:50 +0000 (03:18 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Mon, 21 Aug 2023 00:18:50 +0000 (03:18 +0300)
palette from the config overrides even the platform plugin still (as it is
with the style for example)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/gui/kernel/qapplication_x11.cpp

index 87f6ee9..7ab7a8b 100644 (file)
@@ -599,9 +599,14 @@ bool QApplicationPrivate::x11_apply_settings()
                          QColor(strlist[i]));
     }
 
-    // ### Fix properly for 4.6
-    if (groupCount == QPalette::NColorGroups)
+    if (groupCount == QPalette::NColorGroups) {
         QApplicationPrivate::setSystemPalette(pal);
+    } else {
+        pal = qt_guiPlatformPlugin()->palette();
+        if (pal != QPalette()) {
+            QApplicationPrivate::setSystemPalette(pal);
+        }
+    }
 
     QString fontDescription = settings.string(QLatin1String("Qt/font"));
     if (!fontDescription.isEmpty()) {