]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/mixedrows.cpp
Add constraint types that allow flexible spacing between widgets
[libs/gltk.git] / source / mixedrows.cpp
index 275629d940d794f657af5adb851cc0f258303291..763702057c65429e8114ff6643520622923612d3 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspgltk
-Copyright © 2011  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include "mixedrows.h"
 
 namespace Msp {
@@ -50,8 +43,7 @@ Layout::Slot *MixedRows::create_slot(Widget &wdg)
        if(!first)
        {
                Slot *prev = slots.back();
-               if(!hsplit)
-                       slot->constraints.push_back(Constraint(RIGHT_OF, *prev));
+               slot->constraints.push_back(Constraint((hsplit ? FAR_RIGHT_OF : RIGHT_OF), *prev));
                slot->constraints.push_back(Constraint(ALIGN_TOP, *prev));
                slot->constraints.push_back(Constraint(ALIGN_BOTTOM, *prev));
                if(uniform_cols)
@@ -60,8 +52,7 @@ Layout::Slot *MixedRows::create_slot(Widget &wdg)
        else if(!slots.empty())
        {
                Slot *prev = slots.back();
-               if(!vsplit)
-                       slot->constraints.push_back(Constraint(BELOW, *prev));
+               slot->constraints.push_back(Constraint((vsplit ? FAR_BELOW : BELOW), *prev));
                if(uniform_rows)
                        slot->constraints.push_back(Constraint(COPY_HEIGHT, *prev));
        }