]> Dogcows Code - chaz/tint2/blobdiff - src/util/area.c
panel_items : fixed SINGLE_DESKTOP mode
[chaz/tint2] / src / util / area.c
index ce122a2178d5f31de655c074da6aa6f380d1d0ea..62417fe30242f7b3fd278b32f472e19136b450e9 100644 (file)
  * 'panel_items = SC' define a panel with just Systray and Clock.
  * So the tree 'Panel.Area' will have 2 childs (Systray and Clock).
  *
- * 1) ok
- * 2) ??
- * 3) ??
- * répartition entre niveau global et niveau local ??
- *   size_by_content peut-il modifier redraw=1 en cas de changement ? ou est ce géré par chaque composant ?
- *   size_by_layout peut-il modifier redraw ?
- *
  ************************************************************/
 
 void rendering(void *obj)
@@ -140,18 +133,31 @@ void size_by_layout (Area *a, int pos, int level)
        int i=0;
        for (l = a->list; l ; l = l->next) {
                Area *child = ((Area*)l->data);
+               if (!child->on_screen) continue;
                i++;
                
-               if (pos != child->posx) {
-                       // pos changed => redraw
-                       child->posx = pos;
-                       child->redraw = 1;
+               if (panel_horizontal) {
+                       if (pos != child->posx) {
+                               // pos changed => redraw
+                               child->posx = pos;
+                               child->redraw = 1;
+                       }
+               }
+               else {
+                       if (pos != child->posy) {
+                               // pos changed => redraw
+                               child->posy = pos;
+                               child->redraw = 1;
+                       }
                }
                //printf("level %d, object %d, pos %d\n", level, i, pos);
                
                size_by_layout(child, pos, level+1);
                
-               pos += child->width + a->paddingx;
+               if (panel_horizontal)
+                       pos += child->width + a->paddingx;
+               else
+                       pos += child->height + a->paddingx;
        }
 }
 
This page took 0.023978 seconds and 4 git commands to generate.