D18482: [KRDB] Write correct tooltip colors into gtkrc in kcminit
Kai Uwe Broulik
noreply at phabricator.kde.org
Wed Jan 23 19:06:40 GMT 2019
broulik created this revision.
broulik added reviewers: Plasma, VDG.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
broulik requested review of this revision.
REVISION SUMMARY
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.
BUG: 355540
FIXED-IN: 5.12.8
TEST PLAN
Because of a bug preventing proper propagation of environment variables to apps launched through Kickoff/KRunner (KRun?) via klauncher(??) this is hardly noticeable but when you e.g. open Gimp or Inkscape through "Open With" in Dolphin or manually using
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:$HOME/.gtkrc-2.0:$HOME/.config/gtkrc-2.0 gimp
I didn't fully understand where it gets the tooltip base vs background from, so here are the compared values:
Incorrect colors applied on startup by kcminit (note the light `bg`):
style "ToolTip"
{
bg[NORMAL] = { 0.937, 0.937, 0.937 }
base[NORMAL] = { 1.000, 1.000, 1.000 }
text[NORMAL] = { 0.000, 0.000, 0.000 }
fg[NORMAL] = { 0.000, 0.000, 0.000 }
}
Without this patch colors applied correctly when hitting Apply in the Color KCM:
style "ToolTip"
{
bg[NORMAL] = { 0.192, 0.212, 0.231 }
base[NORMAL] = { 0.137, 0.149, 0.161 }
text[NORMAL] = { 0.937, 0.941, 0.945 }
fg[NORMAL] = { 0.937, 0.941, 0.945 }
}
Colors applied consistently with this patch, notice how `base` is now same as `bg` and different from the previous correct case:
style "ToolTip"
{
bg[NORMAL] = { 0.192, 0.212, 0.231 }
base[NORMAL] = { 0.192, 0.212, 0.231 }
text[NORMAL] = { 0.937, 0.941, 0.945 }
fg[NORMAL] = { 0.937, 0.941, 0.945 }
}
REPOSITORY
R119 Plasma Desktop
REVISION DETAIL
https://phabricator.kde.org/D18482
AFFECTED FILES
kcms/krdb/krdb.cpp
To: broulik, #plasma, #vdg
Cc: plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190123/23613e81/attachment-0001.html>
More information about the Plasma-devel
mailing list