Color issues with Applet::showMessage()

Martin darklight.xdarklight at googlemail.com
Sun Nov 7 01:41:25 CET 2010


Hi,

it looks like there's some trouble using Plasma::Applet::showMessage() in 
Amarok.

But first some background information for you:
Amarok has it's own ContextView - which is a Containment with lots of applets 
in it.
What I'm trying to do is getting the user's attention in exactly ONE applet.
The old implementation used KMessageBox. First I thought I could reuse it, but 
that's not the case. I could only block access to either all or no applets.
So I went to #plasma and got a solution: Plasma::Applet::showMessage()

So that's where I am right now: I wrote some convenience methods around 
Plasma::Applet::showMessage().
While testing the code on my box I found out that Amarok's plasma theme (the 
colors file of the theme to name it more precisely) may be wrong.
I'm using a dark theme (called Ember - basically everything is black there).
Since I couldn't read the text from showMessage() first I decided to "fix" the 
colors file and make the text white.
I simple set ForegroundNormal=255,255,255 for [Colors:Window] (since the 
background color is 0,0,0).

It turned out that this was a bad idea.
The colors in showMessage() are fine for everyone.
But in other places it causes trouble. See here: [0] (please note the text of 
the lyrics applet - which is a Plasma::TextBrowser - also the text-color in 
some other places changed, for example in some Plasma::Label).

Now my question:
How to solve this issue? ;)
Is there a way to define a text-color for showMessage() directly?
Or are we doing some crazy things with Plasma components in Amarok (which are 
causing the described trouble)?

If you need some references to the code: feel free to have a look at Amarok's 
source code. You may also need to apply my patch from reviewboard: [1].

Feel free to ping me if you have further questions.

Regards from Germany,
Martin


[0] http://i.imgur.com/LZ4Up.jpg
[1] http://git.reviewboard.kde.org/r/100013/diff/


More information about the Plasma-devel mailing list