From: Mikko Rasa Date: Sun, 9 Jun 2013 15:07:09 +0000 (+0300) Subject: Consider part margins when autosizing X-Git-Url: http://git.tdb.fi/?p=libs%2Fgltk.git;a=commitdiff_plain;h=c92b1b8ebad0f19491d3a067e99aadae66335114 Consider part margins when autosizing --- diff --git a/source/widget.cpp b/source/widget.cpp index e73e5cf..1113c97 100644 --- a/source/widget.cpp +++ b/source/widget.cpp @@ -46,8 +46,10 @@ void Widget::autosize() for(Style::PartSeq::const_iterator i=parts.begin(); i!=parts.end(); ++i) if(i->get_name().empty()) { - geom.w = max(geom.w, i->get_geometry().w); - geom.h = max(geom.h, i->get_geometry().h); + 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); } }