Skip to content

Commit

Permalink
Merge pull request #82302 from MewPurPur/alt-font-icon
Browse files Browse the repository at this point in the history
Add Font and Mesh icons that aren't grayed out
  • Loading branch information
akien-mga committed Sep 25, 2023
2 parents 34de6c6 + fb030be commit fcbc50e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion editor/editor_asset_installer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ void EditorAssetInstaller::_notification(int p_what) {
extension_icon_map["tres"] = get_editor_theme_icon(SNAME("Resource"));
extension_icon_map["atlastex"] = get_editor_theme_icon(SNAME("AtlasTexture"));
// By default, OBJ files are imported as Mesh resources rather than PackedScenes.
extension_icon_map["obj"] = get_editor_theme_icon(SNAME("Mesh"));
extension_icon_map["obj"] = get_editor_theme_icon(SNAME("MeshItem"));

extension_icon_map["txt"] = get_editor_theme_icon(SNAME("TextFile"));
extension_icon_map["md"] = get_editor_theme_icon(SNAME("TextFile"));
Expand Down
1 change: 1 addition & 0 deletions editor/icons/FontItem.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions editor/icons/MeshItem.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions editor/import/scene_import_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ void SceneImportSettings::_fill_mesh(Tree *p_tree, const Ref<Mesh> &p_mesh, Tree

MeshData &mesh_data = mesh_map[import_id];

Ref<Texture2D> icon = get_editor_theme_icon(SNAME("Mesh"));
Ref<Texture2D> icon = get_editor_theme_icon(SNAME("MeshItem"));

TreeItem *item = p_tree->create_item(p_parent);
item->set_text(0, p_mesh->get_name());
Expand Down Expand Up @@ -1285,7 +1285,7 @@ void SceneImportSettings::_save_dir_callback(const String &p_path) {
String name = md.mesh_node->get_text(0);

item->set_cell_mode(0, TreeItem::CELL_MODE_CHECK);
item->set_icon(0, get_editor_theme_icon(SNAME("Mesh")));
item->set_icon(0, get_editor_theme_icon(SNAME("MeshItem")));
item->set_text(0, name);

if (md.has_import_id) {
Expand Down
10 changes: 5 additions & 5 deletions editor/plugins/theme_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void ThemeItemImportTree::_update_items_tree() {
break;

case Theme::DATA_TYPE_FONT:
data_type_node->set_icon(0, get_editor_theme_icon(SNAME("Font")));
data_type_node->set_icon(0, get_editor_theme_icon(SNAME("FontItem")));
data_type_node->set_text(0, TTR("Fonts"));

item_list = &tree_font_items;
Expand Down Expand Up @@ -876,7 +876,7 @@ void ThemeItemImportTree::_notification(int p_what) {
select_all_constants_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectAll")));
select_full_constants_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectFull")));

select_fonts_icon->set_texture(get_editor_theme_icon(SNAME("Font")));
select_fonts_icon->set_texture(get_editor_theme_icon(SNAME("FontItem")));
deselect_all_fonts_button->set_icon(get_editor_theme_icon(SNAME("ThemeDeselectAll")));
select_all_fonts_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectAll")));
select_full_fonts_button->set_icon(get_editor_theme_icon(SNAME("ThemeSelectFull")));
Expand Down Expand Up @@ -1387,7 +1387,7 @@ void ThemeItemEditorDialog::_update_edit_item_tree(String p_item_type) {
if (names.size() > 0) {
TreeItem *font_root = edit_items_tree->create_item(root);
font_root->set_metadata(0, Theme::DATA_TYPE_FONT);
font_root->set_icon(0, get_editor_theme_icon(SNAME("Font")));
font_root->set_icon(0, get_editor_theme_icon(SNAME("FontItem")));
font_root->set_text(0, TTR("Fonts"));
font_root->add_button(0, get_editor_theme_icon(SNAME("Clear")), ITEMS_TREE_REMOVE_DATA_TYPE, false, TTR("Remove All Font Items"));

Expand Down Expand Up @@ -1875,7 +1875,7 @@ void ThemeItemEditorDialog::_notification(int p_what) {
case NOTIFICATION_THEME_CHANGED: {
edit_items_add_color->set_icon(get_editor_theme_icon(SNAME("Color")));
edit_items_add_constant->set_icon(get_editor_theme_icon(SNAME("MemberConstant")));
edit_items_add_font->set_icon(get_editor_theme_icon(SNAME("Font")));
edit_items_add_font->set_icon(get_editor_theme_icon(SNAME("FontItem")));
edit_items_add_font_size->set_icon(get_editor_theme_icon(SNAME("FontSize")));
edit_items_add_icon->set_icon(get_editor_theme_icon(SNAME("ImageTexture")));
edit_items_add_stylebox->set_icon(get_editor_theme_icon(SNAME("StyleBoxFlat")));
Expand Down Expand Up @@ -3318,7 +3318,7 @@ void ThemeTypeEditor::_notification(int p_what) {

data_type_tabs->set_tab_icon(0, get_editor_theme_icon(SNAME("Color")));
data_type_tabs->set_tab_icon(1, get_editor_theme_icon(SNAME("MemberConstant")));
data_type_tabs->set_tab_icon(2, get_editor_theme_icon(SNAME("Font")));
data_type_tabs->set_tab_icon(2, get_editor_theme_icon(SNAME("FontItem")));
data_type_tabs->set_tab_icon(3, get_editor_theme_icon(SNAME("FontSize")));
data_type_tabs->set_tab_icon(4, get_editor_theme_icon(SNAME("ImageTexture")));
data_type_tabs->set_tab_icon(5, get_editor_theme_icon(SNAME("StyleBoxFlat")));
Expand Down

0 comments on commit fcbc50e

Please sign in to comment.