]> git.tdb.fi Git - libs/gltk.git/blob - source/row.cpp
8eb6bd4ac70444679b65cb843427c505a841ca36
[libs/gltk.git] / source / row.cpp
1 #include "row.h"
2
3 namespace Msp {
4 namespace GLtk {
5
6 Row::Row(bool u):
7         uniform(u)
8 { }
9
10 Layout::Slot *Row::create_slot(Widget &w)
11 {
12         Slot *slot = new Slot(*this, w);
13
14         if(!slots.empty())
15         {
16                 Slot &prev = *slots.back();
17                 slot->constraints.push_back(Constraint(RIGHT_OF, prev));
18                 slot->constraints.push_back(Constraint(ALIGN_TOP, prev));
19                 slot->constraints.push_back(Constraint(ALIGN_BOTTOM, prev));
20                 if(uniform)
21                         slot->constraints.push_back(Constraint(COPY_WIDTH, prev));
22         }
23         slot->vert_pack.expand = true;
24
25         return slot;
26 }
27
28 } // namespace GLtk
29 } // namespace Msp