1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-22 15:06:45 +00:00

Merge pull request #57175 from fire-forge/add-type-icons

Add type icons to Project Settings, Array, and Dictionary editors
This commit is contained in:
Rémi Verschelde
2022-02-03 22:17:25 +01:00
committed by GitHub
3 changed files with 42 additions and 28 deletions

View File

@@ -512,6 +512,16 @@ void ProjectSettingsEditor::_update_theme() {
restart_container->add_theme_style_override("panel", get_theme_stylebox(SNAME("bg"), SNAME("Tree")));
restart_icon->set_texture(get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons")));
restart_label->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), SNAME("Editor")));
type_box->clear();
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
// There's no point in adding Nil types, and Object types
// can't be serialized correctly in the project settings.
if (i != Variant::NIL && i != Variant::OBJECT) {
String type = Variant::get_type_name(Variant::Type(i));
type_box->add_icon_item(get_theme_icon(type, SNAME("EditorIcons")), type, i);
}
}
}
void ProjectSettingsEditor::_notification(int p_what) {
@@ -526,9 +536,9 @@ void ProjectSettingsEditor::_notification(int p_what) {
_update_action_map_editor();
_update_theme();
} break;
case NOTIFICATION_THEME_CHANGED:
case NOTIFICATION_THEME_CHANGED: {
_update_theme();
break;
} break;
}
}
@@ -589,14 +599,6 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) {
type_box->set_custom_minimum_size(Size2(120, 0) * EDSCALE);
header->add_child(type_box);
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
// There's no point in adding Nil types, and Object types
// can't be serialized correctly in the project settings.
if (i != Variant::NIL && i != Variant::OBJECT) {
type_box->add_item(Variant::get_type_name(Variant::Type(i)), i);
}
}
add_button = memnew(Button);
add_button->set_text(TTR("Add"));
add_button->set_disabled(true);