Skip to content

Commit

Permalink
Merge pull request #76513 from YuriSizov/editor-dont-run-too-fast
Browse files Browse the repository at this point in the history
Avoid accessing the theme too early in EditorRunBar
  • Loading branch information
akien-mga committed Apr 27, 2023
2 parents 390aed9 + de1a1dd commit b81387d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions editor/gui/editor_run_bar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit b81387d

Please sign in to comment.