|
@@ -782,6 +782,8 @@ Ref<Font> Label3D::get_font() const {
|
|
}
|
|
}
|
|
|
|
|
|
Ref<Font> Label3D::_get_font_or_default() const {
|
|
Ref<Font> Label3D::_get_font_or_default() const {
|
|
|
|
+ // Similar code taken from `FontVariation::_get_base_font_or_default`.
|
|
|
|
+
|
|
if (theme_font.is_valid()) {
|
|
if (theme_font.is_valid()) {
|
|
theme_font->disconnect_changed(callable_mp(const_cast<Label3D *>(this), &Label3D::_font_changed));
|
|
theme_font->disconnect_changed(callable_mp(const_cast<Label3D *>(this), &Label3D::_font_changed));
|
|
theme_font.unref();
|
|
theme_font.unref();
|
|
@@ -791,12 +793,17 @@ Ref<Font> Label3D::_get_font_or_default() const {
|
|
return font_override;
|
|
return font_override;
|
|
}
|
|
}
|
|
|
|
|
|
- StringName theme_name = "font";
|
|
|
|
|
|
+ const StringName theme_name = "font";
|
|
List<StringName> theme_types;
|
|
List<StringName> theme_types;
|
|
ThemeDB::get_singleton()->get_native_type_dependencies(get_class_name(), &theme_types);
|
|
ThemeDB::get_singleton()->get_native_type_dependencies(get_class_name(), &theme_types);
|
|
|
|
|
|
ThemeContext *global_context = ThemeDB::get_singleton()->get_default_theme_context();
|
|
ThemeContext *global_context = ThemeDB::get_singleton()->get_default_theme_context();
|
|
- for (const Ref<Theme> &theme : global_context->get_themes()) {
|
|
|
|
|
|
+ List<Ref<Theme>> themes = global_context->get_themes();
|
|
|
|
+ if (Engine::get_singleton()->is_editor_hint()) {
|
|
|
|
+ themes.push_front(ThemeDB::get_singleton()->get_project_theme());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (const Ref<Theme> &theme : themes) {
|
|
if (theme.is_null()) {
|
|
if (theme.is_null()) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|