Browse Source

In `merge_with` also merge some default fileds of theme

jsjtxietian 1 year ago
parent
commit
6f3568e3db
1 changed files with 11 additions and 0 deletions
  1. 11 0
      scene/resources/theme.cpp

+ 11 - 0
scene/resources/theme.cpp

@@ -1613,6 +1613,17 @@ void Theme::merge_with(const Ref<Theme> &p_other) {
 		}
 	}
 
+	// Defaults.
+	if (p_other->has_default_font()) {
+		set_default_font(p_other->default_font);
+	}
+	if (p_other->has_default_font_size()) {
+		set_default_font_size(p_other->default_font_size);
+	}
+	if (p_other->has_default_base_scale()) {
+		set_default_base_scale(p_other->default_base_scale);
+	}
+
 	_unfreeze_and_propagate_changes();
 }