On Wednesday 15 January 2014 18:16:12 Rafael Roquetto wrote:
> Hello everyone,
> 
> I noticed that one program that I run displays a lot of black squares when it
> shouldn't - I traced the problem down to the fact that, at least on this env
> - KDE4 + Qt5 dev branch HEAD - QPalette::mid() returns QBrush(QColor(ARGB 1,
>   0, 0, 0) , SolidPattern ), or black.
> 
> It seems that nowhere in the Qt source code the value of QPalette::Mid is 
> being
> set, apart from QWindowsTheme. In my case, the relevant class is QKdeTheme,
> which does set a value for QPalette::Mid but only for the QPalette::Disabled
> ColorGroup. Therefore, for the Active color group the value is defaulting to
> black.
> 
> Is this intended behavior or should this be fixed? For more context, see
> QKdeThemePrivate::readKdeSystemPalette() inside qgenericunixthemes.cpp.

What a coincidence - I just reported this as a bug to digia (we have commercial 
support)
and I already provided a fix for this. They said they will push this to gerrit.

If you'd like to have a look at my solution, see attached patch.

-- 
Best regards/Schöne Grüße

Martin
A: Because it breaks the logical sequence of discussion
Q: Why is top posting bad?

()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments

Geschenkideen, Accessoires, Seifen, Kulinarisches: www.bibibest.at
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
index ee295af..f44d53a 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -317,19 +317,23 @@ void QKdeThemePrivate::readKdeSystemPalette(const QSettings &kdeSettings, QPalet
     const QBrush buttonBrushDark = QBrush(button.darker(v > 128 ? 200 : 50));
     const QBrush buttonBrushDark150 = QBrush(button.darker(v > 128 ? 150 : 75));
     const QBrush buttonBrushLight150 = QBrush(button.lighter(v > 128 ? 150 : 75));
+    const QBrush buttonBrushLight = QBrush(button.lighter(v > 128 ? 200 : 50));
 
     pal->setBrush(QPalette::Disabled, QPalette::WindowText, buttonBrushDark);
     pal->setBrush(QPalette::Disabled, QPalette::ButtonText, buttonBrushDark);
     pal->setBrush(QPalette::Disabled, QPalette::Button, buttonBrush);
-    pal->setBrush(QPalette::Disabled, QPalette::Light, buttonBrushLight150);
-    pal->setBrush(QPalette::Disabled, QPalette::Dark, buttonBrushDark);
-    pal->setBrush(QPalette::Disabled, QPalette::Mid, buttonBrushDark150);
     pal->setBrush(QPalette::Disabled, QPalette::Text, buttonBrushDark);
     pal->setBrush(QPalette::Disabled, QPalette::BrightText, whiteBrush);
     pal->setBrush(QPalette::Disabled, QPalette::Base, buttonBrush);
     pal->setBrush(QPalette::Disabled, QPalette::Window, buttonBrush);
     pal->setBrush(QPalette::Disabled, QPalette::Highlight, buttonBrushDark150);
     pal->setBrush(QPalette::Disabled, QPalette::HighlightedText, buttonBrushLight150);
+
+    // set calculated colors for all groups
+    pal->setBrush(QPalette::Light, buttonBrushLight);
+    pal->setBrush(QPalette::Midlight, buttonBrushLight150);
+    pal->setBrush(QPalette::Mid, buttonBrushDark150);
+    pal->setBrush(QPalette::Dark, buttonBrushDark);
 }
 
 /*!
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to