1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-28 16:07:14 +00:00

Reorganize inspector layout workflow for Control nodes

This commit is contained in:
Yuri Sizov
2021-11-08 23:53:41 +03:00
parent 242c636a63
commit 107b6f299c
43 changed files with 2118 additions and 550 deletions

View File

@@ -143,6 +143,34 @@ void Container::queue_sort() {
pending_sort = true;
}
Vector<int> Container::get_allowed_size_flags_horizontal() const {
Vector<int> flags;
if (GDVIRTUAL_CALL(_get_allowed_size_flags_horizontal, flags)) {
return flags;
}
flags.append(SIZE_FILL);
flags.append(SIZE_EXPAND);
flags.append(SIZE_SHRINK_BEGIN);
flags.append(SIZE_SHRINK_CENTER);
flags.append(SIZE_SHRINK_END);
return flags;
}
Vector<int> Container::get_allowed_size_flags_vertical() const {
Vector<int> flags;
if (GDVIRTUAL_CALL(_get_allowed_size_flags_vertical, flags)) {
return flags;
}
flags.append(SIZE_FILL);
flags.append(SIZE_EXPAND);
flags.append(SIZE_SHRINK_BEGIN);
flags.append(SIZE_SHRINK_CENTER);
flags.append(SIZE_SHRINK_END);
return flags;
}
void Container::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
@@ -177,6 +205,9 @@ void Container::_bind_methods() {
ClassDB::bind_method(D_METHOD("queue_sort"), &Container::queue_sort);
ClassDB::bind_method(D_METHOD("fit_child_in_rect", "child", "rect"), &Container::fit_child_in_rect);
GDVIRTUAL_BIND(_get_allowed_size_flags_horizontal);
GDVIRTUAL_BIND(_get_allowed_size_flags_vertical);
BIND_CONSTANT(NOTIFICATION_PRE_SORT_CHILDREN);
BIND_CONSTANT(NOTIFICATION_SORT_CHILDREN);