You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-24 15:26:15 +00:00
Fix container minimum size with hidden parent
This commit is contained in:
@@ -35,7 +35,7 @@
|
|||||||
Size2 AspectRatioContainer::get_minimum_size() const {
|
Size2 AspectRatioContainer::get_minimum_size() const {
|
||||||
Size2 ms;
|
Size2 ms;
|
||||||
for (int i = 0; i < get_child_count(); i++) {
|
for (int i = 0; i < get_child_count(); i++) {
|
||||||
Control *c = as_sortable_control(get_child(i));
|
Control *c = as_sortable_control(get_child(i), SortableVisbilityMode::VISIBLE);
|
||||||
if (!c) {
|
if (!c) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ Size2 CenterContainer::get_minimum_size() const {
|
|||||||
}
|
}
|
||||||
Size2 ms;
|
Size2 ms;
|
||||||
for (int i = 0; i < get_child_count(); i++) {
|
for (int i = 0; i < get_child_count(); i++) {
|
||||||
Control *c = as_sortable_control(get_child(i));
|
Control *c = as_sortable_control(get_child(i), SortableVisbilityMode::VISIBLE);
|
||||||
if (!c) {
|
if (!c) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ Size2 FlowContainer::get_minimum_size() const {
|
|||||||
Size2i minimum;
|
Size2i minimum;
|
||||||
|
|
||||||
for (int i = 0; i < get_child_count(); i++) {
|
for (int i = 0; i < get_child_count(); i++) {
|
||||||
Control *c = as_sortable_control(get_child(i));
|
Control *c = as_sortable_control(get_child(i), SortableVisbilityMode::VISIBLE);
|
||||||
if (!c) {
|
if (!c) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,11 +122,11 @@ void SplitContainerDragger::_notification(int p_what) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Control *SplitContainer::_get_sortable_child(int p_idx) const {
|
Control *SplitContainer::_get_sortable_child(int p_idx, SortableVisbilityMode p_visibility_mode) const {
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
|
||||||
for (int i = 0; i < get_child_count(false); i++) {
|
for (int i = 0; i < get_child_count(false); i++) {
|
||||||
Control *c = as_sortable_control(get_child(i, false));
|
Control *c = as_sortable_control(get_child(i, false), p_visibility_mode);
|
||||||
if (!c) {
|
if (!c) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -258,7 +258,8 @@ Size2 SplitContainer::get_minimum_size() const {
|
|||||||
int sep = (dragger_visibility != DRAGGER_HIDDEN_COLLAPSED) ? MAX(theme_cache.separation, vertical ? g->get_height() : g->get_width()) : 0;
|
int sep = (dragger_visibility != DRAGGER_HIDDEN_COLLAPSED) ? MAX(theme_cache.separation, vertical ? g->get_height() : g->get_width()) : 0;
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
if (!_get_sortable_child(i)) {
|
Control *child = _get_sortable_child(i, SortableVisbilityMode::VISIBLE);
|
||||||
|
if (!child) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,7 +271,7 @@ Size2 SplitContainer::get_minimum_size() const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Size2 ms = _get_sortable_child(i)->get_combined_minimum_size();
|
Size2 ms = child->get_combined_minimum_size();
|
||||||
|
|
||||||
if (vertical) {
|
if (vertical) {
|
||||||
minimum.height += ms.height;
|
minimum.height += ms.height;
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ private:
|
|||||||
Ref<Texture2D> _get_grabber_icon() const;
|
Ref<Texture2D> _get_grabber_icon() const;
|
||||||
void _compute_middle_sep(bool p_clamp);
|
void _compute_middle_sep(bool p_clamp);
|
||||||
void _resort();
|
void _resort();
|
||||||
Control *_get_sortable_child(int p_idx) const;
|
Control *_get_sortable_child(int p_idx, SortableVisbilityMode p_visibility_mode = SortableVisbilityMode::VISIBLE_IN_TREE) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool is_fixed = false;
|
bool is_fixed = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user