1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 09:09:47 +00:00

Fix UI not staying dimmed after opening a native file dialog

This commit is contained in:
Emmanouil Papadeas 2024-02-03 13:55:17 +02:00
parent 9a842ad33e
commit 4c39e29b67
4 changed files with 9 additions and 11 deletions

View file

@ -840,7 +840,9 @@ func _renderer_changed(value: int) -> void:
## Use this to prepare Pixelorama before opening a dialog.
func dialog_open(open: bool) -> void:
func dialog_open(open: bool, is_file_dialog := false) -> void:
if is_file_dialog and use_native_file_dialogs:
return
var dim_color := Color.WHITE
if open:
if dim_on_popup:

View file

@ -284,7 +284,7 @@ func _on_OpenSprite_files_selected(paths: PackedStringArray) -> void:
func show_save_dialog(project := Global.current_project) -> void:
Global.dialog_open(true)
Global.dialog_open(true, true)
if OS.get_name() == "Web":
var save_filename := save_sprite_html5.get_node("%FileNameLineEdit")
save_sprite_html5.popup_centered()

View file

@ -241,7 +241,7 @@ func _cel_switched() -> void:
func _new_object_popup_id_pressed(id: int) -> void:
if id == Cel3DObject.Type.IMPORTED:
load_model_dialog.popup_centered()
Global.dialog_open(true)
Global.dialog_open(true, true)
else:
_add_object(id)
@ -488,4 +488,4 @@ func _on_LoadModelDialog_files_selected(paths: PackedStringArray) -> void:
func _on_load_model_dialog_visibility_changed() -> void:
Global.dialog_open(false)
Global.dialog_open(false, true)

View file

@ -376,13 +376,14 @@ func _handle_metadata(id: int, popup_menu: PopupMenu) -> void:
func _popup_dialog(dialog: Window, dialog_size := Vector2i.ZERO) -> void:
dialog.popup_centered(dialog_size)
Global.dialog_open(true)
var is_file_dialog := dialog is FileDialog
Global.dialog_open(true, is_file_dialog)
func file_menu_id_pressed(id: int) -> void:
match id:
Global.FileMenu.NEW:
_on_new_project_file_menu_option_pressed()
_popup_dialog(new_image_dialog)
Global.FileMenu.OPEN:
_open_project_file()
Global.FileMenu.OPEN_LAST_PROJECT:
@ -401,11 +402,6 @@ func file_menu_id_pressed(id: int) -> void:
_handle_metadata(id, file_menu)
func _on_new_project_file_menu_option_pressed() -> void:
new_image_dialog.popup_centered()
Global.dialog_open(true)
func _open_project_file() -> void:
if OS.get_name() == "Web":
Html5FileExchange.load_image()