Bug 240225

Summary: Keyboard layout indicator is not usable with dark theme
Product: kxkb Reporter: anton <benderamp>
Component: generalAssignee: Andriy Rysin <arysin>
Status: RESOLVED FIXED    
Severity: normal CC: aseigo
Priority: NOR    
Version: 0.9   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: invisible layout indicator

Description anton 2010-05-31 14:50:39 UTC
Created attachment 47516 [details]
invisible layout indicator

Version:           unspecified
OS:                Linux

Keyboard layout indicator is drawn black on black with dark theme (see attached screenshot)

Reproducible: Didn't try

Steps to Reproduce:
set some dark theme for plasma

Actual Results:  
layout indicator would be painted with black font on dark background

Expected Results:  
it should be drawn with some light font or should have theme-independent background as it always had.
Comment 1 Andriy Rysin 2010-06-01 03:33:05 UTC
Seems like it's a limitation of KStatusNotifierItem - there's no way to set the title's text color and KStatusNotifierItem does not adjust it automatically.
Comment 2 Aaron J. Seigo 2010-06-01 04:46:42 UTC
it has nothing to do with the title or other text (that gets set correctly automatically); rather, it has to do with generating a pixmap that doesn't work on all backgrounds. the problematic call is this:

ยท       m_notifierItem->setIconByPixmap( textOrIcon );

textOrIcon needs to be visible on different backgrounds, e.g. black text with a white halo (or vice versa)
Comment 3 Andriy Rysin 2010-06-02 05:30:34 UTC
Ahh, I guess I was looking at the wrong place: looks like at some point I was hoping 	
m_notifierItem->setTitle(shortText);
will set the text but then overrode it with drawing icon and forgot about it.

It seems there's no way to set the text for KStatusNotifierItem - only icon, and there's no way to know the background and halo'ing the text is quite ugly and unreliable...

I'll try to seek some help from k-c-d mailing list...
Comment 4 Andriy Rysin 2010-06-05 21:34:24 UTC
SVN commit 1134934 by rysin:

Provide white shadow for black text in systray
Clear tray pixmap cache on configuration change
BUG: 240225

 M  +4 -0      CMakeLists.txt  
 M  +26 -11    flags.cpp  
 M  +1 -0      flags.h  
 M  +5 -4      keyboard_applet.cpp  
 M  +1 -1      keyboard_config.cpp  
 M  +1 -0      layout_widget.cpp  
 AM            utils.cpp   [License: GPL (v2+)]
 AM            utils.h   [License: GPL (v2+)]


WebSVN link: http://websvn.kde.org/?view=rev&revision=1134934