X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flineararrangement.cpp;h=7769db2d64e47af8384237cc4b1eff8e80f6fc21;hb=a4d18206b6352b3240ad9697aed10e2066d160bd;hp=9e6441afaa8c72a3cdad8720f56ca0103186b20d;hpb=fef09a8d2fe38dcc8fd3beff3e132f945a4d4c8a;p=libs%2Fgltk.git diff --git a/source/lineararrangement.cpp b/source/lineararrangement.cpp index 9e6441a..7769db2 100644 --- a/source/lineararrangement.cpp +++ b/source/lineararrangement.cpp @@ -29,7 +29,7 @@ void LinearArrangement::expand() throw arrangement_error("no widgets"); add_constraint(*edges[primary].widgets.front(), get_align_constraint(primary), primary); - layout.set_expand(*edges[primary].widgets.front(), false, true); + layout.set_expand(*edges[primary].widgets.front(), (primary==LEFT || primary==RIGHT), (primary==TOP || primary==BOTTOM)); edges[primary].align(); gravity = primary; } @@ -38,13 +38,13 @@ void LinearArrangement::process_widget(Widget &wdg, Side side, bool aligned) { if(side==opposite) { - bool snug = (edges[primary].aligned && aligned && !split_here); + bool snug = (internal_aligned && aligned && !split_here); add_constraint(wdg, get_order_constraint(primary, !snug), primary); if(first) - edges[side].add(wdg, aligned); + edges[side].add(wdg, (aligned && gravity==opposite)); } else if(side==primary) - next.add(wdg, (aligned && gravity==primary)); + next.add(wdg, aligned); else { if(edges[side].aligned && aligned) @@ -55,6 +55,9 @@ void LinearArrangement::process_widget(Widget &wdg, Side side, bool aligned) void LinearArrangement::finish_slot() { + internal_aligned = next.aligned; + if(gravity!=primary) + next.aligned = false; edges[primary] = next; next.clear(); split_here = false;