summaryrefslogtreecommitdiffstats
path: root/editor/editor_about.cpp
diff options
context:
space:
mode:
authorAaron Record <aaronjrecord@gmail.com>2022-07-29 23:35:34 -0600
committerAaron Record <aaronjrecord@gmail.com>2022-08-27 11:52:29 -0600
commit4b817a565cab8af648c88cfc7ab6481e86ee3625 (patch)
treec12f7e186f04d71ea9731b1308d682f876262aed /editor/editor_about.cpp
parent4808d01b2bcda54db15e1e2649e0a38c37886ee1 (diff)
downloadredot-engine-4b817a565cab8af648c88cfc7ab6481e86ee3625.tar.gz
Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED
Diffstat (limited to 'editor/editor_about.cpp')
-rw-r--r--editor/editor_about.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp
index 17aa67cd45..f3c95a76c6 100644
--- a/editor/editor_about.cpp
+++ b/editor/editor_about.cpp
@@ -38,22 +38,18 @@
// The metadata key used to store and retrieve the version text to copy to the clipboard.
static const String META_TEXT_TO_COPY = "text_to_copy";
-void EditorAbout::_theme_changed() {
- const Ref<Font> font = get_theme_font(SNAME("source"), SNAME("EditorFonts"));
- const int font_size = get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts"));
- _tpl_text->add_theme_font_override("normal_font", font);
- _tpl_text->add_theme_font_size_override("normal_font_size", font_size);
- _tpl_text->add_theme_constant_override("line_separation", 4 * EDSCALE);
- _license_text->add_theme_font_override("normal_font", font);
- _license_text->add_theme_font_size_override("normal_font_size", font_size);
- _license_text->add_theme_constant_override("line_separation", 4 * EDSCALE);
- _logo->set_texture(get_theme_icon(SNAME("Logo"), SNAME("EditorIcons")));
-}
-
void EditorAbout::_notification(int p_what) {
switch (p_what) {
- case NOTIFICATION_ENTER_TREE: {
- _theme_changed();
+ case NOTIFICATION_THEME_CHANGED: {
+ const Ref<Font> font = get_theme_font(SNAME("source"), SNAME("EditorFonts"));
+ const int font_size = get_theme_font_size(SNAME("source_size"), SNAME("EditorFonts"));
+ _tpl_text->add_theme_font_override("normal_font", font);
+ _tpl_text->add_theme_font_size_override("normal_font_size", font_size);
+ _tpl_text->add_theme_constant_override("line_separation", 4 * EDSCALE);
+ _license_text->add_theme_font_override("normal_font", font);
+ _license_text->add_theme_font_size_override("normal_font_size", font_size);
+ _license_text->add_theme_constant_override("line_separation", 4 * EDSCALE);
+ _logo->set_texture(get_theme_icon(SNAME("Logo"), SNAME("EditorIcons")));
} break;
}
}
@@ -120,7 +116,6 @@ EditorAbout::EditorAbout() {
set_hide_on_ok(true);
VBoxContainer *vbc = memnew(VBoxContainer);
- vbc->connect("theme_changed", callable_mp(this, &EditorAbout::_theme_changed));
HBoxContainer *hbc = memnew(HBoxContainer);
hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hbc->set_alignment(BoxContainer::ALIGNMENT_CENTER);