diff options
Diffstat (limited to 'editor/plugins/audio_stream_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/audio_stream_editor_plugin.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/editor/plugins/audio_stream_editor_plugin.cpp b/editor/plugins/audio_stream_editor_plugin.cpp index 89579150c2..2be9528019 100644 --- a/editor/plugins/audio_stream_editor_plugin.cpp +++ b/editor/plugins/audio_stream_editor_plugin.cpp @@ -33,6 +33,7 @@ #include "editor/audio_stream_preview.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/editor_string_names.h" #include "scene/resources/audio_stream_wav.h" // AudioStreamEditor @@ -44,16 +45,16 @@ void AudioStreamEditor::_notification(int p_what) { } break; case NOTIFICATION_THEME_CHANGED: case NOTIFICATION_ENTER_TREE: { - Ref<Font> font = get_theme_font(SNAME("status_source"), SNAME("EditorFonts")); + Ref<Font> font = get_theme_font(SNAME("status_source"), EditorStringName(EditorFonts)); _current_label->add_theme_font_override(SNAME("font"), font); _duration_label->add_theme_font_override(SNAME("font"), font); - _play_button->set_icon(get_theme_icon(SNAME("MainPlay"), SNAME("EditorIcons"))); - _stop_button->set_icon(get_theme_icon(SNAME("Stop"), SNAME("EditorIcons"))); - _preview->set_color(get_theme_color(SNAME("dark_color_2"), SNAME("Editor"))); + _play_button->set_icon(get_editor_theme_icon(SNAME("MainPlay"))); + _stop_button->set_icon(get_editor_theme_icon(SNAME("Stop"))); + _preview->set_color(get_theme_color(SNAME("dark_color_2"), EditorStringName(Editor))); - set_color(get_theme_color(SNAME("dark_color_1"), SNAME("Editor"))); + set_color(get_theme_color(SNAME("dark_color_1"), EditorStringName(Editor))); _indicator->queue_redraw(); _preview->queue_redraw(); @@ -98,7 +99,7 @@ void AudioStreamEditor::_draw_preview() { points.write[idx * 2 + 1] = Vector2(i + 1, rect.position.y + max * rect.size.y); } - Vector<Color> colors = { get_theme_color(SNAME("contrast_color_2"), SNAME("Editor")) }; + Vector<Color> colors = { get_theme_color(SNAME("contrast_color_2"), EditorStringName(Editor)) }; RS::get_singleton()->canvas_item_add_multiline(_preview->get_canvas_item(), points, colors); } @@ -120,26 +121,26 @@ void AudioStreamEditor::_play() { if (_player->is_playing()) { _pausing = true; _player->stop(); - _play_button->set_icon(get_theme_icon(SNAME("MainPlay"), SNAME("EditorIcons"))); + _play_button->set_icon(get_editor_theme_icon(SNAME("MainPlay"))); set_process(false); } else { _pausing = false; _player->play(_current); - _play_button->set_icon(get_theme_icon(SNAME("Pause"), SNAME("EditorIcons"))); + _play_button->set_icon(get_editor_theme_icon(SNAME("Pause"))); set_process(true); } } void AudioStreamEditor::_stop() { _player->stop(); - _play_button->set_icon(get_theme_icon(SNAME("MainPlay"), SNAME("EditorIcons"))); + _play_button->set_icon(get_editor_theme_icon(SNAME("MainPlay"))); _current = 0; _indicator->queue_redraw(); set_process(false); } void AudioStreamEditor::_on_finished() { - _play_button->set_icon(get_theme_icon(SNAME("MainPlay"), SNAME("EditorIcons"))); + _play_button->set_icon(get_editor_theme_icon(SNAME("MainPlay"))); if (!_pausing) { _current = 0; _indicator->queue_redraw(); @@ -157,8 +158,8 @@ void AudioStreamEditor::_draw_indicator() { Rect2 rect = _preview->get_rect(); float len = stream->get_length(); float ofs_x = _current / len * rect.size.width; - const Color col = get_theme_color(SNAME("accent_color"), SNAME("Editor")); - Ref<Texture2D> icon = get_theme_icon(SNAME("TimelineIndicator"), SNAME("EditorIcons")); + const Color col = get_theme_color(SNAME("accent_color"), EditorStringName(Editor)); + Ref<Texture2D> icon = get_editor_theme_icon(SNAME("TimelineIndicator")); _indicator->draw_line(Point2(ofs_x, 0), Point2(ofs_x, rect.size.height), col, Math::round(2 * EDSCALE)); _indicator->draw_texture( icon, |