summaryrefslogtreecommitdiff
path: root/scene/gui/box_container.h
diff options
context:
space:
mode:
authorZher Huei Lee <lee.zh.92@gmail.com>2015-09-24 14:04:15 +0100
committerZher Huei Lee <lee.zh.92@gmail.com>2015-09-24 14:07:53 +0100
commitc38808b5b1b838c075ded22c490a37dfef3b0ce9 (patch)
tree2108669868e923c352c9e8460eba77bd7721cad4 /scene/gui/box_container.h
parent20a1c765db5ecb8c2020ce6dea1de1fda706ee1f (diff)
added alignment to BoxContainer
Allows aligning contents of VBoxContainer and HBoxcontainer without having to insert expanding spacers.
Diffstat (limited to 'scene/gui/box_container.h')
-rw-r--r--scene/gui/box_container.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/scene/gui/box_container.h b/scene/gui/box_container.h
index d461b4aebe..c357814baf 100644
--- a/scene/gui/box_container.h
+++ b/scene/gui/box_container.h
@@ -35,16 +35,31 @@ class BoxContainer : public Container {
OBJ_TYPE(BoxContainer,Container);
+public:
+
+ enum AlignMode {
+ ALIGN_BEGIN,
+ ALIGN_CENTER,
+ ALIGN_END
+ };
+
+private:
bool vertical;
+ AlignMode align;
void _resort();
protected:
void _notification(int p_what);
+
+ static void _bind_methods();
public:
void add_spacer(bool p_begin=false);
+ void set_alignment(AlignMode p_align);
+ AlignMode get_alignment() const;
+
virtual Size2 get_minimum_size() const;
BoxContainer(bool p_vertical=false);
@@ -73,4 +88,6 @@ public:
VBoxContainer() : BoxContainer(true) {}
};
+VARIANT_ENUM_CAST(BoxContainer::AlignMode);
+
#endif // BOX_CONTAINER_H