]> Dogcows Code - chaz/tint2/blobdiff - src/util/area.c
panel_items : fixed SINGLE_DESKTOP mode
[chaz/tint2] / src / util / area.c
index 460abd94e0f7ffc258c981f14ee2c317eefa2519..62417fe30242f7b3fd278b32f472e19136b450e9 100644 (file)
@@ -133,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.019817 seconds and 4 git commands to generate.