pixmaps creation bug maybe

Asked by Lke

<button_pixmap gap = "2" aspect_ratio="13/8" windows_cnt="5">
 <get_icon size="-6" />
 <correct_size />
[...]
  <pixmap name="grad_down_color">
   <composite bg="empty" fg="grad_down" />
   <colorize color="active_color" />
   <bright strength="10" />
   <composite bg="fill_color" fg="self" />
  </pixmap>

  <pixmap name="grad_up_color">
   <composite bg="empty" fg="grad_up" />
   <colorize color="active_color" />
   <bright strength="10" />
   <composite bg="fill_color" fg="self" />
  </pixmap>
[...]
  <if type="all_minimized">
   <pixmap name="mini-comp">
    <composite bg="grad_down_color" fg="button-minimized"/>
   </pixmap>
   <composite bg="mini-comp" fg="icon" opacity="50"/>
  </if>
[...]
Even if I try to make it use only "grad_down_color", it still mixes both pixmaps. Is it a bug or no?
Is it right to use <pixmap name="empty" /> or are there more elegant ways?

Question information

Language:
English Edit question
Status:
Solved
For:
DockbarX Edit question
Assignee:
No assignee Edit question
Solved by:
Lke
Solved:
Last query:
Last reply:
Revision history for this message
Matias Särs (msevens) said :
#1

Could you post the complete config file? I have a hard time getting a grip of what you are trying to do when I see only parts.

Revision history for this message
Lke (culzluca) said :
#2

Here it is: (If you want I can upload the whole theme somewhere)

<theme name = "Styli-theme">
<!--
 Inspired on Shinybar by Alex Kaehler
 Created by Luca Culzoni aka Lke
-->

<pixmaps>
 <pixmap_from_file name="button-normal" file="button-normal.png" />
 <pixmap_from_file name="button-active" file="button-active.png" />
 <pixmap_from_file name="button-minimized" file="button-minimized.png" />
 <pixmap_from_file name="fill_mask" file="fill_mask.png" />
 <pixmap_from_file name="grad_up" file="gradient_up.png" />
 <pixmap_from_file name="grad_down" file="gradient_down.png" />
 <pixmap_from_file name="lay2" file="w2.png" />
 <pixmap_from_file name="lay3" file="w3.png" />
 <pixmap_from_file name="lay4" file="w4.png" />
 <pixmap_from_file name="lay5" file="w5.png" />
 <pixmap_from_file name="mover" file="mover.png" />
 <pixmap_from_file name="i_mover" file="i_mover.png" />
</pixmaps>

<button_pixmap gap = "2" aspect_ratio="13/8" windows_cnt="5">
 <get_icon size="-6" />
 <correct_size />
<!-- !launcher -->
 <if type="!launcher">
  <if type="blink">
   <glow color="active_color" opacity="active_opacity" />
  </if>
  <if type="needs_attention">
   <glow color="active_color" opacity="active_opacity" />
  </if>

<!-- Normal section -->

<!-- Pixmaps -->
  <pixmap name="icon">
   <get_icon size="-6" />
   <correct_size />
  </pixmap>

  <pixmap name="fill_color">
   <fill color="FF0000" />
   <!--<fill color="active_color" />-->
   <alpha_mask mask="fill_mask" />
  </pixmap>

  <pixmap name="empty" />

  <pixmap name="grad_down_color">
   <composite bg="empty" fg="grad_down" />
   <colorize color="active_color" />
   <bright strength="10" />
   <composite bg="fill_color" fg="self" />
  </pixmap>

  <pixmap name="grad_up_color">
   <composite bg="empty" fg="grad_up" />
   <colorize color="active_color" />
   <bright strength="10" />
   <composite bg="fill_color" fg="self" />
  </pixmap>

<!-- Stuff here -->
  <if type="all_minimized">
   <pixmap name="mini-comp">
    <composite bg="grad_down_color" fg="button-minimized"/>
   </pixmap>
   <composite bg="mini-comp" fg="icon" opacity="50"/>
  </if>

  <if type="some_minimized">
   <pixmap name="norm-comp">
    <composite bg="grad_up_color" fg="button-normal" />
   </pixmap>
   <composite bg="norm-comp" fg="icon" />
  </if>
  <if type="!active">
   <pixmap name="norm-comp">
    <composite bg="grad_up_color" fg="button-normal" />
   </pixmap>
   <composite bg="norm-comp" fg="icon" />
  </if>
  <if type="active">
   <pixmap name="acti-comp">
    <composite bg="grad_down_color" fg="button-active" />
   </pixmap>
   <composite bg="acti-comp" fg="icon" />
  </if>

<!-- Mouse over section
  <if type="mouse_over">
   <if type="active">
    <pixmap name="acti_mover">
     <composite bg="acti-comp" fg="mover" opacity="20" />
    </pixmap>

    <composite bg="acti_mover" fg="fg_icon"/>
   </if>

   <if type="!active" >
    <composite bg="self" fg="i_mover" opacity="17" />
   </if>

   <if type="some_minimized" >
    <composite bg="self" fg="i_mover" opacity="17" />
   </if>

   <if type="all_minimized">
    <composite bg="mini-comp" fg="mover" opacity="12" />
    <composite bg="self" fg="fg_icon" />
   </if>
  </if>
-->
<!-- count part -->
  <if windows="2">
   <composite bg="self" fg="lay2" />
  </if>
  <if windows="3">
   <composite bg="self" fg="lay3" />
  </if>
  <if windows="4">
   <composite bg="self" fg="lay4" />
  </if>
  <if windows="5:">
   <composite bg="self" fg="lay5" />
  </if>
 </if>

<!-- launcher (who cares 'bout 'em) -->
 <if type="launcher">
  <if type="mouse_over">
   <bright strength="8" />
   <glow color="active_color" opacity="80" />
  </if>
 </if>
</button_pixmap>
</theme>

Revision history for this message
Lke (culzluca) said :
#3

I must say I edited it so many time that it could just be a stupid thing...

Revision history for this message
Matias Särs (msevens) said :
#4

Could you describe the problem more clearly? Which two pixmaps are you refering to?

And you could upload the theme somewhere, yes.

Revision history for this message
Lke (culzluca) said :
#5

http://www.mediafire.com/file/yofqojqjyyj/styli-theme.tar.gz
I also commented out everything else...
The doubt is: if I create a new pixmap (<pixmap name="NAME">...</pixmap>) in the section <button_pixmap [...]>...</button_pixmap>, the "engine" uses it even if I don't call it?

It seems as if in a C-like code:
int a=3, b=12,c=0;
c=a+5;
...
c equals to 20 (a+b+5), even if I summed only a and 5.

In the config it's more or less the same: I "declared" 2 new pixmaps and used only one composed with a third. Result: it mixes all the three pixmaps.

Be patient, my english sucks and I'm not that good in this kind of things... :)

Revision history for this message
Matias Särs (msevens) said :
#6

Ah, I found the bug. <composite /> overwrites the bg pixmap with the new pixmap. Incredible it hasn't brought any problems before now. I will commit a fix within the next twenty-four hours.

Revision history for this message
Lke (culzluca) said :
#7

Good work! Very nice.
Proud of having helped a little this project, - I think -.
Follow me on deviantArt: Lke=Ellekappae ;)

P.S. In the "Theming HOWTO" there's a copy/paste error, I think everyone can understand it clearly anyway:

"mouse_over"
 Code within <if type="all_minimized"></if> blocks will be read if the mouse cursor
 the group button for which the icon is drawn.

Correct:
"mouse_over"
 Code within <if type="mouse_over"></if> blocks will be read if the mouse cursor
 the group button for which the icon is drawn.