Skip to content

Commit

Permalink
Fix inconsistent file dialog settings usage
Browse files Browse the repository at this point in the history
* Project Manager ignores display mode settings.
* EditorFileDialog's default display mode and show hidden files settings
  are not updated when corresponding editor settings change.
  • Loading branch information
timothyqiu committed Apr 25, 2023
1 parent 14c582b commit 2ccc9e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,9 @@ void EditorNode::_notification(int p_what) {

case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
scene_tabs->set_tab_close_display_policy((TabBar::CloseButtonDisplayPolicy)EDITOR_GET("interface/scene_tabs/display_close_button").operator int());
FileDialog::set_default_show_hidden_files(EDITOR_GET("filesystem/file_dialog/show_hidden_files"));
EditorFileDialog::set_default_show_hidden_files(EDITOR_GET("filesystem/file_dialog/show_hidden_files"));
EditorFileDialog::set_default_display_mode((EditorFileDialog::DisplayMode)EDITOR_GET("filesystem/file_dialog/display_mode").operator int());

bool theme_changed =
EditorSettings::get_singleton()->check_changed_settings_in_group("interface/theme") ||
Expand Down
1 change: 1 addition & 0 deletions editor/project_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2602,6 +2602,7 @@ ProjectManager::ProjectManager() {
DisplayServer::get_singleton()->window_set_title(VERSION_NAME + String(" - ") + TTR("Project Manager", "Application"));

EditorFileDialog::set_default_show_hidden_files(EDITOR_GET("filesystem/file_dialog/show_hidden_files"));
EditorFileDialog::set_default_display_mode((EditorFileDialog::DisplayMode)EDITOR_GET("filesystem/file_dialog/display_mode").operator int());

int swap_cancel_ok = EDITOR_GET("interface/editor/accept_dialog_cancel_ok_buttons");
if (swap_cancel_ok != 0) { // 0 is auto, set in register_scene based on DisplayServer.
Expand Down

0 comments on commit 2ccc9e1

Please sign in to comment.