summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-10-11 22:42:16 +0200
committerGitHub <noreply@github.com>2017-10-11 22:42:16 +0200
commit0e8f0da2fd00379cda1ad8a15d243b560b7c348d (patch)
treed415d78d4d6c43b0da925591f7b3bbb7ac642e58
parent3e681227ab851bde466457f9d4ff6e800b7ef51a (diff)
parent21c2bf84e6e03bade272098d563cfd915aba0cf8 (diff)
Merge pull request #12017 from jagt/fix_clear_recent_scripts_crash
fix script editor clear recent scripts crash
-rw-r--r--editor/plugins/script_editor_plugin.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 477d440f28..d56756502d 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -467,6 +467,8 @@ void ScriptEditor::_update_recent_scripts() {
recent_scripts->add_separator();
recent_scripts->add_shortcut(ED_SHORTCUT("script_editor/clear_recent", TTR("Clear Recent Files")));
+
+ recent_scripts->set_as_minsize();
}
void ScriptEditor::_open_recent_script(int p_idx) {
@@ -474,7 +476,7 @@ void ScriptEditor::_open_recent_script(int p_idx) {
// clear button
if (p_idx == recent_scripts->get_item_count() - 1) {
previous_scripts.clear();
- _update_recent_scripts();
+ call_deferred("_update_recent_scripts");
return;
}
@@ -2240,6 +2242,7 @@ void ScriptEditor::_bind_methods() {
ClassDB::bind_method("_live_auto_reload_running_scripts", &ScriptEditor::_live_auto_reload_running_scripts);
ClassDB::bind_method("_unhandled_input", &ScriptEditor::_unhandled_input);
ClassDB::bind_method("_script_changed", &ScriptEditor::_script_changed);
+ ClassDB::bind_method("_update_recent_scripts", &ScriptEditor::_update_recent_scripts);
ClassDB::bind_method(D_METHOD("get_current_script"), &ScriptEditor::_get_current_script);
ClassDB::bind_method(D_METHOD("get_open_scripts"), &ScriptEditor::_get_open_scripts);