]> git.tdb.fi Git - libs/gltk.git/blob - source/column.cpp
5b86660dd21d56f1c4a174b96cbf229ebeb0607f
[libs/gltk.git] / source / column.cpp
1 #include "column.h"
2
3 namespace Msp {
4 namespace GLtk {
5
6 Column::Column(bool u):
7         uniform(u)
8 { }
9
10 Layout::Slot *Column::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(BELOW, prev));
18                 slot->constraints.push_back(Constraint(ALIGN_LEFT, prev));
19                 slot->constraints.push_back(Constraint(ALIGN_RIGHT, prev));
20                 if(uniform)
21                         slot->constraints.push_back(Constraint(COPY_HEIGHT, prev));
22                 slot->horiz_pack.expand = true;
23         }
24
25         return slot;
26 }
27
28 } // namespace GLtk
29 } // namespace Msp