]> Dogcows Code - chaz/tint2/commitdiff
panel_items : fixed vertical panel
authorThierry Lorthiois <lorthiois@bbsoft.fr>
Sun, 19 Sep 2010 10:01:06 +0000 (10:01 +0000)
committerThierry Lorthiois <lorthiois@bbsoft.fr>
Sun, 19 Sep 2010 10:01:06 +0000 (10:01 +0000)
src/util/area.c

index 801e185776aad83d04c8e219eddbfcb6ffb71c32..d68f4d7865a8e61de6ae7a36da9b03ec64a6a2c1 100644 (file)
@@ -135,16 +135,28 @@ void size_by_layout (Area *a, int pos, int level)
                Area *child = ((Area*)l->data);
                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);
+               //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.027828 seconds and 4 git commands to generate.