View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017279 | Scribus | User Interface | public | 2024-09-22 19:24 | 2024-09-22 19:24 |
Reporter | nitramr | Assigned To | |||
Priority | normal | Severity | tweak | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | Desktop PC | OS | Ubuntu | OS Version | 24.04 64-bit |
Product Version | 1.6.2 | ||||
Target Version | 1.6.3.svn | ||||
Summary | 0017279: Workaround for QPalette bug | ||||
Description | First 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+ | ||||
Tags | No tags attached. | ||||
Patch | Yes | ||||
|
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) |