View Issue Details

IDProjectCategoryView StatusLast Update
0017279ScribusUser Interfacepublic2024-09-22 19:24
Reporternitramr Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
Status newResolutionopen 
PlatformDesktop PCOSUbuntuOS Version24.04 64-bit
Product Version1.6.2 
Target Version1.6.3.svn 
Summary0017279: Workaround for QPalette bug
DescriptionFirst of all, this is not a Scribus bug.

Since Qt 6.5 introduced support for dark themes, changes have been made to the underlying style system.

As a result, the entire UI with the Fusion theme under Gnome is much too bright. Also, the disabled color is no longer displayed correctly.
See my bug report here: https://bugreports.qt.io/browse/QTBUG-126208

It doesn't look like the bug will be fixed anytime soon, hence this temporary patch.

The bug is only visible if Scribus is compiled with Qt 6.5+
TagsNo tags attached.
PatchYes

Activities

nitramr

2024-09-22 19:24

developer  

qpalette_fix_2024-09-22_01.patch (993 bytes)   
Index: scribus/scribusapp.cpp
===================================================================
--- scribus/scribusapp.cpp	(Revision 26310)
+++ scribus/scribusapp.cpp	(Arbeitskopie)
@@ -33,6 +33,7 @@
 #include <QLocale>
 #include <QString>
 #include <QStringList>
+#include <QStyleHints>
 #include <QTextCodec>
 #include <QTextStream>
 #include <QTranslator>
@@ -347,6 +348,18 @@
 
 int ScribusQApp::init()
 {
+
+#if (defined Q_OS_LINUX && QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
+	// As long as this bug persists, we have to repair the palette ourselves
+	// https://bugreports.qt.io/browse/QTBUG-126208
+	// See color values of fusion palette here: https://github.com/qt/qtbase/blob/dev/src/gui/kernel/qplatformtheme.cpp#L356
+	if (this->styleHints()->colorScheme() == Qt::ColorScheme::Light && this->style()->name() == "fusion")
+	{
+		QPalette pal(QColor(239, 239, 239));
+		this->setPalette(pal);
+	}
+#endif
+
 	m_ScCore = new ScribusCore();
 	Q_CHECK_PTR(m_ScCore);
 	if (!m_ScCore)

Issue History

Date Modified Username Field Change
2024-09-22 19:24 nitramr New Issue
2024-09-22 19:24 nitramr File Added: qpalette_fix_2024-09-22_01.patch