Updates containers minimum size when some constants are modified
This commit is contained in:
parent
7fa41f17a6
commit
a1f955a1d3
@ -255,6 +255,10 @@ void BoxContainer::_notification(int p_what) {
|
||||
|
||||
_resort();
|
||||
} break;
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
|
||||
minimum_size_changed();
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,8 @@ bool GraphNode::has_point(const Point2 &p_point) const {
|
||||
|
||||
void GraphNode::_notification(int p_what) {
|
||||
|
||||
if (p_what == NOTIFICATION_DRAW) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_DRAW: {
|
||||
|
||||
Ref<StyleBox> sb;
|
||||
|
||||
@ -278,11 +279,17 @@ void GraphNode::_notification(int p_what) {
|
||||
if (resizable) {
|
||||
draw_texture(resizer, get_size() - resizer->get_size());
|
||||
}
|
||||
}
|
||||
} break;
|
||||
|
||||
if (p_what == NOTIFICATION_SORT_CHILDREN) {
|
||||
case NOTIFICATION_SORT_CHILDREN: {
|
||||
|
||||
_resort();
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
|
||||
minimum_size_changed();
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,6 +164,10 @@ void GridContainer::_notification(int p_what) {
|
||||
}
|
||||
|
||||
} break;
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
|
||||
minimum_size_changed();
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,8 @@ Size2 MarginContainer::get_minimum_size() const {
|
||||
|
||||
void MarginContainer::_notification(int p_what) {
|
||||
|
||||
if (p_what == NOTIFICATION_SORT_CHILDREN) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_SORT_CHILDREN: {
|
||||
|
||||
int margin_left = get_constant("margin_left");
|
||||
int margin_top = get_constant("margin_top");
|
||||
@ -85,6 +86,11 @@ void MarginContainer::_notification(int p_what) {
|
||||
int h = s.height - margin_top - margin_bottom;
|
||||
fit_child_in_rect(c, Rect2(margin_left, margin_top, w, h));
|
||||
}
|
||||
} break;
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
|
||||
minimum_size_changed();
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -193,6 +193,10 @@ void SplitContainer::_notification(int p_what) {
|
||||
draw_texture(tex, Point2i(middle_sep + (sep - tex->get_width()) / 2, (size.y - tex->get_height()) / 2));
|
||||
}
|
||||
} break;
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
|
||||
minimum_size_changed();
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -338,6 +338,7 @@ void TabContainer::_notification(int p_what) {
|
||||
}
|
||||
} break;
|
||||
case NOTIFICATION_THEME_CHANGED: {
|
||||
minimum_size_changed();
|
||||
call_deferred("_on_theme_changed"); //wait until all changed theme
|
||||
} break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user