+ if(part.get_name()=="items")
+ {
+ const Sides &margin = part.get_margin();
+
+ unsigned items_w = 0;
+ unsigned items_h = 0;
+ for(unsigned i=0; i<items.size(); ++i)
+ {
+ Geometry igeom;
+ items[i]->autosize(igeom);
+ items_w = max(items_w, igeom.w);
+ items_h = max(items_h, igeom.h);
+ }
+
+ if(view_mode==GRID)
+ {
+ unsigned r = view_rows;
+ unsigned c = view_columns;
+ if(r==0 && c==0)
+ r = sqrt(items.size());
+ if(r==0)
+ r = (items.size()+c-1)/c;
+ if(c==0)
+ c = (items.size()+r-1)/r;
+ items_w *= c;
+ items_h *= r;
+ }
+ else
+ items_h *= (view_rows==0 ? items.size() : view_rows);
+
+ ageom.w = max(ageom.w, items_w+margin.left+margin.right);
+ ageom.h = max(ageom.h, items_h+margin.top+margin.bottom);
+ }
+ else if(part.get_name()=="slider")
+ autosize_child(slider, part, ageom);