]> Dogcows Code - chaz/tint2/blobdiff - src/util/area.c
cleanup duplicate code and fixed ALLDESKTOP task
[chaz/tint2] / src / util / area.c
index f98e1613e06088954fdbbd52e1618d80c759366a..9b70b1210f54d44c8e43fe3d739ce4b5f91707ee 100644 (file)
@@ -221,7 +221,7 @@ void refresh (Area *a)
 }
 
 
-int resize_by_layout(void *obj)
+int resize_by_layout(void *obj, int maximum_size)
 {
        Area *child, *a = (Area*)obj;
        int size, nb_by_content=0, nb_by_layout=0;
@@ -247,6 +247,10 @@ int resize_by_layout(void *obj)
                if (nb_by_layout) {
                        width = size / nb_by_layout;
                        modulo = size % nb_by_layout;
+                       if (width > maximum_size && maximum_size != 0) {
+                               width = maximum_size;
+                               modulo = 0;
+                       }
                }
 
                // resize SIZE_BY_LAYOUT objects
@@ -284,6 +288,10 @@ int resize_by_layout(void *obj)
                if (nb_by_layout) {
                        height = size / nb_by_layout;
                        modulo = size % nb_by_layout;
+                       if (height > maximum_size && maximum_size != 0) {
+                               height = maximum_size;
+                               modulo = 0;
+                       }
                }
 
                // resize SIZE_BY_LAYOUT objects
This page took 0.017329 seconds and 4 git commands to generate.