Merge pull request #89974 from jsjtxietian/tab-close

Reset `tab_closing_menu_option` when cancelling closing editor
This commit is contained in:
Rémi Verschelde 2024-04-04 14:35:41 +02:00
commit 89109e8b01
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 8 additions and 0 deletions

View file

@ -5280,6 +5280,12 @@ void EditorNode::_scene_tab_closed(int p_tab) {
scene_tabs->update_scene_tabs();
}
void EditorNode::_cancel_close_scene_tab() {
if (_is_closing_editor()) {
tab_closing_menu_option = -1;
}
}
void EditorNode::_toggle_distraction_free_mode() {
if (EDITOR_GET("interface/editor/separate_distraction_mode")) {
int screen = -1;
@ -7073,6 +7079,7 @@ EditorNode::EditorNode() {
save_confirmation->set_min_size(Vector2(450.0 * EDSCALE, 0));
save_confirmation->connect("confirmed", callable_mp(this, &EditorNode::_menu_confirm_current));
save_confirmation->connect("custom_action", callable_mp(this, &EditorNode::_discard_changes));
save_confirmation->connect("canceled", callable_mp(this, &EditorNode::_cancel_close_scene_tab));
gradle_build_manage_templates = memnew(ConfirmationDialog);
gradle_build_manage_templates->set_text(TTR("Android build template is missing, please install relevant templates."));

View file

@ -570,6 +570,7 @@ private:
int _next_unsaved_scene(bool p_valid_filename, int p_start = 0);
void _discard_changes(const String &p_str = String());
void _scene_tab_closed(int p_tab);
void _cancel_close_scene_tab();
void _inherit_request(String p_file);
void _instantiate_request(const Vector<String> &p_files);