be run Application category background
KISS Desktop Shell on KDE libs & some applications
Status: Beta
Brought to you by:
baghira-style
Hi thomas,
I found that the background of the programs categories in the Berun is being taken from the color of the text, rather than the color of the window or the highlighted.
even if you customize via the style.css, the background color is taken from the color of the text instead of the background color.
see the attached screenshot, i set the background color to black, and the text color to yelow, see the program category are yellow so is using the text color.
thanks
Yes, the colors are inverted for the headers and the contrast (to the actual items) lowered with the depth of the section, ie.
Main group // yellow bg
Subgroup // darker yellow bg
Subgroup to Subgroup // more darkened yellow bg
It's pretty important to have an idea on whether you're selecting a group or a program.
The selection color is of course no option either, since the group entries can be selected as well.
So, what do you mean to suggest/expect/..?
I agree, we must differentiate the categories/groups, and programs.
I can suggest, according to what I've been testing, is that we should be able to change the background color of the group independently of the text.
because now the text color is what defines the background color.
I found these two classes
. BE - Run QTreeWidget {
}
. BE - Run QAbstractItemView {
}
and I've seen that do the same.
so why not make
. BE - Run QTreeWidget
draw groups (favorites, dev, education, office etc), and
. BE - Run QAbstractItemView
the list of programs inside the groups (the programs names)
for example
. BE - Run QTreeWidget {
background: black;
color: white;
}
the background of the groups/categories (favorites, dev, education, office, etc.) would be black with white text color
and
. BE - Run QAbstractItemView {
background: yellow;
color: blue;
}
the background color of the list of applications (multimedia: amarok, audacity, k3b etc) would be yellow with blue text color
That's not trivially possible.
I can apply any kind of logics to the input, but the input is pretty limited.
QSS hands a palette to the delegate and you can style foregound, background and alternate base, ie. no extra foreground color for the alternate base (which is actually the shaded lines in some views)
Yes, because technically QTreeWidget is a (special) QAbstractItemView - the further assumptions do not work the way you think.
The solution has to be somehow like
.BE--Run QTreeView { / yes, that matches as well ;-) /
color: foo;
background-color: bar;
alternate-background-color: fifi;
magic-solution-color: magic;
}
But we lack a "magic-solution-color".
hi, thomas
i just made a small change in the runner.cpp
for use other color instead of the windows text color
this is the result:
http://postimg.org/image/m64nbptav/
looks much better and combines more
the best wolud be use the base color, but when i try to compile using the base color i have a compilation error :
"
[ 48%] Building CXX object CMakeFiles/be.shell.dir/runner.o
/home/samuel/Descargas/be-shell-code/runner.cpp: En la función miembro ‘virtual void BE::RunPopupDelegate::paint(QPainter, const QStyleOptionViewItem&, const QModelIndex&) const’:
/home/samuel/Descargas/be-shell-code/runner.cpp:207:46: error: ‘BaseText’ no es un miembro de ‘QPalette’
const QColor &fg = pal.color(QPalette::BaseText);
^
/home/samuel/Descargas/be-shell-code/runner.cpp: En el ámbito global:
/home/samuel/Descargas/be-shell-code/runner.cpp:430:1: aviso: parámetro ‘grp’ sin uso [-Wunused-parameter]
BE::Run::saveSettings( KConfigGroup grp )
^
make[2]: [CMakeFiles/be.shell.dir/runner.o] Error 1
make[1]: [CMakeFiles/be.shell.dir/all] Error 2
make: *** [all] Error 2
"
i dont know what its the correct name of the base text color in the QPalette, so i use the Highlight color instead
the patch is attached
please see if is possible use the base color and basetext color it would be the best i think
thanks and greetings
Last edit: Samuel Azcona 2013-08-01
You're using the highlight color what means one cannot see whether the item is selected (plus the highlight color will usually be "blue" or so - doesn't sound like a great solution to me)
The counter to "Base" is just "Text", but that's effectively the Window/Text color anyway (ie. no different look)
See http://sourceforge.net/p/be-shell/code/ci/e982ca592a9e0ee774c02d2c562adc275e740f96/tree/runner.cpp?diff=a14a098d8c16e20a46f137ef4a0eaddd457361e6
If you turn "#if 0" into "#if 1" you can configure the backround color as "alternate-background-color", the foreground is chosen automatically.
I'm not absolutely happy with it atm (mostly due to false color assumption on rgba backgrounds, partially affects the present code as well, though)