From c92b1b8ebad0f19491d3a067e99aadae66335114 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 9 Jun 2013 18:07:09 +0300 Subject: [PATCH] Consider part margins when autosizing --- source/widget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); } } -- 2.43.0