diff options
| author | Juan Linietsky | 2016-07-18 16:41:28 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-07-18 16:41:59 -0300 |
| commit | f10bd217a26487f097bc4609c02302126d36ae41 (patch) | |
| tree | afc02337035501e3cdf1f073cec5bddc747d0362 /scene/resources/theme.cpp | |
| parent | 4f9dea3aed8a0a15df6dfde65fc5f2bd5e8a0b06 (diff) | |
| download | godot-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.cpp | 15 |
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 { |
