diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 01455fec17a..0e3b408996b 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -534,7 +534,11 @@ void EditorPropertyPath::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - path_edit->set_icon(get_editor_theme_icon(SNAME("Folder"))); + if (folder) { + path_edit->set_icon(get_editor_theme_icon(SNAME("FolderBrowse"))); + } else { + path_edit->set_icon(get_editor_theme_icon(SNAME("FileBrowse"))); + } } break; } } diff --git a/editor/fbx_importer_manager.cpp b/editor/fbx_importer_manager.cpp index 07854af23e5..2049ac9344d 100644 --- a/editor/fbx_importer_manager.cpp +++ b/editor/fbx_importer_manager.cpp @@ -39,6 +39,10 @@ void FBXImporterManager::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_THEME_CHANGED: { + fbx_path_browse->set_icon(get_editor_theme_icon(SNAME("FileBrowse"))); + } break; + case NOTIFICATION_READY: { connect("confirmed", callable_mp(this, &FBXImporterManager::_path_confirmed)); } break; @@ -148,9 +152,9 @@ FBXImporterManager::FBXImporterManager() { fbx_path->set_h_size_flags(Control::SIZE_EXPAND_FILL); hb->add_child(fbx_path); fbx_path_browse = memnew(Button); - hb->add_child(fbx_path_browse); fbx_path_browse->set_text(TTR("Browse")); fbx_path_browse->connect("pressed", callable_mp(this, &FBXImporterManager::_browse_install)); + hb->add_child(fbx_path_browse); hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); hb->set_custom_minimum_size(Size2(400 * EDSCALE, 0)); diff --git a/editor/icons/FileBrowse.svg b/editor/icons/FileBrowse.svg new file mode 100644 index 00000000000..2bf3ca4ac60 --- /dev/null +++ b/editor/icons/FileBrowse.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/editor/icons/FolderBrowse.svg b/editor/icons/FolderBrowse.svg new file mode 100644 index 00000000000..834d7f16de0 --- /dev/null +++ b/editor/icons/FolderBrowse.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/editor/project_manager/project_dialog.cpp b/editor/project_manager/project_dialog.cpp index 350bb5bb9f9..81fdf9c3691 100644 --- a/editor/project_manager/project_dialog.cpp +++ b/editor/project_manager/project_dialog.cpp @@ -778,6 +778,16 @@ void ProjectDialog::show_dialog() { popup_centered(Size2(500, 0) * EDSCALE); } +void ProjectDialog::_notification(int p_what) { + switch (p_what) { + case NOTIFICATION_THEME_CHANGED: { + create_dir->set_icon(get_editor_theme_icon(SNAME("FolderCreate"))); + project_browse->set_icon(get_editor_theme_icon(SNAME("FolderBrowse"))); + install_browse->set_icon(get_editor_theme_icon(SNAME("FolderBrowse"))); + } break; + } +} + void ProjectDialog::_bind_methods() { ADD_SIGNAL(MethodInfo("project_created")); ADD_SIGNAL(MethodInfo("projects_updated")); diff --git a/editor/project_manager/project_dialog.h b/editor/project_manager/project_dialog.h index 1418edc57fd..8517189e5aa 100644 --- a/editor/project_manager/project_dialog.h +++ b/editor/project_manager/project_dialog.h @@ -129,6 +129,7 @@ private: protected: static void _bind_methods(); + void _notification(int p_what); public: void set_mode(Mode p_mode); diff --git a/editor/themes/editor_theme_manager.cpp b/editor/themes/editor_theme_manager.cpp index 8aa2fe41cef..1f451487cb6 100644 --- a/editor/themes/editor_theme_manager.cpp +++ b/editor/themes/editor_theme_manager.cpp @@ -1659,6 +1659,8 @@ void EditorThemeManager::_populate_editor_styles(const Ref &p_theme { p_theme->set_stylebox("project_list", "ProjectManager", p_config.tree_panel_style); p_theme->set_constant("sidebar_button_icon_separation", "ProjectManager", int(6 * EDSCALE)); + p_theme->set_icon("browse_folder", "ProjectManager", p_theme->get_icon(SNAME("FolderBrowse"), EditorStringName(EditorIcons))); + p_theme->set_icon("browse_file", "ProjectManager", p_theme->get_icon(SNAME("FileBrowse"), EditorStringName(EditorIcons))); // ProjectTag. { diff --git a/modules/gltf/editor/editor_scene_importer_blend.cpp b/modules/gltf/editor/editor_scene_importer_blend.cpp index c6e92de762d..1b71caef5bc 100644 --- a/modules/gltf/editor/editor_scene_importer_blend.cpp +++ b/modules/gltf/editor/editor_scene_importer_blend.cpp @@ -471,6 +471,10 @@ void EditorFileSystemImportFormatSupportQueryBlend::_browse_install() { browse_dialog->popup_centered_ratio(); } +void EditorFileSystemImportFormatSupportQueryBlend::_update_icons() { + blender_path_browse->set_icon(blender_path_browse->get_editor_theme_icon(SNAME("FolderBrowse"))); +} + bool EditorFileSystemImportFormatSupportQueryBlend::query() { if (!configure_blender_dialog) { configure_blender_dialog = memnew(ConfirmationDialog); @@ -486,10 +490,12 @@ bool EditorFileSystemImportFormatSupportQueryBlend::query() { blender_path = memnew(LineEdit); blender_path->set_h_size_flags(Control::SIZE_EXPAND_FILL); hb->add_child(blender_path); + blender_path_browse = memnew(Button); - hb->add_child(blender_path_browse); blender_path_browse->set_text(TTR("Browse")); blender_path_browse->connect("pressed", callable_mp(this, &EditorFileSystemImportFormatSupportQueryBlend::_browse_install)); + hb->add_child(blender_path_browse); + hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); hb->set_custom_minimum_size(Size2(400 * EDSCALE, 0)); @@ -515,6 +521,11 @@ bool EditorFileSystemImportFormatSupportQueryBlend::query() { browse_dialog->connect("dir_selected", callable_mp(this, &EditorFileSystemImportFormatSupportQueryBlend::_select_install)); EditorNode::get_singleton()->get_gui_base()->add_child(browse_dialog); + + // Update icons. + // This is a hack because we can't rely on notifications here as we don't receive them. + // Usually, we only have to wait for `NOTIFICATION_THEME_CHANGED` to update the icons. + callable_mp(this, &EditorFileSystemImportFormatSupportQueryBlend::_update_icons).call_deferred(); } String path = EDITOR_GET("filesystem/import/blender/blender_path"); diff --git a/modules/gltf/editor/editor_scene_importer_blend.h b/modules/gltf/editor/editor_scene_importer_blend.h index ed1b19eaf3b..8a6c65a6248 100644 --- a/modules/gltf/editor/editor_scene_importer_blend.h +++ b/modules/gltf/editor/editor_scene_importer_blend.h @@ -102,6 +102,8 @@ class EditorFileSystemImportFormatSupportQueryBlend : public EditorFileSystemImp void _select_install(String p_path); void _browse_install(); + void _update_icons(); + public: virtual bool is_active() const override; virtual Vector get_file_extensions() const override;