Avoid accessing the theme too early in EditorRunBar

This commit is contained in:
Yuri Sizov 2023-04-27 18:49:16 +02:00
parent 352ebe9725
commit de1a1dd43e

View file

@ -45,6 +45,10 @@ EditorRunBar *EditorRunBar::singleton = nullptr;
void EditorRunBar::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_POSTINITIALIZE: {
_reset_play_buttons();
} break;
case NOTIFICATION_THEME_CHANGED: {
_update_play_buttons();
pause_button->set_icon(get_theme_icon(SNAME("Pause"), SNAME("EditorIcons")));
@ -434,8 +438,6 @@ EditorRunBar::EditorRunBar() {
write_movie_button->set_tooltip_text(TTR("Enable Movie Maker mode.\nThe project will run at stable FPS and the visual and audio output will be recorded to a video file."));
write_movie_button->connect("toggled", callable_mp(this, &EditorRunBar::_write_movie_toggled));
_reset_play_buttons();
quick_run = memnew(EditorQuickOpen);
add_child(quick_run);
quick_run->connect("quick_open", callable_mp(this, &EditorRunBar::_quick_run_selected));