@@ -513,6 +513,10 @@ bool Theme::has_font(const StringName &p_name, const StringName &p_theme_type) c
513513 return ((font_map.has (p_theme_type) && font_map[p_theme_type].has (p_name) && font_map[p_theme_type][p_name].is_valid ()) || has_default_font ());
514514}
515515
516+ bool Theme::has_font_no_default (const StringName &p_name, const StringName &p_theme_type) const {
517+ return (font_map.has (p_theme_type) && font_map[p_theme_type].has (p_name) && font_map[p_theme_type][p_name].is_valid ());
518+ }
519+
516520bool Theme::has_font_nocheck (const StringName &p_name, const StringName &p_theme_type) const {
517521 return (font_map.has (p_theme_type) && font_map[p_theme_type].has (p_name));
518522}
@@ -616,6 +620,10 @@ bool Theme::has_font_size(const StringName &p_name, const StringName &p_theme_ty
616620 return ((font_size_map.has (p_theme_type) && font_size_map[p_theme_type].has (p_name) && (font_size_map[p_theme_type][p_name] > 0 )) || has_default_font_size ());
617621}
618622
623+ bool Theme::has_font_size_no_default (const StringName &p_name, const StringName &p_theme_type) const {
624+ return (font_size_map.has (p_theme_type) && font_size_map[p_theme_type].has (p_name) && (font_size_map[p_theme_type][p_name] > 0 ));
625+ }
626+
619627bool Theme::has_font_size_nocheck (const StringName &p_name, const StringName &p_theme_type) const {
620628 return (font_size_map.has (p_theme_type) && font_size_map[p_theme_type].has (p_name));
621629}
@@ -923,9 +931,17 @@ bool Theme::has_theme_item(DataType p_data_type, const StringName &p_name, const
923931 case DATA_TYPE_CONSTANT:
924932 return has_constant (p_name, p_theme_type);
925933 case DATA_TYPE_FONT:
926- return has_font (p_name, p_theme_type);
934+ if (!variation_map.has (p_theme_type)) {
935+ return has_font (p_name, p_theme_type);
936+ } else {
937+ return has_font_no_default (p_name, p_theme_type);
938+ }
927939 case DATA_TYPE_FONT_SIZE:
928- return has_font_size (p_name, p_theme_type);
940+ if (!variation_map.has (p_theme_type)) {
941+ return has_font_size (p_name, p_theme_type);
942+ } else {
943+ return has_font_size_no_default (p_name, p_theme_type);
944+ }
929945 case DATA_TYPE_ICON:
930946 return has_icon (p_name, p_theme_type);
931947 case DATA_TYPE_STYLEBOX:
0 commit comments