-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Native File Dialog] Add support for adding custom options to the dialogs. #83480
Conversation
15ea03b
to
cbca7ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need a rebase, and filling the documentation. |
@@ -413,6 +413,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { | |||
set_restart_if_changed("interface/editor/debug/enable_pseudolocalization", true); | |||
// Use pseudolocalization in editor. | |||
EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/use_embedded_menu", false, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED) | |||
EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/use_native_file_dialogs", false, "", PROPERTY_USAGE_DEFAULT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any plans to enable it by default?
EDIT:
nvm, seems like it's not fully functional yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like all editor problems were resolved, so this can be enabled by default to get more testing.
Though might be worth double-checking if it behaves correctly on unsupported platforms too.
scene/gui/file_dialog.cpp
Outdated
Node *child = grid_options->get_child(0); | ||
grid_options->remove_child(child); | ||
child->queue_free(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure you can just do memdelete()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every similar instance seems to be using queue_free()
.
This comment was marked as resolved.
This comment was marked as resolved.
This can't be done with the native dialogs, there's no way to control it after showing (in case of macOS and Linux, native dialogs are show by completely different process to access file system outside sandbox).
I can't reproduce it.
It's a pre-existing issue with the native dialogs (#86351), should be fixed now. |
I don't mean native dialogs. I mean a FileDialog placed in the editor. It doesn't update, you need to hide/show it.
I'm using Windows 10 if that matters. |
47292d5
to
e57d34a
Compare
Ah, I see. It should update now.
I'll re-check it on Windows a bit later. |
Restested. Scene dialogs are now working correctly, saving is still wrong. It does add extension, but a wrong one, e.g. saving tscn file will make scn. |
50dcf09
to
b4dc13b
Compare
Rechecked Windows API docs, seems like it's using one-based index for file filter return, should be fixed now. |
Yeah, exactly my point. So if we want to offer this kind of user experience, I don't think we can provide native dialogs as a feature for the editor. Edit: An option could be to redesign the flow so you configure these options before we show the file dialog. But I got to admit, based on my experience with Blender, having it on the same screen is very convenient. |
As a data point in the other direction, I'd give up that proposed workflow in a heartbeat if it meant having my KDE Places (bookmarks) sidebar present and Just Working™... and that's before you count how I use Flatpak specifically so I can customize and lock down my sandboxing easily. |
For the reference, I have opened separate PR with non-editor changes only - #87303 Personally, I would prefer native dialogs over this sidebar UI, but I'm not sure what would be the best replacement for it. |
Closes #274 and implements #568, at long last! Some issues remain: - The native save pxo dialog doesn't have an "Include blended images" option. This will be fixed once godotengine/godot#83480 is merged. - When a native file dialog closes, the interface still remains dimmed. - In the export dialog, the "Browse" file dialog will also close the export dialog itself when it closes, when it's native.
…logs. Add support for adding custom options (checkboxes and optionboxes) to the dialogs (both native and built-in). Add support for using native dialogs in the editor.
Screenshots
Related proposal: godotengine/godot-proposals#1123
Fixes #86351