Commit c394dc46 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[KRDB] Write correct tooltip colors into gtkrc in kcminit

kcminit for performance reasons is not desktop settings aware which means it won't load the plasma integration plugin and as such
not apply the color scheme to Qt's widgets.
When writing the GTK config, it would read them from kdeglobals directly. However, for tooltips it would use QToolTip::palette()
which would then use Qt's default palette in kcminit. Use the QPalette we created from kdeglobals to get the tooltip colors instead.

CCBUG: 355540

Differential Revision: https://phabricator.kde.org/D18482
parent 88fdc2b1
......@@ -29,7 +29,6 @@
#include <QFontDatabase>
#include <QtCore/QSettings>
#include <QtCore/QTextCodec>
#include <QToolTip>
#include <QPixmap>
#include <QByteArray>
......@@ -375,11 +374,10 @@ static void createGtkrc( bool exportColors, const QPalette& cg, bool exportGtkTh
// tooltips don't have the standard background color
t << "style \"ToolTip\"" << endl;
t << "{" << endl;
QPalette group = QToolTip::palette();
t << " bg[NORMAL] = " << color( group.color( QPalette::Active, QPalette::Background ) ) << endl;
t << " base[NORMAL] = " << color( group.color( QPalette::Active, QPalette::Base ) ) << endl;
t << " text[NORMAL] = " << color( group.color( QPalette::Active, QPalette::Text ) ) << endl;
t << " fg[NORMAL] = " << color( group.color( QPalette::Active, QPalette::Foreground ) ) << endl;
t << " bg[NORMAL] = " << color( cg.color( QPalette::ToolTipBase ) ) << endl;
t << " base[NORMAL] = " << color( cg.color( QPalette::ToolTipBase ) ) << endl;
t << " text[NORMAL] = " << color( cg.color( QPalette::ToolTipText ) ) << endl;
t << " fg[NORMAL] = " << color( cg.color( QPalette::ToolTipText ) ) << endl;
t << "}" << endl;
t << endl;
t << "widget \"gtk-tooltip\" style \"ToolTip\"" << endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment