X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flayout.cpp;h=bfe46c47f8b1dcd683238532bdd0fc7497185879;hb=815194201203afd6fa59e650e1007a355c829544;hp=d5437f0b0a29ed04c1ce000534174fd0d9b9fa12;hpb=1c64ca20b4d1d8ff0772cee0ead0ffae249cb336;p=libs%2Fgltk.git diff --git a/source/layout.cpp b/source/layout.cpp index d5437f0..bfe46c4 100644 --- a/source/layout.cpp +++ b/source/layout.cpp @@ -304,6 +304,16 @@ void Layout::solve_constraints(int dir, SolveMode mode) row.back() = geom.*(ptrs.dim)-margin.*(ptrs.high_margin); } + if(((*i)->*(ptrs.packing)).gravity==0) + { + /* This forces the widget's distance from the left and right edge of + the container to be equal. It's a bit of a hack, but more time and + thought is needed for a better solution. */ + LinearProgram::Row row = linprog.add_row(); + row[(*i)->index*5+2] = 1; + row[(*i)->index*5+3] = -1; + } + { /* Only allow the widget's dimension to increase. The geometry has previously been set to the smallest allowable size. */