]> Dogcows Code - chaz/openbox/commitdiff
get the size for all the apps before positioning them
authorDana Jansens <danakj@orodu.net>
Mon, 19 May 2003 20:27:11 +0000 (20:27 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 19 May 2003 20:27:11 +0000 (20:27 +0000)
openbox/dock.c

index 8e4d0efc8dc3f1dd6f86bef7e7f9ee84f0bccd31..934d3d03bcd8072390b4bb587a2c153df06b5ad4 100644 (file)
@@ -152,17 +152,26 @@ void dock_configure()
 
     dock->w = dock->h = spot = 0;
 
+    /* get the size */
     for (it = dock->dock_apps; it; it = it->next) {
         struct DockApp *app = it->data;
         if (config_dock_horz) {
             dock->w += app->w;
             dock->h = MAX(dock->h, app->h);
+        } else {
+            dock->w = MAX(dock->w, app->w);
+            dock->h += app->h;
+        }
+    }
+
+    /* position the apps */
+    for (it = dock->dock_apps; it; it = it->next) {
+        struct DockApp *app = it->data;
+        if (config_dock_horz) {
             app->x = spot;
             app->y = (dock->h - app->h) / 2;
             spot += app->w;
         } else {
-            dock->w = MAX(dock->w, app->w);
-            dock->h += app->h;
             app->x = (dock->w - app->w) / 2;
             app->y = spot;
             spot += app->h;
This page took 0.023218 seconds and 4 git commands to generate.