summaryrefslogtreecommitdiff
path: root/scene/gui/box_container.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/box_container.cpp')
-rw-r--r--scene/gui/box_container.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/scene/gui/box_container.cpp b/scene/gui/box_container.cpp
index 0da6e0fdfa..5252f3f2f2 100644
--- a/scene/gui/box_container.cpp
+++ b/scene/gui/box_container.cpp
@@ -33,14 +33,12 @@
#include "margin_container.h"
struct _MinSizeCache {
-
int min_size;
bool will_stretch;
int final_size;
};
void BoxContainer::_resort() {
-
/** First pass, determine minimum size AND amount of stretchable elements */
Size2i new_size = get_size();
@@ -105,7 +103,6 @@ void BoxContainer::_resort() {
bool refit_successful = true; //assume refit-test will go well
for (int i = 0; i < get_child_count(); i++) {
-
Control *c = Object::cast_to<Control>(get_child(i));
if (!c || !c->is_visible_in_tree())
continue;
@@ -158,7 +155,6 @@ void BoxContainer::_resort() {
int idx = 0;
for (int i = 0; i < get_child_count(); i++) {
-
Control *c = Object::cast_to<Control>(get_child(i));
if (!c || !c->is_visible_in_tree())
continue;
@@ -187,10 +183,8 @@ void BoxContainer::_resort() {
Rect2 rect;
if (vertical) {
-
rect = Rect2(0, from, new_size.width, size);
} else {
-
rect = Rect2(from, 0, size, new_size.height);
}
@@ -202,7 +196,6 @@ void BoxContainer::_resort() {
}
Size2 BoxContainer::get_minimum_size() const {
-
/* Calculate MINIMUM SIZE */
Size2i minimum;
@@ -247,15 +240,11 @@ Size2 BoxContainer::get_minimum_size() const {
}
void BoxContainer::_notification(int p_what) {
-
switch (p_what) {
-
case NOTIFICATION_SORT_CHILDREN: {
-
_resort();
} break;
case NOTIFICATION_THEME_CHANGED: {
-
minimum_size_changed();
} break;
}
@@ -271,7 +260,6 @@ BoxContainer::AlignMode BoxContainer::get_alignment() const {
}
void BoxContainer::add_spacer(bool p_begin) {
-
Control *c = memnew(Control);
c->set_mouse_filter(MOUSE_FILTER_PASS); //allow spacer to pass mouse events
@@ -286,13 +274,11 @@ void BoxContainer::add_spacer(bool p_begin) {
}
BoxContainer::BoxContainer(bool p_vertical) {
-
vertical = p_vertical;
align = ALIGN_BEGIN;
}
void BoxContainer::_bind_methods() {
-
ClassDB::bind_method(D_METHOD("add_spacer", "begin"), &BoxContainer::add_spacer);
ClassDB::bind_method(D_METHOD("get_alignment"), &BoxContainer::get_alignment);
ClassDB::bind_method(D_METHOD("set_alignment", "alignment"), &BoxContainer::set_alignment);
@@ -305,7 +291,6 @@ void BoxContainer::_bind_methods() {
}
MarginContainer *VBoxContainer::add_margin_child(const String &p_label, Control *p_control, bool p_expand) {
-
Label *l = memnew(Label);
l->set_text(p_label);
add_child(l);