Skip to content

Commit

Permalink
Update audio effect icon when theme changes
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyqiu committed Mar 4, 2022
1 parent f356c8a commit 20ed798
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions editor/editor_audio_buses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 20ed798

Please sign in to comment.