X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Frow.cpp;h=0188f4a663c4dec2a75e71abadd285fab640759e;hb=32539688068fad9614291159b069da10ead10f47;hp=8eb6bd4ac70444679b65cb843427c505a841ca36;hpb=43a75e4e9be56c58be5e224f19016bb14b56a7ef;p=libs%2Fgltk.git diff --git a/source/row.cpp b/source/row.cpp index 8eb6bd4..0188f4a 100644 --- a/source/row.cpp +++ b/source/row.cpp @@ -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