diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-03-04 21:36:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-04 21:36:16 +0100 |
commit | 71835906dd3965eac703137bc8e14abcaa630dfd (patch) | |
tree | 11b7fd23ed9373989fb78d18692f6d89a055438b | |
parent | 38771eb032042c461071b9a5f757930e6ef93592 (diff) | |
parent | 20ed798e590ace9f99526cbe911ee1d01cf3e1d0 (diff) |
Merge pull request #58758 from timothyqiu/audio-effect-icon
Update audio effect icon when theme changes
-rw-r--r-- | editor/editor_audio_buses.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 9685ff4b70..9c0bd91121 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -92,6 +92,12 @@ void EditorAudioBus::_notification(int p_what) { audio_value_preview_label->add_theme_color_override("font_color", get_theme_color(SNAME("font_color"), SNAME("TooltipLabel"))); audio_value_preview_label->add_theme_color_override("font_shadow_color", get_theme_color(SNAME("font_shadow_color"), SNAME("TooltipLabel"))); audio_value_preview_box->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TooltipPanel"))); + + for (int i = 0; i < effect_options->get_item_count(); i++) { + String class_name = effect_options->get_item_metadata(i); + Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(class_name); + effect_options->set_item_icon(i, icon); + } } break; case NOTIFICATION_READY: { @@ -917,11 +923,9 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { continue; } - Ref<Texture2D> icon = EditorNode::get_singleton()->get_class_icon(E); String name = E.operator String().replace("AudioEffect", ""); effect_options->add_item(name); effect_options->set_item_metadata(effect_options->get_item_count() - 1, E); - effect_options->set_item_icon(effect_options->get_item_count() - 1, icon); } bus_options = memnew(MenuButton); |