Plasma colors
Toussis Manolis
manolis at koppermind.homelinux.org
Thu Feb 21 09:44:44 CET 2008
Question #2:
My applet uses two colors. One for text , and one for text highliting.
For now it is just
m_colfg = QColor(Qt::white);
m_selcolfg = QColor(Qt::yellow)
but I don't want to hardcode the colors.
I read the API to figure out how to read some acceptable colors from current
plasma theme.
I tried
KColorScheme(QPalette::Active,KColorScheme::View).foreground(KColorScheme::ActiveForeground).color();
but it gives me black, the text color for the view for kde , NOT plasma. The
thing is kde uses a view with white background so the text with color black
is readable. Also the above ignores completelly the plasma theme
then I tried:
m_colfg = Plasma::Theme::self()->textColor();
it gives me Black again, not readable in the blackbackground of plasma default
theme.
Any hints/ideas/code that I can use?
More information about the Panel-devel
mailing list