+ set_geometry(Geometry(geom.x, geom.y, w, h));
+}
+
+void Widget::autosize()
+{
+ if(!style)
+ return;
+
+ geom.w = 0;
+ geom.h = 0;
+ const Style::PartSeq &parts = style->get_parts();
+ for(Style::PartSeq::const_iterator i=parts.begin(); i!=parts.end(); ++i)
+ if(i->get_name().empty())
+ {
+ const Geometry &pgeom = i->get_geometry();
+ const Sides &pmargin = i->get_margin();
+ geom.w = max(geom.w, pgeom.w+pmargin.left+pmargin.right);
+ geom.h = max(geom.h, pgeom.h+pmargin.top+pmargin.bottom);
+ }