mirror of
https://github.com/godotengine/godot.git
synced 2024-11-25 05:33:11 +00:00
Fix container minimum size with hidden parent
This commit is contained in:
parent
ec02d406ca
commit
a9c91f4eef
@ -35,7 +35,7 @@
|
||||
Size2 AspectRatioContainer::get_minimum_size() const {
|
||||
Size2 ms;
|
||||
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) {
|
||||
continue;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ Size2 CenterContainer::get_minimum_size() const {
|
||||
}
|
||||
Size2 ms;
|
||||
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) {
|
||||
continue;
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ Size2 FlowContainer::get_minimum_size() const {
|
||||
Size2i minimum;
|
||||
|
||||
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) {
|
||||
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;
|
||||
|
||||
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) {
|
||||
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;
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (!_get_sortable_child(i)) {
|
||||
Control *child = _get_sortable_child(i, SortableVisbilityMode::VISIBLE);
|
||||
if (!child) {
|
||||
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) {
|
||||
minimum.height += ms.height;
|
||||
|
@ -82,7 +82,7 @@ private:
|
||||
Ref<Texture2D> _get_grabber_icon() const;
|
||||
void _compute_middle_sep(bool p_clamp);
|
||||
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:
|
||||
bool is_fixed = false;
|
||||
|
Loading…
Reference in New Issue
Block a user