diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-03 20:13:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-03 20:13:28 +0100 |
commit | 20563b081bcbfe853622a139422751dba6a75714 (patch) | |
tree | 88759936aa09c0eec90c84d6f17067c696e10e40 /editor/plugins/theme_editor_preview.cpp | |
parent | a8a20a0e02c8459513542f77eaed9b7350812c94 (diff) | |
parent | fad3138af7bbaee4bd7dea785657c84890411f0a (diff) |
Merge pull request #56327 from pycbouh/editor-theme-goes-brrr-but-then-halts
Make the theme editor correctly stop updating after it was hidden
Diffstat (limited to 'editor/plugins/theme_editor_preview.cpp')
-rw-r--r-- | editor/plugins/theme_editor_preview.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/editor/plugins/theme_editor_preview.cpp b/editor/plugins/theme_editor_preview.cpp index 9a5ecd3802..2aec7b7145 100644 --- a/editor/plugins/theme_editor_preview.cpp +++ b/editor/plugins/theme_editor_preview.cpp @@ -36,6 +36,8 @@ #include "editor/editor_scale.h" +constexpr double REFRESH_TIMER = 1.5; + void ThemeEditorPreview::set_preview_theme(const Ref<Theme> &p_theme) { preview_content->set_theme(p_theme); } @@ -66,7 +68,7 @@ void ThemeEditorPreview::_refresh_interval() { } void ThemeEditorPreview::_preview_visibility_changed() { - set_process(is_visible()); + set_process(is_visible_in_tree()); } void ThemeEditorPreview::_picker_button_cbk() { @@ -200,7 +202,7 @@ void ThemeEditorPreview::_notification(int p_what) { case NOTIFICATION_PROCESS: { time_left -= get_process_delta_time(); if (time_left < 0) { - time_left = 1.5; + time_left = REFRESH_TIMER; _refresh_interval(); } } break; |