diff options
author | kobewi <kobewi4e@gmail.com> | 2022-08-22 13:08:57 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2022-09-01 22:13:46 +0200 |
commit | 73929bef735c1bcf38b8db71426461ea00f61852 (patch) | |
tree | 67a1dfb441d40c373011a3beda23f56cd3491e2f /scene/gui/box_container.h | |
parent | 8c7be63588bf3e4ef4b780ff57936c68db5939c7 (diff) |
Rework oriented containers
Diffstat (limited to 'scene/gui/box_container.h')
-rw-r--r-- | scene/gui/box_container.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scene/gui/box_container.h b/scene/gui/box_container.h index 55dfb2ada7..0ee5bd1772 100644 --- a/scene/gui/box_container.h +++ b/scene/gui/box_container.h @@ -54,9 +54,12 @@ private: void _resort(); protected: + bool is_fixed = false; + virtual void _update_theme_item_cache() override; void _notification(int p_what); + void _validate_property(PropertyInfo &p_property) const; static void _bind_methods(); public: @@ -65,6 +68,9 @@ public: void set_alignment(AlignmentMode p_alignment); AlignmentMode get_alignment() const; + void set_vertical(bool p_vertical); + bool is_vertical() const; + virtual Size2 get_minimum_size() const override; virtual Vector<int> get_allowed_size_flags_horizontal() const override; @@ -78,7 +84,7 @@ class HBoxContainer : public BoxContainer { public: HBoxContainer() : - BoxContainer(false) {} + BoxContainer(false) { is_fixed = true; } }; class MarginContainer; @@ -89,7 +95,7 @@ public: MarginContainer *add_margin_child(const String &p_label, Control *p_control, bool p_expand = false); VBoxContainer() : - BoxContainer(true) {} + BoxContainer(true) { is_fixed = true; } }; VARIANT_ENUM_CAST(BoxContainer::AlignmentMode); |