X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flayout.cpp;h=5ebb55ccf4f8822de2423427d4c795c8d906ecf8;hb=fea22d7bdfae9e2cb70a6c0c1a3f85da531e2de2;hp=743b30ebf3263b7246659191aeca349906623513;hpb=72db2a8d41cc0eb8404572d1a720d59fab0551cd;p=libs%2Fgltk.git diff --git a/source/layout.cpp b/source/layout.cpp index 743b30e..5ebb55c 100644 --- a/source/layout.cpp +++ b/source/layout.cpp @@ -317,12 +317,13 @@ void Layout::update() (*i)->widget.set_geometry((*i)->geom); } -void Layout::autosize() +void Layout::autosize(Geometry &geom) { solve_constraints(HORIZONTAL, AUTOSIZE); solve_constraints(VERTICAL, AUTOSIZE); - container->set_size(autosize_geom.w, autosize_geom.h); + geom.w = max(geom.w, autosize_geom.w); + geom.h = max(geom.h, autosize_geom.h); } void Layout::solve_constraints(int dir, SolveMode mode) @@ -339,6 +340,7 @@ void Layout::solve_constraints(int dir, SolveMode mode) remaining three are slack columns; see below for their purposes. */ LinearProgram linprog(n_active_slots*5+n_slack_constraints[dir]+1); float weight = slots.size(); + unsigned k = n_active_slots*5; for(list::iterator i=slots.begin(); i!=slots.end(); ++i) { if((*i)->index<0) @@ -395,7 +397,6 @@ void Layout::solve_constraints(int dir, SolveMode mode) /* Add rows for user-defined constraints. Constraints are always added in pairs, so it's only necessary to create a row for one half. */ - unsigned k = n_active_slots*5; for(list::iterator j=(*i)->constraints.begin(); j!=(*i)->constraints.end(); ++j) if(j->target.index>(*i)->index && (j->type&1)==dir) {