]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/row.cpp
Combine common parts of Column and Row into LinearArrangement
[libs/gltk.git] / source / row.cpp
index 30e181188a44090d39d67abf828dae8efa1509ec..0188f4a663c4dec2a75e71abadd285fab640759e 100644 (file)
@@ -3,26 +3,13 @@
 namespace Msp {
 namespace GLtk {
 
-Row::Row(bool u):
-       uniform(u)
+Row::Row(Layout &l):
+       LinearArrangement(l, RIGHT)
 { }
 
-Layout::Slot *Row::create_slot(Widget &w)
+void Row::finish_widget(Widget &wdg)
 {
-       Slot *slot = new Slot(*this, w);
-
-       if(!slots.empty())
-       {
-               Slot &prev = *slots.back();
-               slot->constraints.push_back(Constraint(RIGHT_OF, prev));
-               slot->constraints.push_back(Constraint(ALIGN_TOP, prev));
-               slot->constraints.push_back(Constraint(ALIGN_BOTTOM, prev));
-               if(uniform)
-                       slot->constraints.push_back(Constraint(COPY_WIDTH, prev));
-               slot->vert_pack.expand = true;
-       }
-
-       return slot;
+       layout.set_gravity(wdg, (gravity==LEFT ? -1 : 1), 1);
 }
 
 } // namespace GLtk