From 28818171d47eb3513142acb95ff24f16679d4e64 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Wed, 17 Jun 2020 02:58:24 +0300 Subject: [PATCH] Call Global.dialog_open when a PreviewDialog pops up/gets hidden --- src/Autoload/OpenSave.gd | 1 + src/UI/Dialogs/PreviewDialog.gd | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/Autoload/OpenSave.gd b/src/Autoload/OpenSave.gd index be83bfc1e..5a6f4eeaa 100644 --- a/src/Autoload/OpenSave.gd +++ b/src/Autoload/OpenSave.gd @@ -36,6 +36,7 @@ func handle_loading_files(files : PoolStringArray) -> void: preview_dialog.image = image Global.control.add_child(preview_dialog) preview_dialog.popup_centered() + Global.dialog_open(true) func open_pxo_file(path : String, untitled_backup : bool = false) -> void: diff --git a/src/UI/Dialogs/PreviewDialog.gd b/src/UI/Dialogs/PreviewDialog.gd index 22a69438f..bbb6043d5 100644 --- a/src/UI/Dialogs/PreviewDialog.gd +++ b/src/UI/Dialogs/PreviewDialog.gd @@ -21,6 +21,11 @@ func _on_PreviewDialog_about_to_show() -> void: func _on_PreviewDialog_popup_hide() -> void: queue_free() + # Call Global.dialog_open() only if it's the only preview dialog opened + for child in Global.control.get_children(): + if child != self and "PreviewDialog" in child.name: + return + Global.dialog_open(false) func _on_PreviewDialog_confirmed() -> void: