aboutsummaryrefslogtreecommitdiff
path: root/scene/resources/theme.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2016-07-18 16:41:28 -0300
committerJuan Linietsky2016-07-18 16:41:59 -0300
commitf10bd217a26487f097bc4609c02302126d36ae41 (patch)
treeafc02337035501e3cdf1f073cec5bddc747d0362 /scene/resources/theme.cpp
parent4f9dea3aed8a0a15df6dfde65fc5f2bd5e8a0b06 (diff)
downloadgodot-f10bd217a26487f097bc4609c02302126d36ae41.tar.gz
godot-f10bd217a26487f097bc4609c02302126d36ae41.tar.zst
godot-f10bd217a26487f097bc4609c02302126d36ae41.zip
properly fixed notificaitons for theme changed, closes #5774
Diffstat (limited to 'scene/resources/theme.cpp')
-rw-r--r--scene/resources/theme.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp
index 92a6f0c0b..b351167e1 100644
--- a/scene/resources/theme.cpp
+++ b/scene/resources/theme.cpp
@@ -219,7 +219,22 @@ Ref<Theme> Theme::get_default() {
void Theme::set_default_theme_font( const Ref<Font>& p_default_font ) {
+ if (default_theme_font==p_default_font)
+ return;
+
+ if (default_theme_font.is_valid()) {
+ _unref_font(default_theme_font);
+ }
+
default_theme_font=p_default_font;
+
+ if (default_theme_font.is_valid()) {
+ _ref_font(default_theme_font);
+ }
+
+ _change_notify();
+ emit_changed();;
+
}
Ref<Font> Theme::get_default_theme_font() const {