1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Update all get_configuration_warning to retrieve warnings from the parent

This commit is contained in:
ArrowInAKnee
2020-05-14 23:59:27 +03:00
parent 00949f0c5f
commit 9fc2b0fddc
40 changed files with 284 additions and 114 deletions

View File

@@ -520,6 +520,8 @@ void ScrollContainer::set_follow_focus(bool p_follow) {
}
String ScrollContainer::get_configuration_warning() const {
String warning = Container::get_configuration_warning();
int found = 0;
for (int i = 0; i < get_child_count(); i++) {
@@ -538,10 +540,12 @@ String ScrollContainer::get_configuration_warning() const {
}
if (found != 1) {
return TTR("ScrollContainer is intended to work with a single child control.\nUse a container as child (VBox, HBox, etc.), or a Control and set the custom minimum size manually.");
} else {
return "";
if (!warning.empty()) {
warning += "\n\n";
}
warning += TTR("ScrollContainer is intended to work with a single child control.\nUse a container as child (VBox, HBox, etc.), or a Control and set the custom minimum size manually.");
}
return warning;
}
HScrollBar *ScrollContainer::get_h_scrollbar() {