]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/stack.cpp
Add a Stack arrangement
[libs/gltk.git] / source / stack.cpp
diff --git a/source/stack.cpp b/source/stack.cpp
new file mode 100644 (file)
index 0000000..b817a3b
--- /dev/null
@@ -0,0 +1,28 @@
+#include "stack.h"
+
+namespace Msp {
+namespace GLtk {
+
+Stack::Stack(Layout &l):
+       Arrangement(l)
+{ }
+
+void Stack::process_widget(Widget &wdg, Side side, bool aligned)
+{
+       if(edges[side].aligned && aligned)
+               add_constraint(wdg, get_align_constraint(side), side);
+       edges[side].add(wdg, aligned);
+}
+
+void Stack::finish_widget(Widget &wdg)
+{
+       layout.set_ghost(wdg, true);
+}
+
+
+Stack::Loader::Loader(Stack &s):
+       DataFile::ObjectLoader<Stack>(s)
+{ }
+
+} // namespace GLtk
+} // namespace Msp