summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--editor/animation_bezier_editor.cpp6
-rw-r--r--editor/animation_track_editor.cpp38
-rw-r--r--editor/animation_track_editor_plugins.cpp96
-rw-r--r--editor/code_editor.cpp28
-rw-r--r--editor/connections_dialog.cpp4
-rw-r--r--editor/debugger/editor_debugger_node.cpp8
-rw-r--r--editor/debugger/editor_performance_profiler.cpp4
-rw-r--r--editor/debugger/editor_profiler.cpp2
-rw-r--r--editor/debugger/editor_visual_profiler.cpp6
-rw-r--r--editor/debugger/script_editor_debugger.cpp8
-rw-r--r--editor/editor_asset_installer.cpp2
-rw-r--r--editor/editor_audio_buses.cpp12
-rw-r--r--editor/editor_autoload_settings.cpp2
-rw-r--r--editor/editor_command_palette.cpp2
-rw-r--r--editor/editor_help.cpp12
-rw-r--r--editor/editor_inspector.cpp22
-rw-r--r--editor/editor_log.cpp2
-rw-r--r--editor/editor_native_shader_source_visualizer.cpp4
-rw-r--r--editor/editor_node.cpp10
-rw-r--r--editor/editor_properties.cpp40
-rw-r--r--editor/editor_resource_picker.cpp8
-rw-r--r--editor/editor_settings_dialog.cpp4
-rw-r--r--editor/engine_update_label.cpp4
-rw-r--r--editor/export/editor_export_platform.cpp4
-rw-r--r--editor/export/export_template_manager.cpp10
-rw-r--r--editor/export/project_export.cpp10
-rw-r--r--editor/fbx_importer_manager.cpp4
-rw-r--r--editor/find_in_files.cpp16
-rw-r--r--editor/gui/editor_object_selector.cpp6
-rw-r--r--editor/gui/editor_spin_slider.cpp10
-rw-r--r--editor/gui/editor_validation_panel.cpp8
-rw-r--r--editor/gui/editor_zoom_widget.cpp2
-rw-r--r--editor/import/audio_stream_import_settings.cpp8
-rw-r--r--editor/import/dynamic_font_import_settings.cpp18
-rw-r--r--editor/import_dock.cpp6
-rw-r--r--editor/input_event_configuration_dialog.cpp4
-rw-r--r--editor/inspector_dock.cpp8
-rw-r--r--editor/plugins/abstract_polygon_2d_editor.cpp2
-rw-r--r--editor/plugins/animation_blend_space_1d_editor.cpp8
-rw-r--r--editor/plugins/animation_blend_space_2d_editor.cpp8
-rw-r--r--editor/plugins/animation_blend_tree_editor_plugin.cpp6
-rw-r--r--editor/plugins/animation_library_editor.cpp4
-rw-r--r--editor/plugins/animation_state_machine_editor.cpp2
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp8
-rw-r--r--editor/plugins/audio_stream_editor_plugin.cpp4
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp26
-rw-r--r--editor/plugins/curve_editor_plugin.cpp18
-rw-r--r--editor/plugins/font_config_plugin.cpp6
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp32
-rw-r--r--editor/plugins/script_editor_plugin.cpp2
-rw-r--r--editor/plugins/texture_3d_editor_plugin.cpp2
-rw-r--r--editor/plugins/texture_editor_plugin.cpp6
-rw-r--r--editor/plugins/texture_layered_editor_plugin.cpp2
-rw-r--r--editor/plugins/theme_editor_plugin.cpp4
-rw-r--r--editor/plugins/tiles/tile_data_editors.cpp4
-rw-r--r--editor/plugins/tiles/tile_map_layer_editor.cpp6
-rw-r--r--editor/plugins/tiles/tile_set_atlas_source_editor.cpp2
-rw-r--r--editor/plugins/version_control_editor_plugin.cpp8
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp32
-rw-r--r--editor/project_manager.cpp10
-rw-r--r--editor/project_manager/project_dialog.cpp6
-rw-r--r--editor/project_manager/project_list.cpp8
-rw-r--r--editor/project_manager/quick_settings_dialog.cpp4
-rw-r--r--editor/project_settings_editor.cpp2
-rw-r--r--editor/rename_dialog.cpp6
-rw-r--r--editor/themes/editor_fonts.cpp19
-rw-r--r--editor/themes/editor_theme_manager.cpp58
-rw-r--r--editor/window_wrapper.cpp6
-rw-r--r--modules/gdscript/editor/gdscript_highlighter.cpp2
-rw-r--r--modules/gltf/editor/editor_scene_importer_blend.cpp4
-rw-r--r--modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp2
-rw-r--r--modules/multiplayer/editor/editor_network_profiler.cpp4
-rw-r--r--scene/3d/label_3d.cpp2
-rw-r--r--scene/gui/tab_container.cpp4
-rw-r--r--scene/scene_string_names.cpp3
-rw-r--r--scene/scene_string_names.h3
-rw-r--r--scene/theme/default_theme.cpp126
77 files changed, 453 insertions, 446 deletions
diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp
index 2136a843b6..ffd609d925 100644
--- a/editor/animation_bezier_editor.cpp
+++ b/editor/animation_bezier_editor.cpp
@@ -242,9 +242,9 @@ void AnimationBezierTrackEdit::_notification(int p_what) {
draw_rect(Rect2(Point2(), get_size()), accent, false, Math::round(EDSCALE));
}
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
- Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
+ Color color = get_theme_color(SceneStringName(font_color), SNAME("Label"));
int hsep = get_theme_constant(SNAME("h_separation"), SNAME("ItemList"));
int vsep = get_theme_constant(SNAME("v_separation"), SNAME("ItemList"));
Color linecolor = color;
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index af4853673b..8e7d1e30cd 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -1435,9 +1435,9 @@ void AnimationTimelineEdit::_notification(int p_what) {
return;
}
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
- Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
+ Color color = get_theme_color(SceneStringName(font_color), SNAME("Label"));
int zoomw = key_range;
float scale = get_zoom_scale();
@@ -1627,8 +1627,8 @@ void AnimationTimelineEdit::set_animation(const Ref<Animation> &p_animation, boo
Size2 AnimationTimelineEdit::get_minimum_size() const {
Size2 ms = add_track->get_minimum_size();
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
ms.height = MAX(ms.height, font->get_height(font_size));
ms.width = get_buttons_width() + add_track->get_minimum_size().width + get_editor_theme_icon(SNAME("Hsize"))->get_width() + 2;
return ms;
@@ -1983,9 +1983,9 @@ void AnimationTrackEdit::_notification(int p_what) {
draw_style_box(get_theme_stylebox(SNAME("Focus"), EditorStringName(EditorStyles)), Rect2(Point2(1 * EDSCALE, 0), get_size() - Size2(1 * EDSCALE, 0)));
}
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
- Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
+ Color color = get_theme_color(SceneStringName(font_color), SNAME("Label"));
int hsep = get_theme_constant(SNAME("h_separation"), SNAME("ItemList"));
Color linecolor = color;
linecolor.a = 0.2;
@@ -2323,7 +2323,7 @@ void AnimationTrackEdit::draw_key_link(int p_index, float p_pixels_sec, int p_x,
return;
}
- Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
+ Color color = get_theme_color(SceneStringName(font_color), SNAME("Label"));
color.a = 0.5;
int from_x = MAX(p_x, p_clip_left);
@@ -2360,9 +2360,9 @@ void AnimationTrackEdit::draw_key(int p_index, float p_pixels_sec, int p_x, bool
Vector2 ofs(p_x - icon_to_draw->get_width() / 2, int(get_size().height - icon_to_draw->get_height()) / 2);
if (animation->track_get_type(track) == Animation::TYPE_METHOD) {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
- Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
+ Color color = get_theme_color(SceneStringName(font_color), SNAME("Label"));
color.a = 0.5;
Dictionary d = animation->track_get_key_value(track, p_index);
@@ -2485,8 +2485,8 @@ NodePath AnimationTrackEdit::get_path() const {
Size2 AnimationTrackEdit::get_minimum_size() const {
Ref<Texture2D> texture = get_editor_theme_icon(SNAME("Object"));
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
int separation = get_theme_constant(SNAME("v_separation"), SNAME("ItemList"));
int max_h = MAX(texture->get_height(), font->get_height(font_size));
@@ -3418,10 +3418,10 @@ void AnimationTrackEditGroup::_notification(int p_what) {
} break;
case NOTIFICATION_DRAW: {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
int separation = get_theme_constant(SNAME("h_separation"), SNAME("ItemList"));
- Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
+ Color color = get_theme_color(SceneStringName(font_color), SNAME("Label"));
if (root) {
Node *n = root->get_node_or_null(node);
@@ -3483,8 +3483,8 @@ void AnimationTrackEditGroup::set_type_and_name(const Ref<Texture2D> &p_type, co
}
Size2 AnimationTrackEditGroup::get_minimum_size() const {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
int separation = get_theme_constant(SNAME("v_separation"), SNAME("ItemList"));
return Vector2(0, MAX(font->get_height(font_size), icon_size.y) + separation);
diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp
index 7a53f4dded..0297aaaf7f 100644
--- a/editor/animation_track_editor_plugins.cpp
+++ b/editor/animation_track_editor_plugins.cpp
@@ -82,14 +82,14 @@ void AnimationTrackEditBool::draw_key(int p_index, float p_pixels_sec, int p_x,
/// COLOR ///
int AnimationTrackEditColor::get_key_height() const {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
return font->get_height(font_size) * 0.8;
}
Rect2 AnimationTrackEditColor::get_key_rect(int p_index, float p_pixels_sec) {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
int fh = font->get_height(font_size) * 0.8;
return Rect2(-fh / 2, 0, fh, get_size().height);
}
@@ -99,8 +99,8 @@ bool AnimationTrackEditColor::is_key_selectable_by_distance() const {
}
void AnimationTrackEditColor::draw_key_link(int p_index, float p_pixels_sec, int p_x, int p_next_x, int p_clip_left, int p_clip_right) {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
int fh = (font->get_height(font_size) * 0.8);
fh /= 3;
@@ -168,8 +168,8 @@ void AnimationTrackEditColor::draw_key_link(int p_index, float p_pixels_sec, int
void AnimationTrackEditColor::draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right) {
Color color = get_animation()->track_get_key_value(get_track(), p_index);
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
int fh = font->get_height(font_size) * 0.8;
Rect2 rect(Vector2(p_x - fh / 2, int(get_size().height - fh) / 2), Size2(fh, fh));
@@ -207,8 +207,8 @@ int AnimationTrackEditAudio::get_key_height() const {
return AnimationTrackEdit::get_key_height();
}
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
return int(font->get_height(font_size) * 1.5);
}
@@ -240,8 +240,8 @@ Rect2 AnimationTrackEditAudio::get_key_rect(int p_index, float p_pixels_sec) {
return Rect2(0, 0, len * p_pixels_sec, get_size().height);
} else {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
int fh = font->get_height(font_size) * 0.8;
return Rect2(0, 0, fh, get_size().height);
}
@@ -304,8 +304,8 @@ void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x,
return;
}
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
float fh = int(font->get_height(font_size) * 1.5);
Rect2 rect = Rect2(from_x, (get_size().height - fh) / 2, to_x - from_x, fh);
draw_rect(rect, Color(0.25, 0.25, 0.25));
@@ -334,12 +334,12 @@ void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x,
draw_rect(rect, accent, false);
}
} else {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
int fh = font->get_height(font_size) * 0.8;
Rect2 rect(Vector2(p_x, int(get_size().height - fh) / 2), Size2(fh, fh));
- Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
+ Color color = get_theme_color(SceneStringName(font_color), SNAME("Label"));
draw_rect_clipped(rect, color);
if (p_selected) {
@@ -367,8 +367,8 @@ int AnimationTrackEditSpriteFrame::get_key_height() const {
return AnimationTrackEdit::get_key_height();
}
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
return int(font->get_height(font_size) * 2);
}
@@ -435,8 +435,8 @@ Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_se
size = size.floor();
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
int height = int(font->get_height(font_size) * 2);
int width = height * size.width / size.height;
@@ -526,8 +526,8 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in
region.size = texture->get_size();
}
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
int height = int(font->get_height(font_size) * 2);
int width = height * region.size.width / region.size.height;
@@ -570,8 +570,8 @@ int AnimationTrackEditSubAnim::get_key_height() const {
return AnimationTrackEdit::get_key_height();
}
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
return int(font->get_height(font_size) * 1.5);
}
@@ -599,8 +599,8 @@ Rect2 AnimationTrackEditSubAnim::get_key_rect(int p_index, float p_pixels_sec) {
return Rect2(0, 0, len * p_pixels_sec, get_size().height);
} else {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
int fh = font->get_height(font_size) * 0.8;
return Rect2(0, 0, fh, get_size().height);
}
@@ -654,13 +654,13 @@ void AnimationTrackEditSubAnim::draw_key(int p_index, float p_pixels_sec, int p_
return;
}
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
int fh = font->get_height(font_size) * 1.5;
Rect2 rect(from_x, int(get_size().height - fh) / 2, to_x - from_x, fh);
- Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
+ Color color = get_theme_color(SceneStringName(font_color), SNAME("Label"));
Color bg = color;
bg.r = 1 - color.r;
bg.g = 1 - color.g;
@@ -705,12 +705,12 @@ void AnimationTrackEditSubAnim::draw_key(int p_index, float p_pixels_sec, int p_
draw_rect(rect, accent, false);
}
} else {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
int fh = font->get_height(font_size) * 0.8;
Rect2 rect(Vector2(p_x, int(get_size().height - fh) / 2), Size2(fh, fh));
- Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
+ Color color = get_theme_color(SceneStringName(font_color), SNAME("Label"));
draw_rect_clipped(rect, color);
if (p_selected) {
@@ -783,7 +783,7 @@ void AnimationTrackEditVolumeDB::draw_key_link(int p_index, float p_pixels_sec,
int y_from = (get_size().height - tex_h) / 2;
- Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
+ Color color = get_theme_color(SceneStringName(font_color), SNAME("Label"));
color.a *= 0.7;
draw_line(Point2(from_x, y_from + h * tex_h), Point2(to_x, y_from + h_n * tex_h), color, 2);
@@ -804,8 +804,8 @@ void AnimationTrackEditTypeAudio::_preview_changed(ObjectID p_which) {
}
int AnimationTrackEditTypeAudio::get_key_height() const {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
return int(font->get_height(font_size) * 1.5);
}
@@ -870,8 +870,8 @@ void AnimationTrackEditTypeAudio::draw_key(int p_index, float p_pixels_sec, int
}
}
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
float fh = int(font->get_height(font_size) * 1.5);
Ref<AudioStreamPreview> preview = AudioStreamPreviewGenerator::get_singleton()->generate_preview(stream);
@@ -1175,8 +1175,8 @@ int AnimationTrackEditTypeAnimation::get_key_height() const {
return AnimationTrackEdit::get_key_height();
}
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
return int(font->get_height(font_size) * 1.5);
}
@@ -1204,8 +1204,8 @@ Rect2 AnimationTrackEditTypeAnimation::get_key_rect(int p_index, float p_pixels_
return Rect2(0, 0, len * p_pixels_sec, get_size().height);
} else {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
int fh = font->get_height(font_size) * 0.8;
return Rect2(0, 0, fh, get_size().height);
}
@@ -1259,13 +1259,13 @@ void AnimationTrackEditTypeAnimation::draw_key(int p_index, float p_pixels_sec,
return;
}
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
int fh = font->get_height(font_size) * 1.5;
Rect2 rect(from_x, int(get_size().height - fh) / 2, to_x - from_x, fh);
- Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
+ Color color = get_theme_color(SceneStringName(font_color), SNAME("Label"));
Color bg = color;
bg.r = 1 - color.r;
bg.g = 1 - color.g;
@@ -1310,12 +1310,12 @@ void AnimationTrackEditTypeAnimation::draw_key(int p_index, float p_pixels_sec,
draw_rect(rect, accent, false);
}
} else {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
int fh = font->get_height(font_size) * 0.8;
Rect2 rect(Vector2(p_x, int(get_size().height - fh) / 2), Size2(fh, fh));
- Color color = get_theme_color(SNAME("font_color"), SNAME("Label"));
+ Color color = get_theme_color(SceneStringName(font_color), SNAME("Label"));
draw_rect_clipped(rect, color);
if (p_selected) {
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 0e272429a3..58887e3714 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -115,7 +115,7 @@ void FindReplaceBar::_notification(int p_what) {
} break;
case NOTIFICATION_THEME_CHANGED: {
- matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ matches_label->add_theme_color_override(SceneStringName(font_color), results_count > 0 ? get_theme_color(SceneStringName(font_color), SNAME("Label")) : get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
} break;
case NOTIFICATION_PREDELETE: {
@@ -338,7 +338,7 @@ void FindReplaceBar::_replace_all() {
}
text_editor->set_v_scroll(vsval);
- matches_label->add_theme_color_override("font_color", rc > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ matches_label->add_theme_color_override(SceneStringName(font_color), rc > 0 ? get_theme_color(SceneStringName(font_color), SNAME("Label")) : get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
matches_label->set_text(vformat(TTR("%d replaced."), rc));
callable_mp((Object *)text_editor, &Object::connect).call_deferred("text_changed", callable_mp(this, &FindReplaceBar::_editor_text_changed), 0U);
@@ -437,7 +437,7 @@ void FindReplaceBar::_update_matches_display() {
} else {
matches_label->show();
- matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ matches_label->add_theme_color_override(SceneStringName(font_color), results_count > 0 ? get_theme_color(SceneStringName(font_color), SNAME("Label")) : get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
if (results_count == 0) {
matches_label->set_text(TTR("No match"));
@@ -1430,17 +1430,17 @@ void CodeTextEditor::_update_text_editor_theme() {
for (int i = 0; i < count; i++) {
Control *n = Object::cast_to<Control>(status_bar->get_child(i));
if (n) {
- n->add_theme_font_override(SNAME("font"), status_bar_font);
- n->add_theme_font_size_override(SNAME("font_size"), status_bar_font_size);
+ n->add_theme_font_override(SceneStringName(font), status_bar_font);
+ n->add_theme_font_size_override(SceneStringName(font_size), status_bar_font_size);
}
}
const Color &error_color = get_theme_color(SNAME("error_color"), EditorStringName(Editor));
const Color &warning_color = get_theme_color(SNAME("warning_color"), EditorStringName(Editor));
- error->add_theme_color_override(SNAME("font_color"), error_color);
- error_button->add_theme_color_override(SNAME("font_color"), error_color);
- warning_button->add_theme_color_override(SNAME("font_color"), warning_color);
+ error->add_theme_color_override(SceneStringName(font_color), error_color);
+ error_button->add_theme_color_override(SceneStringName(font_color), error_color);
+ warning_button->add_theme_color_override(SceneStringName(font_color), warning_color);
_update_font_ligatures();
}
@@ -1448,7 +1448,7 @@ void CodeTextEditor::_update_text_editor_theme() {
void CodeTextEditor::_update_font_ligatures() {
int ot_mode = EDITOR_GET("interface/editor/code_font_contextual_ligatures");
- Ref<FontVariation> fc = text_editor->get_theme_font(SNAME("font"));
+ Ref<FontVariation> fc = text_editor->get_theme_font(SceneStringName(font));
if (fc.is_valid()) {
switch (ot_mode) {
case 1: { // Disable ligatures.
@@ -1633,12 +1633,12 @@ void CodeTextEditor::remove_all_bookmarks() {
}
void CodeTextEditor::_zoom_in() {
- int s = text_editor->get_theme_font_size("font_size");
+ int s = text_editor->get_theme_font_size(SceneStringName(font_size));
_zoom_to(zoom_factor * (s + MAX(1.0f, EDSCALE)) / s);
}
void CodeTextEditor::_zoom_out() {
- int s = text_editor->get_theme_font_size("font_size");
+ int s = text_editor->get_theme_font_size(SceneStringName(font_size));
_zoom_to(zoom_factor * (s - MAX(1.0f, EDSCALE)) / s);
}
@@ -1664,10 +1664,10 @@ void CodeTextEditor::set_zoom_factor(float p_zoom_factor) {
zoom_button->set_text(itos(Math::round(zoom_factor * 100)) + " %");
- if (text_editor->has_theme_font_size_override("font_size")) {
- text_editor->remove_theme_font_size_override("font_size");
+ if (text_editor->has_theme_font_size_override(SceneStringName(font_size))) {
+ text_editor->remove_theme_font_size_override(SceneStringName(font_size));
}
- text_editor->add_theme_font_size_override("font_size", new_font_size);
+ text_editor->add_theme_font_size_override(SceneStringName(font_size), new_font_size);
}
float CodeTextEditor::get_zoom_factor() {
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp
index cede2c0ab6..b7afa1096b 100644
--- a/editor/connections_dialog.cpp
+++ b/editor/connections_dialog.cpp
@@ -670,8 +670,8 @@ void ConnectDialog::init(const ConnectionData &p_cd, const PackedStringArray &p_
void ConnectDialog::popup_dialog(const String &p_for_signal) {
from_signal->set_text(p_for_signal);
- warning_label->add_theme_color_override("font_color", warning_label->get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
- error_label->add_theme_color_override("font_color", error_label->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ warning_label->add_theme_color_override(SceneStringName(font_color), warning_label->get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
+ error_label->add_theme_color_override(SceneStringName(font_color), error_label->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
filter_nodes->clear();
if (!advanced->is_pressed()) {
diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp
index 3f8df5e313..d3bd18c0e8 100644
--- a/editor/debugger/editor_debugger_node.cpp
+++ b/editor/debugger/editor_debugger_node.cpp
@@ -416,20 +416,20 @@ void EditorDebuggerNode::_update_errors() {
if (error_count == 0 && warning_count == 0) {
debugger_button->set_text(TTR("Debugger"));
- debugger_button->remove_theme_color_override("font_color");
+ debugger_button->remove_theme_color_override(SceneStringName(font_color));
debugger_button->set_icon(Ref<Texture2D>());
} else {
debugger_button->set_text(TTR("Debugger") + " (" + itos(error_count + warning_count) + ")");
if (error_count >= 1 && warning_count >= 1) {
debugger_button->set_icon(get_editor_theme_icon(SNAME("ErrorWarning")));
// Use error color to represent the highest level of severity reported.
- debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ debugger_button->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
} else if (error_count >= 1) {
debugger_button->set_icon(get_editor_theme_icon(SNAME("Error")));
- debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ debugger_button->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
} else {
debugger_button->set_icon(get_editor_theme_icon(SNAME("Warning")));
- debugger_button->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
+ debugger_button->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
}
}
last_error_count = error_count;
diff --git a/editor/debugger/editor_performance_profiler.cpp b/editor/debugger/editor_performance_profiler.cpp
index 332e8f2ffc..1ea9a66534 100644
--- a/editor/debugger/editor_performance_profiler.cpp
+++ b/editor/debugger/editor_performance_profiler.cpp
@@ -113,8 +113,8 @@ void EditorPerformanceProfiler::_monitor_draw() {
info_message->hide();
Ref<StyleBox> graph_style_box = get_theme_stylebox(CoreStringName(normal), SNAME("TextEdit"));
- Ref<Font> graph_font = get_theme_font(SNAME("font"), SNAME("TextEdit"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("TextEdit"));
+ Ref<Font> graph_font = get_theme_font(SceneStringName(font), SNAME("TextEdit"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("TextEdit"));
int columns = int(Math::ceil(Math::sqrt(float(active.size()))));
int rows = int(Math::ceil(float(active.size()) / float(columns)));
diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp
index 0e2a7ee599..1a1817d69d 100644
--- a/editor/debugger/editor_profiler.cpp
+++ b/editor/debugger/editor_profiler.cpp
@@ -425,7 +425,7 @@ void EditorProfiler::_notification(int p_what) {
activate->set_icon(get_editor_theme_icon(SNAME("Play")));
clear_button->set_icon(get_editor_theme_icon(SNAME("Clear")));
- theme_cache.seek_line_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
+ theme_cache.seek_line_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
theme_cache.seek_line_color.a = 0.8;
theme_cache.seek_line_hover_color = theme_cache.seek_line_color;
theme_cache.seek_line_hover_color.a = 0.4;
diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp
index 38f1061a72..7e105c516a 100644
--- a/editor/debugger/editor_visual_profiler.cpp
+++ b/editor/debugger/editor_visual_profiler.cpp
@@ -446,9 +446,9 @@ void EditorVisualProfiler::_graph_tex_draw() {
return;
}
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
- const Color color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
+ const Color color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
if (seeking) {
int max_frames = frame_metrics.size();
diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp
index e35ca590b3..ff9b4c73a6 100644
--- a/editor/debugger/script_editor_debugger.cpp
+++ b/editor/debugger/script_editor_debugger.cpp
@@ -825,13 +825,13 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, uint64_t p_thread
void ScriptEditorDebugger::_set_reason_text(const String &p_reason, MessageType p_type) {
switch (p_type) {
case MESSAGE_ERROR:
- reason->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ reason->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
break;
case MESSAGE_WARNING:
- reason->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
+ reason->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
break;
default:
- reason->add_theme_color_override("font_color", get_theme_color(SNAME("success_color"), EditorStringName(Editor)));
+ reason->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("success_color"), EditorStringName(Editor)));
}
reason->set_text(p_reason);
@@ -869,7 +869,7 @@ void ScriptEditorDebugger::_notification(int p_what) {
vmem_export->set_icon(get_editor_theme_icon(SNAME("Save")));
search->set_right_icon(get_editor_theme_icon(SNAME("Search")));
- reason->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ reason->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
TreeItem *error_root = error_tree->get_root();
if (error_root) {
diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp
index 8f675cf548..8662ad75b2 100644
--- a/editor/editor_asset_installer.cpp
+++ b/editor/editor_asset_installer.cpp
@@ -601,7 +601,7 @@ void EditorAssetInstaller::_notification(int p_what) {
} else {
show_source_files_button->set_icon(get_editor_theme_icon(SNAME("Forward")));
}
- asset_conflicts_link->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ asset_conflicts_link->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
generic_extension_icon = get_editor_theme_icon(SNAME("Object"));
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp
index a4994d1f92..db59606ffc 100644
--- a/editor/editor_audio_buses.cpp
+++ b/editor/editor_audio_buses.cpp
@@ -105,7 +105,7 @@ void EditorAudioBus::_notification(int p_what) {
bus_options->set_icon(get_editor_theme_icon(SNAME("GuiTabMenuHl")));
- audio_value_preview_label->add_theme_color_override("font_color", get_theme_color(SNAME("font_color"), SNAME("TooltipLabel")));
+ audio_value_preview_label->add_theme_color_override(SceneStringName(font_color), get_theme_color(SceneStringName(font_color), SNAME("TooltipLabel")));
audio_value_preview_label->add_theme_color_override("font_shadow_color", get_theme_color(SNAME("font_shadow_color"), SNAME("TooltipLabel")));
audio_value_preview_box->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("TooltipPanel")));
@@ -1419,8 +1419,8 @@ void EditorAudioMeterNotches::add_notch(float p_normalized_offset, float p_db_va
}
Size2 EditorAudioMeterNotches::get_minimum_size() const {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
float font_height = font->get_height(font_size);
float width = 0;
@@ -1440,10 +1440,10 @@ Size2 EditorAudioMeterNotches::get_minimum_size() const {
void EditorAudioMeterNotches::_update_theme_item_cache() {
Control::_update_theme_item_cache();
- theme_cache.notch_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
+ theme_cache.notch_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
- theme_cache.font = get_theme_font(SNAME("font"), SNAME("Label"));
- theme_cache.font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ theme_cache.font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ theme_cache.font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
}
void EditorAudioMeterNotches::_bind_methods() {
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index 13f2fd047c..746afe0737 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -884,7 +884,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
error_message = memnew(Label);
error_message->hide();
error_message->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT);
- error_message->add_theme_color_override("font_color", EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("error_color"), EditorStringName(Editor)));
+ error_message->add_theme_color_override(SceneStringName(font_color), EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("error_color"), EditorStringName(Editor)));
add_child(error_message);
Label *l = memnew(Label);
diff --git a/editor/editor_command_palette.cpp b/editor/editor_command_palette.cpp
index badab92fb0..9e100b6a67 100644
--- a/editor/editor_command_palette.cpp
+++ b/editor/editor_command_palette.cpp
@@ -140,7 +140,7 @@ void EditorCommandPalette::_update_command_search(const String &search_text) {
ti->set_metadata(0, entries[i].key_name);
ti->set_text_alignment(1, HORIZONTAL_ALIGNMENT_RIGHT);
ti->set_text(1, shortcut_text);
- Color c = get_theme_color(SNAME("font_color"), EditorStringName(Editor)) * Color(1, 1, 1, 0.5);
+ Color c = get_theme_color(SceneStringName(font_color), EditorStringName(Editor)) * Color(1, 1, 1, 0.5);
ti->set_custom_color(1, c);
}
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 3dc8584096..f58e471633 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -3969,12 +3969,12 @@ void EditorHelpHighlighter::reset_cache() {
#ifdef MODULE_GDSCRIPT_ENABLED
highlight_data_caches[LANGUAGE_GDSCRIPT].clear();
- text_edits[LANGUAGE_GDSCRIPT]->add_theme_color_override("font_color", text_color);
+ text_edits[LANGUAGE_GDSCRIPT]->add_theme_color_override(SceneStringName(font_color), text_color);
#endif
#ifdef MODULE_MONO_ENABLED
highlight_data_caches[LANGUAGE_CSHARP].clear();
- text_edits[LANGUAGE_CSHARP]->add_theme_color_override("font_color", text_color);
+ text_edits[LANGUAGE_CSHARP]->add_theme_color_override(SceneStringName(font_color), text_color);
#endif
}
@@ -3983,7 +3983,7 @@ EditorHelpHighlighter::EditorHelpHighlighter() {
#ifdef MODULE_GDSCRIPT_ENABLED
TextEdit *gdscript_text_edit = memnew(TextEdit);
- gdscript_text_edit->add_theme_color_override("font_color", text_color);
+ gdscript_text_edit->add_theme_color_override(SceneStringName(font_color), text_color);
Ref<GDScript> gdscript;
gdscript.instantiate();
@@ -4000,7 +4000,7 @@ EditorHelpHighlighter::EditorHelpHighlighter() {
#ifdef MODULE_MONO_ENABLED
TextEdit *csharp_text_edit = memnew(TextEdit);
- csharp_text_edit->add_theme_color_override("font_color", text_color);
+ csharp_text_edit->add_theme_color_override(SceneStringName(font_color), text_color);
// See GH-89610.
//Ref<CSharpScript> csharp;
@@ -4094,7 +4094,7 @@ void FindBar::_notification(int p_what) {
hide_button->set_texture_hover(get_editor_theme_icon(SNAME("Close")));
hide_button->set_texture_pressed(get_editor_theme_icon(SNAME("Close")));
hide_button->set_custom_minimum_size(hide_button->get_texture_normal()->get_size());
- matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ matches_label->add_theme_color_override(SceneStringName(font_color), results_count > 0 ? get_theme_color(SceneStringName(font_color), SNAME("Label")) : get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
@@ -4162,7 +4162,7 @@ void FindBar::_update_matches_label() {
} else {
matches_label->show();
- matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color(SNAME("font_color"), SNAME("Label")) : get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ matches_label->add_theme_color_override(SceneStringName(font_color), results_count > 0 ? get_theme_color(SceneStringName(font_color), SNAME("Label")) : get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
matches_label->set_text(vformat(results_count == 1 ? TTR("%d match.") : TTR("%d matches."), results_count));
}
}
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 7f21bb9ca8..9e85b276be 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -69,8 +69,8 @@ bool EditorInspector::_property_path_matches(const String &p_property_path, cons
Size2 EditorProperty::get_minimum_size() const {
Size2 ms;
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Tree"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Tree"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Tree"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Tree"));
ms.height = label.is_empty() ? 0 : font->get_height(font_size) + 4 * EDSCALE;
for (int i = 0; i < get_child_count(); i++) {
@@ -132,8 +132,8 @@ void EditorProperty::_notification(int p_what) {
{
int child_room = size.width * (1.0 - split_ratio);
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Tree"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Tree"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Tree"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Tree"));
int height = label.is_empty() ? 0 : font->get_height(font_size) + 4 * EDSCALE;
bool no_children = true;
@@ -240,8 +240,8 @@ void EditorProperty::_notification(int p_what) {
} break;
case NOTIFICATION_DRAW: {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Tree"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Tree"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Tree"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Tree"));
bool rtl = is_layout_rtl();
Size2 size = get_size();
@@ -1251,7 +1251,7 @@ void EditorInspectorCategory::_notification(int p_what) {
w -= hs + icon_size;
}
- Color color = get_theme_color(SNAME("font_color"), SNAME("Tree"));
+ Color color = get_theme_color(SceneStringName(font_color), SNAME("Tree"));
if (is_layout_rtl()) {
ofs = get_size().width - ofs - w;
}
@@ -1452,7 +1452,7 @@ void EditorInspectorSection::_notification(int p_what) {
Ref<Font> font = get_theme_font(SNAME("bold"), EditorStringName(EditorFonts));
int font_size = get_theme_font_size(SNAME("bold_size"), EditorStringName(EditorFonts));
- Color font_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
+ Color font_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
if (folded && revertable_properties.size()) {
int label_width = font->get_string_size(label, HORIZONTAL_ALIGNMENT_LEFT, available, font_size, TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_CONSTRAIN_ELLIPSIS).x;
@@ -1545,8 +1545,8 @@ Size2 EditorInspectorSection::get_minimum_size() const {
ms = ms.max(minsize);
}
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Tree"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Tree"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Tree"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Tree"));
ms.height += font->get_height(font_size) + get_theme_constant(SNAME("v_separation"), SNAME("Tree"));
ms.width += get_theme_constant(SNAME("inspector_margin"), EditorStringName(Editor));
@@ -2252,7 +2252,7 @@ void EditorInspectorArray::_setup() {
if (numbered) {
ae.number = memnew(Label);
- ae.number->add_theme_font_override("font", numbers_font);
+ ae.number->add_theme_font_override(SceneStringName(font), numbers_font);
ae.number->set_custom_minimum_size(Size2(numbers_min_w, 0));
ae.number->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT);
ae.number->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER);
diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp
index 166d09af30..4223f1a08a 100644
--- a/editor/editor_log.cpp
+++ b/editor/editor_log.cpp
@@ -124,7 +124,7 @@ void EditorLog::_update_theme() {
theme_cache.error_icon = get_editor_theme_icon(SNAME("Error"));
theme_cache.warning_color = get_theme_color(SNAME("warning_color"), EditorStringName(Editor));
theme_cache.warning_icon = get_editor_theme_icon(SNAME("Warning"));
- theme_cache.message_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor)) * Color(1, 1, 1, 0.6);
+ theme_cache.message_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor)) * Color(1, 1, 1, 0.6);
}
void EditorLog::_editor_settings_changed() {
diff --git a/editor/editor_native_shader_source_visualizer.cpp b/editor/editor_native_shader_source_visualizer.cpp
index 37c8bffe3d..3d7d37c94e 100644
--- a/editor/editor_native_shader_source_visualizer.cpp
+++ b/editor/editor_native_shader_source_visualizer.cpp
@@ -96,8 +96,8 @@ void EditorNativeShaderSourceVisualizer::_inspect_shader(RID p_shader) {
CodeEdit *code_edit = memnew(CodeEdit);
code_edit->set_editable(false);
code_edit->set_syntax_highlighter(syntax_highlighter);
- code_edit->add_theme_font_override("font", get_theme_font("source", EditorStringName(EditorFonts)));
- code_edit->add_theme_font_size_override("font_size", get_theme_font_size("source_size", EditorStringName(EditorFonts)));
+ code_edit->add_theme_font_override(SceneStringName(font), get_theme_font("source", EditorStringName(EditorFonts)));
+ code_edit->add_theme_font_size_override(SceneStringName(font_size), get_theme_font_size("source_size", EditorStringName(EditorFonts)));
code_edit->add_theme_constant_override("line_spacing", EDITOR_DEF("text_editor/theme/line_spacing", 6));
// Appearance: Caret
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 238c22693e..0c8ea01a44 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -6180,11 +6180,11 @@ void EditorNode::_update_renderer_color() {
String rendering_method = renderer->get_selected_metadata();
if (rendering_method == "forward_plus") {
- renderer->add_theme_color_override("font_color", theme->get_color(SNAME("forward_plus_color"), EditorStringName(Editor)));
+ renderer->add_theme_color_override(SceneStringName(font_color), theme->get_color(SNAME("forward_plus_color"), EditorStringName(Editor)));
} else if (rendering_method == "mobile") {
- renderer->add_theme_color_override("font_color", theme->get_color(SNAME("mobile_color"), EditorStringName(Editor)));
+ renderer->add_theme_color_override(SceneStringName(font_color), theme->get_color(SNAME("mobile_color"), EditorStringName(Editor)));
} else if (rendering_method == "gl_compatibility") {
- renderer->add_theme_color_override("font_color", theme->get_color(SNAME("gl_compatibility_color"), EditorStringName(Editor)));
+ renderer->add_theme_color_override(SceneStringName(font_color), theme->get_color(SNAME("gl_compatibility_color"), EditorStringName(Editor)));
}
}
@@ -6992,8 +6992,8 @@ EditorNode::EditorNode() {
if (can_expand && global_menu) {
project_title = memnew(Label);
- project_title->add_theme_font_override("font", theme->get_font(SNAME("bold"), EditorStringName(EditorFonts)));
- project_title->add_theme_font_size_override("font_size", theme->get_font_size(SNAME("bold_size"), EditorStringName(EditorFonts)));
+ project_title->add_theme_font_override(SceneStringName(font), theme->get_font(SNAME("bold"), EditorStringName(EditorFonts)));
+ project_title->add_theme_font_size_override(SceneStringName(font_size), theme->get_font_size(SNAME("bold_size"), EditorStringName(EditorFonts)));
project_title->set_focus_mode(Control::FOCUS_NONE);
project_title->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS);
project_title->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER);
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index ecc31bb0e2..54d1e0a513 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -165,8 +165,8 @@ void EditorPropertyMultilineText::_open_big_text() {
big_text = memnew(TextEdit);
if (expression) {
big_text->set_syntax_highlighter(text->get_syntax_highlighter());
- big_text->add_theme_font_override("font", get_theme_font(SNAME("expression"), EditorStringName(EditorFonts)));
- big_text->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("expression_size"), EditorStringName(EditorFonts)));
+ big_text->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("expression"), EditorStringName(EditorFonts)));
+ big_text->add_theme_font_size_override(SceneStringName(font_size), get_theme_font_size(SNAME("expression_size"), EditorStringName(EditorFonts)));
}
big_text->connect("text_changed", callable_mp(this, &EditorPropertyMultilineText::_big_text_changed));
big_text->set_line_wrapping_mode(TextEdit::LineWrappingMode::LINE_WRAPPING_BOUNDARY);
@@ -204,15 +204,15 @@ void EditorPropertyMultilineText::_notification(int p_what) {
font = get_theme_font(SNAME("expression"), EditorStringName(EditorFonts));
font_size = get_theme_font_size(SNAME("expression_size"), EditorStringName(EditorFonts));
- text->add_theme_font_override("font", font);
- text->add_theme_font_size_override("font_size", font_size);
+ text->add_theme_font_override(SceneStringName(font), font);
+ text->add_theme_font_size_override(SceneStringName(font_size), font_size);
if (big_text) {
- big_text->add_theme_font_override("font", font);
- big_text->add_theme_font_size_override("font_size", font_size);
+ big_text->add_theme_font_override(SceneStringName(font), font);
+ big_text->add_theme_font_size_override(SceneStringName(font_size), font_size);
}
} else {
- font = get_theme_font(SNAME("font"), SNAME("TextEdit"));
- font_size = get_theme_font_size(SNAME("font_size"), SNAME("TextEdit"));
+ font = get_theme_font(SceneStringName(font), SNAME("TextEdit"));
+ font_size = get_theme_font_size(SceneStringName(font_size), SNAME("TextEdit"));
}
text->set_custom_minimum_size(Vector2(0, font->get_height(font_size) * 6));
} break;
@@ -858,8 +858,8 @@ EditorPropertyLayersGrid::EditorPropertyLayersGrid() {
}
Size2 EditorPropertyLayersGrid::get_grid_size() const {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
return Vector2(0, font->get_height(font_size) * 3);
}
@@ -998,7 +998,7 @@ void EditorPropertyLayersGrid::_notification(int p_what) {
Color color = get_theme_color(read_only ? SNAME("highlight_disabled_color") : SNAME("highlight_color"), EditorStringName(Editor));
- Color text_color = get_theme_color(read_only ? SNAME("font_disabled_color") : SNAME("font_color"), EditorStringName(Editor));
+ Color text_color = get_theme_color(read_only ? SNAME("font_disabled_color") : SceneStringName(font_color), EditorStringName(Editor));
text_color.a *= 0.5;
Color text_color_on = get_theme_color(read_only ? SNAME("font_disabled_color") : SNAME("font_hover_color"), EditorStringName(Editor));
@@ -1029,8 +1029,8 @@ void EditorPropertyLayersGrid::_notification(int p_what) {
draw_rect(rect2, color);
flag_rects.push_back(rect2);
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
Vector2 offset;
offset.y = rect2.size.y * 0.75;
@@ -1570,14 +1570,14 @@ void EditorPropertyEasing::_draw_easing() {
const float exp = get_edited_property_value();
- const Ref<Font> f = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
- const Color font_color = get_theme_color(is_read_only() ? SNAME("font_uneditable_color") : SNAME("font_color"), SNAME("LineEdit"));
+ const Ref<Font> f = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
+ const Color font_color = get_theme_color(is_read_only() ? SNAME("font_uneditable_color") : SceneStringName(font_color), SNAME("LineEdit"));
Color line_color;
if (dragging) {
line_color = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
} else {
- line_color = get_theme_color(is_read_only() ? SNAME("font_uneditable_color") : SNAME("font_color"), SNAME("LineEdit")) * Color(1, 1, 1, 0.9);
+ line_color = get_theme_color(is_read_only() ? SNAME("font_uneditable_color") : SceneStringName(font_color), SNAME("LineEdit")) * Color(1, 1, 1, 0.9);
}
Vector<Point2> points;
@@ -1670,7 +1670,7 @@ void EditorPropertyEasing::_notification(int p_what) {
preset->add_icon_item(get_editor_theme_icon(SNAME("CurveInOut")), "Ease In-Out", EASING_IN_OUT);
preset->add_icon_item(get_editor_theme_icon(SNAME("CurveOutIn")), "Ease Out-In", EASING_OUT_IN);
}
- easing_draw->set_custom_minimum_size(Size2(0, get_theme_font(SNAME("font"), SNAME("Label"))->get_height(get_theme_font_size(SNAME("font_size"), SNAME("Label"))) * 2));
+ easing_draw->set_custom_minimum_size(Size2(0, get_theme_font(SceneStringName(font), SNAME("Label"))->get_height(get_theme_font_size(SceneStringName(font_size), SNAME("Label"))) * 2));
} break;
}
}
@@ -2078,9 +2078,9 @@ void EditorPropertyQuaternion::_notification(int p_what) {
euler[i]->add_theme_color_override("label_color", colors[i]);
}
edit_button->set_icon(get_editor_theme_icon(SNAME("Edit")));
- euler_label->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("property_color"), SNAME("EditorProperty")));
+ euler_label->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("property_color"), SNAME("EditorProperty")));
warning->set_icon(get_editor_theme_icon(SNAME("NodeWarning")));
- warning->add_theme_color_override(SNAME("font_color"), get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
+ warning->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
} break;
}
}
diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp
index fbd9d84e26..8cde63039b 100644
--- a/editor/editor_resource_picker.cpp
+++ b/editor/editor_resource_picker.cpp
@@ -1231,8 +1231,8 @@ void EditorAudioStreamPicker::_notification(int p_what) {
void EditorAudioStreamPicker::_update_resource() {
EditorResourcePicker::_update_resource();
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
Ref<AudioStream> audio_stream = get_edited_resource();
if (audio_stream.is_valid() && audio_stream->get_length() > 0.0) {
set_assign_button_min_size(Size2(1, font->get_height(font_size) * 3));
@@ -1250,12 +1250,12 @@ void EditorAudioStreamPicker::_preview_draw() {
return;
}
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
get_assign_button()->set_text("");
Size2i size = stream_preview_rect->get_size();
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
Rect2 rect(Point2(), size);
diff --git a/editor/editor_settings_dialog.cpp b/editor/editor_settings_dialog.cpp
index 7f9310f715..51138171fb 100644
--- a/editor/editor_settings_dialog.cpp
+++ b/editor/editor_settings_dialog.cpp
@@ -213,7 +213,7 @@ void EditorSettingsDialog::_update_icons() {
restart_close_button->set_icon(shortcuts->get_editor_theme_icon(SNAME("Close")));
restart_container->add_theme_style_override(SceneStringName(panel), shortcuts->get_theme_stylebox(SceneStringName(panel), SNAME("Tree")));
restart_icon->set_texture(shortcuts->get_editor_theme_icon(SNAME("StatusWarning")));
- restart_label->add_theme_color_override("font_color", shortcuts->get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
+ restart_label->add_theme_color_override(SceneStringName(font_color), shortcuts->get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
}
void EditorSettingsDialog::_event_config_confirmed() {
@@ -307,7 +307,7 @@ void EditorSettingsDialog::_create_shortcut_treeitem(TreeItem *p_parent, const S
shortcut_item->set_text(1, sc_text);
if (sc_text == "None") {
// Fade out unassigned shortcut labels for easier visual grepping.
- shortcut_item->set_custom_color(1, shortcuts->get_theme_color(SNAME("font_color"), SNAME("Label")) * Color(1, 1, 1, 0.5));
+ shortcut_item->set_custom_color(1, shortcuts->get_theme_color(SceneStringName(font_color), SNAME("Label")) * Color(1, 1, 1, 0.5));
}
if (p_allow_revert) {
diff --git a/editor/engine_update_label.cpp b/editor/engine_update_label.cpp
index c9dfe1f521..958093410a 100644
--- a/editor/engine_update_label.cpp
+++ b/editor/engine_update_label.cpp
@@ -166,7 +166,7 @@ void EngineUpdateLabel::_set_message(const String &p_message, const Color &p_col
if (is_disabled()) {
add_theme_color_override("font_disabled_color", p_color);
} else {
- add_theme_color_override("font_color", p_color);
+ add_theme_color_override(SceneStringName(font_color), p_color);
}
set_text(p_message);
}
@@ -264,7 +264,7 @@ void EngineUpdateLabel::_notification(int p_what) {
} break;
case NOTIFICATION_THEME_CHANGED: {
- theme_cache.default_color = get_theme_color("font_color", "Button");
+ theme_cache.default_color = get_theme_color(SceneStringName(font_color), "Button");
theme_cache.disabled_color = get_theme_color("font_disabled_color", "Button");
theme_cache.error_color = get_theme_color("error_color", EditorStringName(Editor));
theme_cache.update_color = get_theme_color("warning_color", EditorStringName(Editor));
diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp
index 5a95b553e9..527544fea3 100644
--- a/editor/export/editor_export_platform.cpp
+++ b/editor/export/editor_export_platform.cpp
@@ -99,12 +99,12 @@ bool EditorExportPlatform::fill_log_messages(RichTextLabel *p_log, Error p_err)
p_log->set_table_column_expand(1, true);
for (int m = 0; m < msg_count; m++) {
EditorExportPlatform::ExportMessage msg = get_message(m);
- Color color = p_log->get_theme_color(SNAME("font_color"), SNAME("Label"));
+ Color color = p_log->get_theme_color(SceneStringName(font_color), SNAME("Label"));
Ref<Texture> icon;
switch (msg.msg_type) {
case EditorExportPlatform::EXPORT_MESSAGE_INFO: {
- color = p_log->get_theme_color(SNAME("font_color"), EditorStringName(Editor)) * Color(1, 1, 1, 0.6);
+ color = p_log->get_theme_color(SceneStringName(font_color), EditorStringName(Editor)) * Color(1, 1, 1, 0.6);
} break;
case EditorExportPlatform::EXPORT_MESSAGE_WARNING: {
icon = p_log->get_editor_theme_icon(SNAME("Warning"));
diff --git a/editor/export/export_template_manager.cpp b/editor/export/export_template_manager.cpp
index 588d99f08f..e84044f7e1 100644
--- a/editor/export/export_template_manager.cpp
+++ b/editor/export/export_template_manager.cpp
@@ -366,9 +366,9 @@ void ExportTemplateManager::_set_current_progress_status(const String &p_status,
if (p_error) {
download_progress_bar->hide();
- download_progress_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ download_progress_label->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
} else {
- download_progress_label->add_theme_color_override("font_color", get_theme_color(SNAME("font_color"), SNAME("Label")));
+ download_progress_label->add_theme_color_override(SceneStringName(font_color), get_theme_color(SceneStringName(font_color), SNAME("Label")));
}
}
@@ -810,9 +810,9 @@ void ExportTemplateManager::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE:
case NOTIFICATION_THEME_CHANGED: {
- current_value->add_theme_font_override("font", get_theme_font(SNAME("main"), EditorStringName(EditorFonts)));
- current_missing_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
- current_installed_label->add_theme_color_override("font_color", get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor)));
+ current_value->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("main"), EditorStringName(EditorFonts)));
+ current_missing_label->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ current_installed_label->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor)));
mirror_options_button->set_icon(get_editor_theme_icon(SNAME("GuiTabMenuHl")));
} break;
diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp
index 7787512cc2..4266c0f69c 100644
--- a/editor/export/project_export.cpp
+++ b/editor/export/project_export.cpp
@@ -68,7 +68,7 @@ void ProjectExportTextureFormatError::_bind_methods() {
void ProjectExportTextureFormatError::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_THEME_CHANGED: {
- texture_format_error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ texture_format_error_label->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
} break;
}
}
@@ -1437,7 +1437,7 @@ ProjectExportDialog::ProjectExportDialog() {
script_key->connect("text_changed", callable_mp(this, &ProjectExportDialog::_script_encryption_key_changed));
script_key_error = memnew(Label);
script_key_error->set_text(String::utf8("• ") + TTR("Invalid Encryption Key (must be 64 hexadecimal characters long)"));
- script_key_error->add_theme_color_override("font_color", EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("error_color"), EditorStringName(Editor)));
+ script_key_error->add_theme_color_override(SceneStringName(font_color), EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("error_color"), EditorStringName(Editor)));
sec_vb->add_margin_child(TTR("Encryption Key (256-bits as hexadecimal):"), script_key);
sec_vb->add_child(script_key_error);
sections->add_child(sec_scroll_container);
@@ -1539,12 +1539,12 @@ ProjectExportDialog::ProjectExportDialog() {
export_error = memnew(Label);
main_vb->add_child(export_error);
export_error->hide();
- export_error->add_theme_color_override("font_color", EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("error_color"), EditorStringName(Editor)));
+ export_error->add_theme_color_override(SceneStringName(font_color), EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("error_color"), EditorStringName(Editor)));
export_warning = memnew(Label);
main_vb->add_child(export_warning);
export_warning->hide();
- export_warning->add_theme_color_override("font_color", EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("warning_color"), EditorStringName(Editor)));
+ export_warning->add_theme_color_override(SceneStringName(font_color), EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("warning_color"), EditorStringName(Editor)));
export_templates_error = memnew(HBoxContainer);
main_vb->add_child(export_templates_error);
@@ -1552,7 +1552,7 @@ ProjectExportDialog::ProjectExportDialog() {
Label *export_error2 = memnew(Label);
export_templates_error->add_child(export_error2);
- export_error2->add_theme_color_override("font_color", EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("error_color"), EditorStringName(Editor)));
+ export_error2->add_theme_color_override(SceneStringName(font_color), EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("error_color"), EditorStringName(Editor)));
export_error2->set_text(String::utf8("• ") + TTR("Export templates for this platform are missing:") + " ");
result_dialog = memnew(AcceptDialog);
diff --git a/editor/fbx_importer_manager.cpp b/editor/fbx_importer_manager.cpp
index 1fded345c8..a8dbb3212c 100644
--- a/editor/fbx_importer_manager.cpp
+++ b/editor/fbx_importer_manager.cpp
@@ -93,11 +93,11 @@ void FBXImporterManager::_validate_path(const String &p_path) {
if (success) {
path_status->set_text(TTR("FBX2glTF executable is valid."));
- path_status->add_theme_color_override("font_color", path_status->get_theme_color(SNAME("success_color"), EditorStringName(Editor)));
+ path_status->add_theme_color_override(SceneStringName(font_color), path_status->get_theme_color(SNAME("success_color"), EditorStringName(Editor)));
get_ok_button()->set_disabled(false);
} else {
path_status->set_text(error);
- path_status->add_theme_color_override("font_color", path_status->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ path_status->add_theme_color_override(SceneStringName(font_color), path_status->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
get_ok_button()->set_disabled(true);
}
}
diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp
index e9edcab52f..17b6eb5081 100644
--- a/editor/find_in_files.cpp
+++ b/editor/find_in_files.cpp
@@ -714,10 +714,10 @@ void FindInFilesPanel::stop_search() {
void FindInFilesPanel::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_THEME_CHANGED: {
- _search_text_label->add_theme_font_override("font", get_theme_font(SNAME("source"), EditorStringName(EditorFonts)));
- _search_text_label->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("source_size"), EditorStringName(EditorFonts)));
- _results_display->add_theme_font_override("font", get_theme_font(SNAME("source"), EditorStringName(EditorFonts)));
- _results_display->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("source_size"), EditorStringName(EditorFonts)));
+ _search_text_label->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("source"), EditorStringName(EditorFonts)));
+ _search_text_label->add_theme_font_size_override(SceneStringName(font_size), get_theme_font_size(SNAME("source_size"), EditorStringName(EditorFonts)));
+ _results_display->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("source"), EditorStringName(EditorFonts)));
+ _results_display->add_theme_font_size_override(SceneStringName(font_size), get_theme_font_size(SNAME("source_size"), EditorStringName(EditorFonts)));
// Rebuild search tree.
if (!_finder->get_search_text().is_empty()) {
@@ -750,7 +750,7 @@ void FindInFilesPanel::_on_result_found(const String &fpath, int line_number, in
file_item = E->value;
}
- Color file_item_color = _results_display->get_theme_color(SNAME("font_color")) * Color(1, 1, 1, 0.67);
+ Color file_item_color = _results_display->get_theme_color(SceneStringName(font_color)) * Color(1, 1, 1, 0.67);
file_item->set_custom_color(0, file_item_color);
file_item->set_selectable(0, false);
@@ -796,8 +796,8 @@ void FindInFilesPanel::draw_result_text(Object *item_obj, Rect2 rect) {
}
Result r = E->value;
String item_text = item->get_text(_with_replace ? 1 : 0);
- Ref<Font> font = _results_display->get_theme_font(SNAME("font"));
- int font_size = _results_display->get_theme_font_size(SNAME("font_size"));
+ Ref<Font> font = _results_display->get_theme_font(SceneStringName(font));
+ int font_size = _results_display->get_theme_font_size(SceneStringName(font_size));
Rect2 match_rect = rect;
match_rect.position.x += font->get_string_size(item_text.left(r.begin_trimmed), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x - 1;
@@ -815,7 +815,7 @@ void FindInFilesPanel::_on_item_edited() {
TreeItem *item = _results_display->get_selected();
// Change opacity to half if checkbox is checked, otherwise full.
- Color use_color = _results_display->get_theme_color(SNAME("font_color"));
+ Color use_color = _results_display->get_theme_color(SceneStringName(font_color));
if (!item->is_checked(0)) {
use_color.a *= 0.5;
}
diff --git a/editor/gui/editor_object_selector.cpp b/editor/gui/editor_object_selector.cpp
index 434aef1419..5b303760b0 100644
--- a/editor/gui/editor_object_selector.cpp
+++ b/editor/gui/editor_object_selector.cpp
@@ -38,8 +38,8 @@
#include "scene/gui/margin_container.h"
Size2 EditorObjectSelector::get_minimum_size() const {
- Ref<Font> font = get_theme_font(SNAME("font"));
- int font_size = get_theme_font_size(SNAME("font_size"));
+ Ref<Font> font = get_theme_font(SceneStringName(font));
+ int font_size = get_theme_font_size(SceneStringName(font_size));
return Button::get_minimum_size() + Size2(0, font->get_height(font_size));
}
@@ -205,7 +205,7 @@ void EditorObjectSelector::_notification(int p_what) {
int icon_size = get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor));
current_object_icon->set_custom_minimum_size(Size2(icon_size, icon_size));
- current_object_label->add_theme_font_override("font", get_theme_font(SNAME("main"), EditorStringName(EditorFonts)));
+ current_object_label->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("main"), EditorStringName(EditorFonts)));
sub_objects_icon->set_texture(get_theme_icon(SNAME("arrow"), SNAME("OptionButton")));
sub_objects_menu->add_theme_constant_override("icon_max_width", icon_size);
} break;
diff --git a/editor/gui/editor_spin_slider.cpp b/editor/gui/editor_spin_slider.cpp
index a838299288..6c85641d3a 100644
--- a/editor/gui/editor_spin_slider.cpp
+++ b/editor/gui/editor_spin_slider.cpp
@@ -314,8 +314,8 @@ void EditorSpinSlider::_draw_spin_slider() {
if (!flat) {
draw_style_box(sb, Rect2(Vector2(), size));
}
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("LineEdit"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("LineEdit"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("LineEdit"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("LineEdit"));
int sep_base = 4 * EDSCALE;
int sep = sep_base + sb->get_offset().x; //make it have the same margin on both sides, looks better
@@ -328,7 +328,7 @@ void EditorSpinSlider::_draw_spin_slider() {
int vofs = (size.height - font->get_height(font_size)) / 2 + font->get_ascent(font_size);
- Color fc = get_theme_color(is_read_only() ? SNAME("font_uneditable_color") : SNAME("font_color"), SNAME("LineEdit"));
+ Color fc = get_theme_color(is_read_only() ? SNAME("font_uneditable_color") : SceneStringName(font_color), SNAME("LineEdit"));
Color lc = get_theme_color(is_read_only() ? SNAME("read_only_label_color") : SNAME("label_color"));
if (flat && !label.is_empty()) {
@@ -514,8 +514,8 @@ LineEdit *EditorSpinSlider::get_line_edit() {
Size2 EditorSpinSlider::get_minimum_size() const {
Ref<StyleBox> sb = get_theme_stylebox(CoreStringName(normal), SNAME("LineEdit"));
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("LineEdit"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("LineEdit"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("LineEdit"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("LineEdit"));
Size2 ms = sb->get_minimum_size();
ms.height += font->get_height(font_size);
diff --git a/editor/gui/editor_validation_panel.cpp b/editor/gui/editor_validation_panel.cpp
index 80bb08517c..969cb43952 100644
--- a/editor/gui/editor_validation_panel.cpp
+++ b/editor/gui/editor_validation_panel.cpp
@@ -108,17 +108,17 @@ void EditorValidationPanel::set_message(int p_id, const String &p_text, MessageT
switch (p_type) {
case MSG_OK:
- label->add_theme_color_override(SNAME("font_color"), theme_cache.valid_color);
+ label->add_theme_color_override(SceneStringName(font_color), theme_cache.valid_color);
break;
case MSG_WARNING:
- label->add_theme_color_override(SNAME("font_color"), theme_cache.warning_color);
+ label->add_theme_color_override(SceneStringName(font_color), theme_cache.warning_color);
break;
case MSG_ERROR:
- label->add_theme_color_override(SNAME("font_color"), theme_cache.error_color);
+ label->add_theme_color_override(SceneStringName(font_color), theme_cache.error_color);
valid = false;
break;
case MSG_INFO:
- label->remove_theme_color_override(SNAME("font_color"));
+ label->remove_theme_color_override(SceneStringName(font_color));
break;
}
}
diff --git a/editor/gui/editor_zoom_widget.cpp b/editor/gui/editor_zoom_widget.cpp
index 73afbc3ab5..341da7bfaf 100644
--- a/editor/gui/editor_zoom_widget.cpp
+++ b/editor/gui/editor_zoom_widget.cpp
@@ -211,7 +211,7 @@ EditorZoomWidget::EditorZoomWidget() {
zoom_reset->add_theme_style_override(SceneStringName(pressed), empty_stylebox);
zoom_reset->add_theme_constant_override("outline_size", Math::ceil(2 * EDSCALE));
zoom_reset->add_theme_color_override("font_outline_color", Color(0, 0, 0));
- zoom_reset->add_theme_color_override("font_color", Color(1, 1, 1));
+ zoom_reset->add_theme_color_override(SceneStringName(font_color), Color(1, 1, 1));
zoom_reset->set_shortcut(ED_GET_SHORTCUT("canvas_item_editor/zoom_100_percent"));
zoom_reset->set_shortcut_context(this);
diff --git a/editor/import/audio_stream_import_settings.cpp b/editor/import/audio_stream_import_settings.cpp
index 6353e63695..7b30e68155 100644
--- a/editor/import/audio_stream_import_settings.cpp
+++ b/editor/import/audio_stream_import_settings.cpp
@@ -52,13 +52,13 @@ void AudioStreamImportSettingsDialog::_notification(int p_what) {
color_rect->set_color(get_theme_color(SNAME("dark_color_1"), EditorStringName(Editor)));
_current_label->begin_bulk_theme_override();
- _current_label->add_theme_font_override("font", get_theme_font(SNAME("status_source"), EditorStringName(EditorFonts)));
- _current_label->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("status_source_size"), EditorStringName(EditorFonts)));
+ _current_label->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("status_source"), EditorStringName(EditorFonts)));
+ _current_label->add_theme_font_size_override(SceneStringName(font_size), get_theme_font_size(SNAME("status_source_size"), EditorStringName(EditorFonts)));
_current_label->end_bulk_theme_override();
_duration_label->begin_bulk_theme_override();
- _duration_label->add_theme_font_override("font", get_theme_font(SNAME("status_source"), EditorStringName(EditorFonts)));
- _duration_label->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("status_source_size"), EditorStringName(EditorFonts)));
+ _duration_label->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("status_source"), EditorStringName(EditorFonts)));
+ _duration_label->add_theme_font_size_override(SceneStringName(font_size), get_theme_font_size(SNAME("status_source_size"), EditorStringName(EditorFonts)));
_duration_label->end_bulk_theme_override();
zoom_in->set_icon(get_editor_theme_icon(SNAME("ZoomMore")));
diff --git a/editor/import/dynamic_font_import_settings.cpp b/editor/import/dynamic_font_import_settings.cpp
index 9b6a7b9a93..7f7f27343f 100644
--- a/editor/import/dynamic_font_import_settings.cpp
+++ b/editor/import/dynamic_font_import_settings.cpp
@@ -487,8 +487,8 @@ void DynamicFontImportSettingsDialog::_main_prop_changed(const String &p_edited_
}
}
- font_preview_label->add_theme_font_override("font", font_preview);
- font_preview_label->add_theme_font_size_override("font_size", 200 * EDSCALE);
+ font_preview_label->add_theme_font_override(SceneStringName(font), font_preview);
+ font_preview_label->add_theme_font_size_override(SceneStringName(font_size), 200 * EDSCALE);
font_preview_label->queue_redraw();
}
@@ -643,7 +643,7 @@ void DynamicFontImportSettingsDialog::_change_text_opts() {
font_main_text->set_variation_face_index(import_variation_data->get("variation_face_index"));
font_main_text->set_variation_transform(import_variation_data->get("variation_transform"));
- text_edit->add_theme_font_override("font", font_main_text);
+ text_edit->add_theme_font_override(SceneStringName(font), font_main_text);
}
void DynamicFontImportSettingsDialog::_glyph_update_lbl() {
@@ -837,7 +837,7 @@ void DynamicFontImportSettingsDialog::_edit_range(int32_t p_start, int32_t p_end
item->set_selectable(col + 1, true);
item->set_custom_font(col + 1, font_main_big);
- item->set_custom_font_size(col + 1, get_theme_font_size(SNAME("font_size")) * 2);
+ item->set_custom_font_size(col + 1, get_theme_font_size(SceneStringName(font_size)) * 2);
col++;
if (col == 16) {
@@ -929,7 +929,7 @@ void DynamicFontImportSettingsDialog::_notification(int p_what) {
case NOTIFICATION_THEME_CHANGED: {
add_var->set_icon(get_editor_theme_icon(SNAME("Add")));
- label_warn->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
+ label_warn->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
} break;
}
}
@@ -1097,7 +1097,7 @@ void DynamicFontImportSettingsDialog::open_settings(const String &p_path) {
font_main->set_data(font_data);
font_main->set_multichannel_signed_distance_field(false);
- text_edit->add_theme_font_override("font", font_main);
+ text_edit->add_theme_font_override(SceneStringName(font), font_main);
base_path = p_path;
@@ -1119,7 +1119,7 @@ void DynamicFontImportSettingsDialog::open_settings(const String &p_path) {
inspector_text->edit(text_settings_data.ptr());
- int gww = get_theme_font(SNAME("font"))->get_string_size("00000").x + 50;
+ int gww = get_theme_font(SceneStringName(font))->get_string_size("00000").x + 50;
glyph_table->set_column_custom_minimum_width(0, gww);
glyph_table->clear();
vars_list->clear();
@@ -1226,8 +1226,8 @@ void DynamicFontImportSettingsDialog::open_settings(const String &p_path) {
font_preview->set_subpixel_positioning((TextServer::SubpixelPositioning)import_settings_data->get("subpixel_positioning").operator int());
font_preview->set_oversampling(import_settings_data->get("oversampling"));
}
- font_preview_label->add_theme_font_override("font", font_preview);
- font_preview_label->add_theme_font_size_override("font_size", 200 * EDSCALE);
+ font_preview_label->add_theme_font_override(SceneStringName(font), font_preview);
+ font_preview_label->add_theme_font_size_override(SceneStringName(font_size), 200 * EDSCALE);
font_preview_label->queue_redraw();
_variations_validate();
diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp
index 2347c715a8..9dc7c43684 100644
--- a/editor/import_dock.cpp
+++ b/editor/import_dock.cpp
@@ -726,7 +726,7 @@ void ImportDock::_notification(int p_what) {
case NOTIFICATION_ENTER_TREE: {
import_opts->edit(params);
- label_warning->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
+ label_warning->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
} break;
}
}
@@ -739,12 +739,12 @@ void ImportDock::_set_dirty(bool p_dirty) {
if (p_dirty) {
// Add a dirty marker to notify the user that they should reimport the selected resource to see changes.
import->set_text(TTR("Reimport") + " (*)");
- import->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
+ import->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
import->set_tooltip_text(TTR("You have pending changes that haven't been applied yet. Click Reimport to apply changes made to the import options.\nSelecting another resource in the FileSystem dock without clicking Reimport first will discard changes made in the Import dock."));
} else {
// Remove the dirty marker on the Reimport button.
import->set_text(TTR("Reimport"));
- import->remove_theme_color_override("font_color");
+ import->remove_theme_color_override(SceneStringName(font_color));
import->set_tooltip_text("");
}
}
diff --git a/editor/input_event_configuration_dialog.cpp b/editor/input_event_configuration_dialog.cpp
index 2ecce2f739..f23d593fb7 100644
--- a/editor/input_event_configuration_dialog.cpp
+++ b/editor/input_event_configuration_dialog.cpp
@@ -583,7 +583,7 @@ void InputEventConfigurationDialog::_notification(int p_what) {
icon_cache.joypad_button = get_editor_theme_icon(SNAME("JoyButton"));
icon_cache.joypad_axis = get_editor_theme_icon(SNAME("JoyAxis"));
- event_as_text->add_theme_font_override("font", get_theme_font(SNAME("bold"), EditorStringName(EditorFonts)));
+ event_as_text->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("bold"), EditorStringName(EditorFonts)));
_update_input_list();
} break;
@@ -646,7 +646,7 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() {
event_as_text->set_custom_minimum_size(Size2(500, 0) * EDSCALE);
event_as_text->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
event_as_text->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
- event_as_text->add_theme_font_size_override("font_size", 18 * EDSCALE);
+ event_as_text->add_theme_font_size_override(SceneStringName(font_size), 18 * EDSCALE);
main_vbox->add_child(event_as_text);
event_listener = memnew(EventListenerLineEdit);
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp
index ad2e16636b..43b5cb711e 100644
--- a/editor/inspector_dock.cpp
+++ b/editor/inspector_dock.cpp
@@ -451,10 +451,10 @@ void InspectorDock::_notification(int p_what) {
search->set_right_icon(get_editor_theme_icon(SNAME("Search")));
if (info_is_warning) {
info->set_icon(get_editor_theme_icon(SNAME("NodeWarning")));
- info->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
+ info->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
} else {
info->set_icon(get_editor_theme_icon(SNAME("NodeInfo")));
- info->add_theme_color_override("font_color", get_theme_color(SNAME("font_color"), EditorStringName(Editor)));
+ info->add_theme_color_override(SceneStringName(font_color), get_theme_color(SceneStringName(font_color), EditorStringName(Editor)));
}
} break;
}
@@ -481,10 +481,10 @@ void InspectorDock::set_info(const String &p_button_text, const String &p_messag
if (info_is_warning) {
info->set_icon(get_editor_theme_icon(SNAME("NodeWarning")));
- info->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
+ info->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
} else {
info->set_icon(get_editor_theme_icon(SNAME("NodeInfo")));
- info->add_theme_color_override("font_color", get_theme_color(SNAME("font_color"), EditorStringName(Editor)));
+ info->add_theme_color_override(SceneStringName(font_color), get_theme_color(SceneStringName(font_color), EditorStringName(Editor)));
}
if (!p_button_text.is_empty() && !p_message.is_empty()) {
diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp
index b1279e4192..fbdf42a717 100644
--- a/editor/plugins/abstract_polygon_2d_editor.cpp
+++ b/editor/plugins/abstract_polygon_2d_editor.cpp
@@ -579,7 +579,7 @@ void AbstractPolygon2DEditor::forward_canvas_draw_over_viewport(Control *p_overl
String num = String::num(vertex.vertex);
Size2 num_size = font->get_string_size(num, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size);
const float outline_size = 4;
- Color font_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
+ Color font_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
Color outline_color = font_color.inverted();
p_overlay->draw_string_outline(font, point - num_size * 0.5, num, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, outline_size, outline_color);
p_overlay->draw_string(font, point - num_size * 0.5, num, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color);
diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp
index 52ea7ff0ba..de031c1a57 100644
--- a/editor/plugins/animation_blend_space_1d_editor.cpp
+++ b/editor/plugins/animation_blend_space_1d_editor.cpp
@@ -217,12 +217,12 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_draw() {
return;
}
- Color linecolor = get_theme_color(SNAME("font_color"), SNAME("Label"));
+ Color linecolor = get_theme_color(SceneStringName(font_color), SNAME("Label"));
Color linecolor_soft = linecolor;
linecolor_soft.a *= 0.5;
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
Ref<Texture2D> icon = get_editor_theme_icon(SNAME("KeyValue"));
Ref<Texture2D> icon_selected = get_editor_theme_icon(SNAME("KeySelected"));
@@ -574,7 +574,7 @@ void AnimationNodeBlendSpace1DEditor::_notification(int p_what) {
case NOTIFICATION_ENTER_TREE:
case NOTIFICATION_THEME_CHANGED: {
error_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree")));
- error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ error_label->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree")));
tool_blend->set_icon(get_editor_theme_icon(SNAME("EditPivot")));
tool_select->set_icon(get_editor_theme_icon(SNAME("ToolSelect")));
diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp
index ef61a95ee7..318e132095 100644
--- a/editor/plugins/animation_blend_space_2d_editor.cpp
+++ b/editor/plugins/animation_blend_space_2d_editor.cpp
@@ -445,11 +445,11 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_draw() {
return;
}
- Color linecolor = get_theme_color(SNAME("font_color"), SNAME("Label"));
+ Color linecolor = get_theme_color(SceneStringName(font_color), SNAME("Label"));
Color linecolor_soft = linecolor;
linecolor_soft.a *= 0.5;
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
Ref<Texture2D> icon = get_editor_theme_icon(SNAME("KeyValue"));
Ref<Texture2D> icon_selected = get_editor_theme_icon(SNAME("KeySelected"));
@@ -796,7 +796,7 @@ void AnimationNodeBlendSpace2DEditor::_notification(int p_what) {
case NOTIFICATION_ENTER_TREE:
case NOTIFICATION_THEME_CHANGED: {
error_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree")));
- error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ error_label->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree")));
tool_blend->set_icon(get_editor_theme_icon(SNAME("EditPivot")));
tool_select->set_icon(get_editor_theme_icon(SNAME("ToolSelect")));
diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp
index 28e1eeccc4..4e19458ea4 100644
--- a/editor/plugins/animation_blend_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp
@@ -165,7 +165,7 @@ void AnimationNodeBlendTreeEditor::update_graph() {
name->set_editable(!read_only);
name->set_expand_to_text_length_enabled(true);
node->add_child(name);
- node->set_slot(0, false, 0, Color(), true, read_only ? -1 : 0, get_theme_color(SNAME("font_color"), SNAME("Label")));
+ node->set_slot(0, false, 0, Color(), true, read_only ? -1 : 0, get_theme_color(SceneStringName(font_color), SNAME("Label")));
name->connect("text_submitted", callable_mp(this, &AnimationNodeBlendTreeEditor::_node_renamed).bind(agnode), CONNECT_DEFERRED);
name->connect(SceneStringName(focus_exited), callable_mp(this, &AnimationNodeBlendTreeEditor::_node_renamed_focus_out).bind(agnode), CONNECT_DEFERRED);
name->connect("text_changed", callable_mp(this, &AnimationNodeBlendTreeEditor::_node_rename_lineedit_changed), CONNECT_DEFERRED);
@@ -186,7 +186,7 @@ void AnimationNodeBlendTreeEditor::update_graph() {
Label *in_name = memnew(Label);
node->add_child(in_name);
in_name->set_text(agnode->get_input_name(i));
- node->set_slot(base + i, true, read_only ? -1 : 0, get_theme_color(SNAME("font_color"), SNAME("Label")), false, 0, Color());
+ node->set_slot(base + i, true, read_only ? -1 : 0, get_theme_color(SceneStringName(font_color), SNAME("Label")), false, 0, Color());
}
List<PropertyInfo> pinfo;
@@ -943,7 +943,7 @@ void AnimationNodeBlendTreeEditor::_notification(int p_what) {
case NOTIFICATION_THEME_CHANGED: {
error_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree")));
- error_label->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ error_label->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
if (is_visible_in_tree()) {
update_graph();
diff --git a/editor/plugins/animation_library_editor.cpp b/editor/plugins/animation_library_editor.cpp
index a2f1fa5614..a00dbe2754 100644
--- a/editor/plugins/animation_library_editor.cpp
+++ b/editor/plugins/animation_library_editor.cpp
@@ -76,7 +76,7 @@ void AnimationLibraryEditor::_add_library_validate(const String &p_name) {
}
if (error != "") {
- add_library_validate->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ add_library_validate->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
add_library_validate->set_text(error);
add_library_dialog->get_ok_button()->set_disabled(true);
} else {
@@ -89,7 +89,7 @@ void AnimationLibraryEditor::_add_library_validate(const String &p_name) {
add_library_validate->set_text(TTR("Library name is valid."));
}
}
- add_library_validate->add_theme_color_override("font_color", get_theme_color(SNAME("success_color"), EditorStringName(Editor)));
+ add_library_validate->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("success_color"), EditorStringName(Editor)));
add_library_dialog->get_ok_button()->set_disabled(false);
}
}
diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp
index 8be010c00b..1ae5298a55 100644
--- a/editor/plugins/animation_state_machine_editor.cpp
+++ b/editor/plugins/animation_state_machine_editor.cpp
@@ -1269,7 +1269,7 @@ void AnimationNodeStateMachineEditor::_notification(int p_what) {
case NOTIFICATION_THEME_CHANGED: {
panel->add_theme_style_override(SceneStringName(panel), theme_cache.panel_style);
error_panel->add_theme_style_override(SceneStringName(panel), theme_cache.error_panel_style);
- error_label->add_theme_color_override("font_color", theme_cache.error_color);
+ error_label->add_theme_color_override(SceneStringName(font_color), theme_cache.error_color);
tool_select->set_icon(theme_cache.tool_icon_select);
tool_create->set_icon(theme_cache.tool_icon_create);
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index 25c173ed35..2dce0904e4 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -91,9 +91,9 @@ void EditorAssetLibraryItem::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
icon->set_texture_normal(get_editor_theme_icon(SNAME("ProjectIconLoading")));
- category->add_theme_color_override("font_color", Color(0.5, 0.5, 0.5));
- author->add_theme_color_override("font_color", Color(0.5, 0.5, 0.5));
- price->add_theme_color_override("font_color", Color(0.5, 0.5, 0.5));
+ category->add_theme_color_override(SceneStringName(font_color), Color(0.5, 0.5, 0.5));
+ author->add_theme_color_override(SceneStringName(font_color), Color(0.5, 0.5, 0.5));
+ price->add_theme_color_override(SceneStringName(font_color), Color(0.5, 0.5, 0.5));
if (author->get_default_cursor_shape() == CURSOR_ARROW) {
// Disable visible feedback if author link isn't clickable.
@@ -457,7 +457,7 @@ void EditorAssetLibraryItemDownload::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_THEME_CHANGED: {
panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("AssetLib")));
- status->add_theme_color_override("font_color", get_theme_color(SNAME("status_color"), SNAME("AssetLib")));
+ status->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("status_color"), SNAME("AssetLib")));
dismiss_button->set_texture_normal(get_theme_icon(SNAME("dismiss"), SNAME("AssetLib")));
} break;
diff --git a/editor/plugins/audio_stream_editor_plugin.cpp b/editor/plugins/audio_stream_editor_plugin.cpp
index af6bbb679a..f691bad3c3 100644
--- a/editor/plugins/audio_stream_editor_plugin.cpp
+++ b/editor/plugins/audio_stream_editor_plugin.cpp
@@ -47,8 +47,8 @@ void AudioStreamEditor::_notification(int p_what) {
case NOTIFICATION_ENTER_TREE: {
Ref<Font> font = get_theme_font(SNAME("status_source"), EditorStringName(EditorFonts));
- _current_label->add_theme_font_override(SNAME("font"), font);
- _duration_label->add_theme_font_override(SNAME("font"), font);
+ _current_label->add_theme_font_override(SceneStringName(font), font);
+ _duration_label->add_theme_font_override(SceneStringName(font), font);
_play_button->set_icon(get_editor_theme_icon(SNAME("MainPlay")));
_stop_button->set_icon(get_editor_theme_icon(SNAME("Stop")));
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 5c7d02dcfa..196df7f33e 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -2786,10 +2786,10 @@ Control::CursorShape CanvasItemEditor::get_cursor_shape(const Point2 &p_pos) con
}
void CanvasItemEditor::_draw_text_at_position(Point2 p_position, const String &p_string, Side p_side) {
- Color color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
+ Color color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
color.a = 0.8;
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
Size2 text_size = font->get_string_size(p_string, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size);
switch (p_side) {
case SIDE_LEFT:
@@ -2855,7 +2855,7 @@ void CanvasItemEditor::_draw_guides() {
}
// Dragged guide.
- Color text_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
+ Color text_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
Color outline_color = text_color.inverted();
const float outline_size = 2;
if (drag_type == DRAG_DOUBLE_GUIDE || drag_type == DRAG_V_GUIDE) {
@@ -2894,8 +2894,8 @@ void CanvasItemEditor::_draw_smart_snapping() {
void CanvasItemEditor::_draw_rulers() {
Color bg_color = get_theme_color(SNAME("dark_color_2"), EditorStringName(Editor));
- Color graduation_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor)).lerp(bg_color, 0.5);
- Color font_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
+ Color graduation_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor)).lerp(bg_color, 0.5);
+ Color font_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
font_color.a = 0.8;
Ref<Font> font = get_theme_font(SNAME("rulers"), EditorStringName(EditorFonts));
int font_size = get_theme_font_size(SNAME("rulers_size"), EditorStringName(EditorFonts));
@@ -3074,7 +3074,7 @@ void CanvasItemEditor::_draw_ruler_tool() {
Ref<Font> font = get_theme_font(SNAME("bold"), EditorStringName(EditorFonts));
int font_size = 1.3 * get_theme_font_size(SNAME("bold_size"), EditorStringName(EditorFonts));
- Color font_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
+ Color font_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
Color font_secondary_color = font_color;
font_secondary_color.set_v(font_secondary_color.get_v() > 0.5 ? 0.7 : 0.3);
Color outline_color = font_color.inverted();
@@ -3741,8 +3741,8 @@ void CanvasItemEditor::_draw_hover() {
Ref<Texture2D> node_icon = hovering_results[i].icon;
String node_name = hovering_results[i].name;
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
Size2 node_name_size = font->get_string_size(node_name, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size);
Size2 item_size = Size2(icon_size.x + 4 + node_name_size.x, MAX(icon_size.y, node_name_size.y - 3));
@@ -3815,8 +3815,8 @@ void CanvasItemEditor::_draw_message() {
return;
}
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
Point2 msgpos = Point2(RULER_WIDTH + 5 * EDSCALE, viewport->get_size().y - 20 * EDSCALE);
viewport->draw_string(font, msgpos + Point2(1, 1), message, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(0, 0, 0, 0.8));
viewport->draw_string(font, msgpos + Point2(-1, -1), message, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(0, 0, 0, 0.8));
@@ -6218,7 +6218,7 @@ void CanvasItemEditorViewport::_update_theme() {
check->set_icon(get_editor_theme_icon(check->get_text()));
}
- label->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
+ label->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
}
void CanvasItemEditorViewport::_notification(int p_what) {
@@ -6295,7 +6295,7 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(CanvasItemEditor *p_canvas_it
canvas_item_editor->get_controls_container()->add_child(label);
label_desc = memnew(Label);
- label_desc->add_theme_color_override("font_color", Color(0.6f, 0.6f, 0.6f, 1));
+ label_desc->add_theme_color_override(SceneStringName(font_color), Color(0.6f, 0.6f, 0.6f, 1));
label_desc->add_theme_color_override("font_shadow_color", Color(0.2f, 0.2f, 0.2f, 1));
label_desc->add_theme_constant_override("shadow_outline_size", 1 * EDSCALE);
label_desc->add_theme_constant_override("line_spacing", 0);
diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp
index 278543dc36..99157793ba 100644
--- a/editor/plugins/curve_editor_plugin.cpp
+++ b/editor/plugins/curve_editor_plugin.cpp
@@ -658,8 +658,8 @@ void CurveEdit::set_selected_index(int p_index) {
}
void CurveEdit::update_view_transform() {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
const real_t margin = font->get_height(font_size) + 2 * EDSCALE;
@@ -820,10 +820,10 @@ void CurveEdit::_redraw() {
// Draw number markings.
draw_set_transform_matrix(Transform2D());
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
float font_height = font->get_height(font_size);
- Color text_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
+ Color text_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
for (int i = 0; i <= grid_steps.x; ++i) {
real_t x = i * step_size.x;
@@ -841,8 +841,8 @@ void CurveEdit::_redraw() {
// The scaling up ensures that the curve rendering doesn't break when we use a quad line to draw it.
draw_set_transform_matrix(Transform2D(0, get_view_pos(Vector2(0, 0))));
- const Color line_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
- const Color edge_line_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor)) * Color(1, 1, 1, 0.75);
+ const Color line_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
+ const Color edge_line_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor)) * Color(1, 1, 1, 0.75);
CanvasItemPlotCurve plot_func(*this, line_color, edge_line_color);
plot_curve_accurate(**curve, 2.f, (get_view_pos(Vector2(1, curve->get_max_value())) - get_view_pos(Vector2(0, curve->get_min_value()))) / Vector2(1, curve->get_range()), plot_func);
@@ -852,7 +852,7 @@ void CurveEdit::_redraw() {
bool shift_pressed = Input::get_singleton()->is_key_pressed(Key::SHIFT);
- const Color point_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
+ const Color point_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
for (int i = 0; i < curve->get_point_count(); ++i) {
Vector2 pos = get_view_pos(curve->get_point_position(i));
@@ -873,7 +873,7 @@ void CurveEdit::_redraw() {
// Draw tangents if not dragging a point, or if holding a point without having moved it yet.
if (grabbing == GRAB_NONE || initial_grab_pos == point_pos || selected_tangent_index != TANGENT_NONE) {
const Color selected_tangent_color = get_theme_color(SNAME("accent_color"), EditorStringName(Editor)).darkened(0.25);
- const Color tangent_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor)).darkened(0.25);
+ const Color tangent_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor)).darkened(0.25);
if (selected_index != 0) {
Vector2 control_pos = get_tangent_view_pos(selected_index, TANGENT_LEFT);
diff --git a/editor/plugins/font_config_plugin.cpp b/editor/plugins/font_config_plugin.cpp
index 6d1e102808..15b268337f 100644
--- a/editor/plugins/font_config_plugin.cpp
+++ b/editor/plugins/font_config_plugin.cpp
@@ -892,9 +892,9 @@ void FontPreview::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_DRAW: {
// Draw font name (style).
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
- Color text_color = get_theme_color(SNAME("font_color"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
+ Color text_color = get_theme_color(SceneStringName(font_color), SNAME("Label"));
// Draw font preview.
bool prev_ok = true;
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 4c8202916b..0887075e8b 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -2967,14 +2967,14 @@ void Node3DEditorViewport::_notification(int p_what) {
// Middle point is at 15 ms.
cpu_time_label->set_text(vformat(TTR("CPU Time: %s ms"), rtos(cpu_time).pad_decimals(2)));
cpu_time_label->add_theme_color_override(
- "font_color",
+ SceneStringName(font_color),
frame_time_gradient->get_color_at_offset(
Math::remap(cpu_time, 0, 30, 0, 1)));
gpu_time_label->set_text(vformat(TTR("GPU Time: %s ms"), rtos(gpu_time).pad_decimals(2)));
// Middle point is at 15 ms.
gpu_time_label->add_theme_color_override(
- "font_color",
+ SceneStringName(font_color),
frame_time_gradient->get_color_at_offset(
Math::remap(gpu_time, 0, 30, 0, 1)));
@@ -2982,7 +2982,7 @@ void Node3DEditorViewport::_notification(int p_what) {
fps_label->set_text(vformat(TTR("FPS: %d"), fps));
// Middle point is at 60 FPS.
fps_label->add_theme_color_override(
- "font_color",
+ SceneStringName(font_color),
frame_time_gradient->get_color_at_offset(
Math::remap(fps, 110, 10, 0, 1)));
}
@@ -3146,8 +3146,8 @@ void Node3DEditorViewport::_draw() {
RID ci = surface->get_canvas_item();
if (message_time > 0) {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
Point2 msgpos = Point2(5, get_size().y - 20);
font->draw_string(ci, msgpos + Point2(1, 1), message, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(0, 0, 0, 0.8));
font->draw_string(ci, msgpos + Point2(-1, -1), message, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(0, 0, 0, 0.8));
@@ -3225,8 +3225,8 @@ void Node3DEditorViewport::_draw() {
*surface,
1.0 - logscale_t,
get_editor_theme_icon(SNAME("ViewportSpeed")),
- get_theme_font(SNAME("font"), SNAME("Label")),
- get_theme_font_size(SNAME("font_size"), SNAME("Label")),
+ get_theme_font(SceneStringName(font), SNAME("Label")),
+ get_theme_font_size(SceneStringName(font_size), SNAME("Label")),
vformat("%s m/s", String::num(freelook_speed).pad_decimals(precision)),
Color(1.0, 0.95, 0.7));
}
@@ -3248,8 +3248,8 @@ void Node3DEditorViewport::_draw() {
*surface,
logscale_t,
get_editor_theme_icon(SNAME("ViewportZoom")),
- get_theme_font(SNAME("font"), SNAME("Label")),
- get_theme_font_size(SNAME("font_size"), SNAME("Label")),
+ get_theme_font(SceneStringName(font), SNAME("Label")),
+ get_theme_font_size(SceneStringName(font_size), SNAME("Label")),
vformat("%s m", String::num(cursor.distance).pad_decimals(precision)),
Color(0.7, 0.95, 1.0));
}
@@ -5387,7 +5387,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p
zoom_limit_label = memnew(Label);
zoom_limit_label->set_text(TTR("To zoom further, change the camera's clipping planes (View -> Settings...)"));
zoom_limit_label->set_name("ZoomLimitMessageLabel");
- zoom_limit_label->add_theme_color_override("font_color", Color(1, 1, 1, 1));
+ zoom_limit_label->add_theme_color_override(SceneStringName(font_color), Color(1, 1, 1, 1));
zoom_limit_label->hide();
bottom_center_vbox->add_child(zoom_limit_label);
@@ -5395,7 +5395,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p
preview_material_label->set_anchors_and_offsets_preset(LayoutPreset::PRESET_BOTTOM_LEFT);
preview_material_label->set_offset(Side::SIDE_TOP, -70 * EDSCALE);
preview_material_label->set_text(TTR("Overriding material..."));
- preview_material_label->add_theme_color_override("font_color", Color(1, 1, 1, 1));
+ preview_material_label->add_theme_color_override(SceneStringName(font_color), Color(1, 1, 1, 1));
preview_material_label->hide();
surface->add_child(preview_material_label);
@@ -5404,7 +5404,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p
preview_material_label_desc->set_offset(Side::SIDE_TOP, -50 * EDSCALE);
Key key = (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios")) ? Key::META : Key::CTRL;
preview_material_label_desc->set_text(vformat(TTR("Drag and drop to override the material of any geometry node.\nHold %s when dropping to override a specific surface."), find_keycode_name(key)));
- preview_material_label_desc->add_theme_color_override("font_color", Color(0.8, 0.8, 0.8, 1));
+ preview_material_label_desc->add_theme_color_override(SceneStringName(font_color), Color(0.8, 0.8, 0.8, 1));
preview_material_label_desc->add_theme_constant_override("line_spacing", 0);
preview_material_label_desc->hide();
surface->add_child(preview_material_label_desc);
@@ -7802,8 +7802,8 @@ void Node3DEditor::_update_theme() {
environ_button->set_icon(get_editor_theme_icon(SNAME("PreviewEnvironment")));
sun_environ_settings->set_icon(get_editor_theme_icon(SNAME("GuiTabMenuHl")));
- sun_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
- environ_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
+ sun_title->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("title_font"), SNAME("Window")));
+ environ_title->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("title_font"), SNAME("Window")));
sun_color->set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("color_picker_button_height"), EditorStringName(Editor))));
environ_sky_color->set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("color_picker_button_height"), EditorStringName(Editor))));
@@ -7850,8 +7850,8 @@ void Node3DEditor::_notification(int p_what) {
case NOTIFICATION_THEME_CHANGED: {
_update_theme();
_update_gizmos_menu_theme();
- sun_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
- environ_title->add_theme_font_override("font", get_theme_font(SNAME("title_font"), SNAME("Window")));
+ sun_title->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("title_font"), SNAME("Window")));
+ environ_title->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("title_font"), SNAME("Window")));
} break;
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 334b253316..f4e354ac48 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -2079,7 +2079,7 @@ void ScriptEditor::_update_script_colors() {
int hist_size = EDITOR_GET("text_editor/script_list/script_temperature_history_size");
Color hot_color = get_theme_color(SNAME("accent_color"), EditorStringName(Editor));
hot_color.set_s(hot_color.get_s() * 0.9);
- Color cold_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
+ Color cold_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
for (int i = 0; i < script_list->get_item_count(); i++) {
int c = script_list->get_item_metadata(i);
diff --git a/editor/plugins/texture_3d_editor_plugin.cpp b/editor/plugins/texture_3d_editor_plugin.cpp
index dc021daaad..d1bc5f2d05 100644
--- a/editor/plugins/texture_3d_editor_plugin.cpp
+++ b/editor/plugins/texture_3d_editor_plugin.cpp
@@ -162,7 +162,7 @@ Texture3DEditor::Texture3DEditor() {
info = memnew(Label);
info->set_h_grow_direction(GROW_DIRECTION_BEGIN);
info->set_v_grow_direction(GROW_DIRECTION_BEGIN);
- info->add_theme_color_override("font_color", Color(1, 1, 1, 1));
+ info->add_theme_color_override(SceneStringName(font_color), Color(1, 1, 1, 1));
info->add_theme_color_override("font_shadow_color", Color(0, 0, 0, 0.5));
info->add_theme_constant_override("shadow_outline_size", 1);
info->add_theme_constant_override("shadow_offset_x", 2);
diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp
index 38d9bb84f4..e9d7aa9eb8 100644
--- a/editor/plugins/texture_editor_plugin.cpp
+++ b/editor/plugins/texture_editor_plugin.cpp
@@ -58,7 +58,7 @@ void TexturePreview::_notification(int p_what) {
if (metadata_label) {
Ref<Font> metadata_label_font = get_theme_font(SNAME("expression"), EditorStringName(EditorFonts));
- metadata_label->add_theme_font_override("font", metadata_label_font);
+ metadata_label->add_theme_font_override(SceneStringName(font), metadata_label_font);
}
checkerboard->set_texture(get_editor_theme_icon(SNAME("Checkerboard")));
@@ -145,10 +145,10 @@ TexturePreview::TexturePreview(Ref<Texture2D> p_texture, bool p_show_metadata) {
p_texture->connect_changed(callable_mp(this, &TexturePreview::_update_metadata_label_text));
// It's okay that these colors are static since the grid color is static too.
- metadata_label->add_theme_color_override("font_color", Color::named("white"));
+ metadata_label->add_theme_color_override(SceneStringName(font_color), Color::named("white"));
metadata_label->add_theme_color_override("font_shadow_color", Color::named("black"));
- metadata_label->add_theme_font_size_override("font_size", 14 * EDSCALE);
+ metadata_label->add_theme_font_size_override(SceneStringName(font_size), 14 * EDSCALE);
metadata_label->add_theme_color_override("font_outline_color", Color::named("black"));
metadata_label->add_theme_constant_override("outline_size", 8 * EDSCALE);
metadata_label->set_h_size_flags(Control::SIZE_SHRINK_END);
diff --git a/editor/plugins/texture_layered_editor_plugin.cpp b/editor/plugins/texture_layered_editor_plugin.cpp
index 2e9040445a..11e476f54d 100644
--- a/editor/plugins/texture_layered_editor_plugin.cpp
+++ b/editor/plugins/texture_layered_editor_plugin.cpp
@@ -238,7 +238,7 @@ TextureLayeredEditor::TextureLayeredEditor() {
info = memnew(Label);
info->set_h_grow_direction(GROW_DIRECTION_BEGIN);
info->set_v_grow_direction(GROW_DIRECTION_BEGIN);
- info->add_theme_color_override("font_color", Color(1, 1, 1, 1));
+ info->add_theme_color_override(SceneStringName(font_color), Color(1, 1, 1, 1));
info->add_theme_color_override("font_shadow_color", Color(0, 0, 0, 0.5));
info->add_theme_constant_override("shadow_outline_size", 1);
info->add_theme_constant_override("shadow_offset_x", 2);
diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp
index b307832ff6..1fd6c3589e 100644
--- a/editor/plugins/theme_editor_plugin.cpp
+++ b/editor/plugins/theme_editor_plugin.cpp
@@ -856,7 +856,7 @@ void ThemeItemImportTree::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_THEME_CHANGED: {
select_icons_warning_icon->set_texture(get_editor_theme_icon(SNAME("StatusWarning")));
- select_icons_warning->add_theme_color_override("font_color", get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor)));
+ select_icons_warning->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor)));
import_items_filter->set_right_icon(get_editor_theme_icon(SNAME("Search")));
@@ -2497,7 +2497,7 @@ HBoxContainer *ThemeTypeEditor::_create_property_control(Theme::DataType p_data_
item_rename_cancel_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_item_rename_canceled).bind(p_data_type, p_item_name, item_name_container));
item_rename_cancel_button->hide();
} else {
- item_name->add_theme_color_override("font_color", get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor)));
+ item_name->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor)));
Button *item_override_button = memnew(Button);
item_override_button->set_icon(get_editor_theme_icon(SNAME("Add")));
diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp
index df90383678..d210741e64 100644
--- a/editor/plugins/tiles/tile_data_editors.cpp
+++ b/editor/plugins/tiles/tile_data_editors.cpp
@@ -245,8 +245,8 @@ void GenericTilePolygonEditor::_base_control_draw() {
// Draw the text on top of the selected point.
if (tinted_polygon_index >= 0) {
- Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
String text = multiple_polygon_mode ? vformat("%d:%d", tinted_polygon_index, tinted_point_index) : vformat("%d", tinted_point_index);
Size2 text_size = font->get_string_size(text, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size);
base_control->draw_string(font, xform.xform(polygons[tinted_polygon_index][tinted_point_index]) - text_size * 0.5, text, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1.0, 1.0, 1.0, 0.5));
diff --git a/editor/plugins/tiles/tile_map_layer_editor.cpp b/editor/plugins/tiles/tile_map_layer_editor.cpp
index 6cf0bec535..fa06c52e3e 100644
--- a/editor/plugins/tiles/tile_map_layer_editor.cpp
+++ b/editor/plugins/tiles/tile_map_layer_editor.cpp
@@ -994,8 +994,8 @@ void TileMapLayerEditorTilesPlugin::forward_canvas_draw_over_viewport(Control *p
}
}
- Ref<Font> font = p_overlay->get_theme_font(SNAME("font"), SNAME("Label"));
- int font_size = p_overlay->get_theme_font_size(SNAME("font_size"), SNAME("Label"));
+ Ref<Font> font = p_overlay->get_theme_font(SceneStringName(font), SNAME("Label"));
+ int font_size = p_overlay->get_theme_font_size(SceneStringName(font_size), SNAME("Label"));
Point2 msgpos = Point2(20 * EDSCALE, p_overlay->get_size().y - 20 * EDSCALE);
String text = tile_set->local_to_map(edited_layer->get_local_mouse_position());
@@ -4333,7 +4333,7 @@ void TileMapLayerEditor::forward_canvas_draw_over_viewport(Control *p_overlay) {
}
// Draw the IDs for debug.
- /*Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label"));
+ /*Ref<Font> font = get_theme_font(SceneStringName(font), SNAME("Label"));
for (int x = displayed_rect.position.x; x < (displayed_rect.position.x + displayed_rect.size.x); x++) {
for (int y = displayed_rect.position.y; y < (displayed_rect.position.y + displayed_rect.size.y); y++) {
p_overlay->draw_string(font, xform.xform(tile_set->map_to_local(Vector2(x, y))) + Vector2i(-tile_shape_size.x / 2, 0), vformat("%s", Vector2(x, y)));
diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
index 9774b7dcec..0003900ac9 100644
--- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
+++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
@@ -929,7 +929,7 @@ void TileSetAtlasSourceEditor::_tile_data_editor_dropdown_button_draw() {
if (tile_data_editor_dropdown_button->has_focus()) {
clr = get_theme_color(SNAME("font_focus_color"));
} else {
- clr = get_theme_color(SNAME("font_color"));
+ clr = get_theme_color(SceneStringName(font_color));
}
}
}
diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp
index 1e88916672..3dfd2bcc04 100644
--- a/editor/plugins/version_control_editor_plugin.cpp
+++ b/editor/plugins/version_control_editor_plugin.cpp
@@ -176,7 +176,7 @@ void VersionControlEditorPlugin::_update_set_up_warning(const String &p_new_text
set_up_ssh_passphrase->get_text().is_empty();
if (empty_settings) {
- set_up_warning_text->add_theme_color_override(SNAME("font_color"), EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("warning_color"), EditorStringName(Editor)));
+ set_up_warning_text->add_theme_color_override(SceneStringName(font_color), EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("warning_color"), EditorStringName(Editor)));
set_up_warning_text->set_text(TTR("Remote settings are empty. VCS features that use the network may not work."));
} else {
set_up_warning_text->set_text("");
@@ -680,7 +680,7 @@ void VersionControlEditorPlugin::_display_diff_split_view(List<EditorVCSInterfac
bool has_change = diff_line.status != " ";
static const Color red = EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("error_color"), EditorStringName(Editor));
static const Color green = EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("success_color"), EditorStringName(Editor));
- static const Color white = EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("font_color"), SNAME("Label")) * Color(1, 1, 1, 0.6);
+ static const Color white = EditorNode::get_singleton()->get_editor_theme()->get_color(SceneStringName(font_color), SNAME("Label")) * Color(1, 1, 1, 0.6);
if (diff_line.old_line_no >= 0) {
diff->push_cell();
@@ -763,7 +763,7 @@ void VersionControlEditorPlugin::_display_diff_unified_view(List<EditorVCSInterf
} else if (diff_line.status == "-") {
color = EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("error_color"), EditorStringName(Editor));
} else {
- color = EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("font_color"), SNAME("Label"));
+ color = EditorNode::get_singleton()->get_editor_theme()->get_color(SceneStringName(font_color), SNAME("Label"));
color *= Color(1, 1, 1, 0.6);
}
@@ -1461,7 +1461,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
change_type_to_color[EditorVCSInterface::CHANGE_TYPE_MODIFIED] = EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("warning_color"), EditorStringName(Editor));
change_type_to_color[EditorVCSInterface::CHANGE_TYPE_RENAMED] = EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("warning_color"), EditorStringName(Editor));
change_type_to_color[EditorVCSInterface::CHANGE_TYPE_DELETED] = EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("error_color"), EditorStringName(Editor));
- change_type_to_color[EditorVCSInterface::CHANGE_TYPE_TYPECHANGE] = EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("font_color"), EditorStringName(Editor));
+ change_type_to_color[EditorVCSInterface::CHANGE_TYPE_TYPECHANGE] = EditorNode::get_singleton()->get_editor_theme()->get_color(SceneStringName(font_color), EditorStringName(Editor));
change_type_to_color[EditorVCSInterface::CHANGE_TYPE_UNMERGED] = EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("warning_color"), EditorStringName(Editor));
change_type_to_icon[EditorVCSInterface::CHANGE_TYPE_NEW] = EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("StatusSuccess"), EditorStringName(EditorIcons));
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index 8d027bccef..0f98c45ac1 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -567,10 +567,10 @@ void VisualShaderGraphPlugin::update_theme() {
Ref<Font> label_font = EditorNode::get_singleton()->get_editor_theme()->get_font("main_msdf", EditorStringName(EditorFonts));
Ref<Font> label_bold_font = EditorNode::get_singleton()->get_editor_theme()->get_font("main_bold_msdf", EditorStringName(EditorFonts));
- vs_msdf_fonts_theme->set_font("font", "Label", label_font);
- vs_msdf_fonts_theme->set_font("font", "GraphNodeTitleLabel", label_bold_font);
- vs_msdf_fonts_theme->set_font("font", "LineEdit", label_font);
- vs_msdf_fonts_theme->set_font("font", "Button", label_font);
+ vs_msdf_fonts_theme->set_font(SceneStringName(font), "Label", label_font);
+ vs_msdf_fonts_theme->set_font(SceneStringName(font), "GraphNodeTitleLabel", label_bold_font);
+ vs_msdf_fonts_theme->set_font(SceneStringName(font), "LineEdit", label_font);
+ vs_msdf_fonts_theme->set_font(SceneStringName(font), "Button", label_font);
}
bool VisualShaderGraphPlugin::is_node_has_parameter_instances_relatively(VisualShader::Type p_type, int p_node) const {
@@ -1149,7 +1149,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
if (vsnode->is_input_port_default(j, mode) && !port_left_used) {
Label *hint_label = memnew(Label);
hint_label->set_text(TTR("[default]"));
- hint_label->add_theme_color_override("font_color", editor->get_theme_color(SNAME("font_readonly_color"), SNAME("TextEdit")));
+ hint_label->add_theme_color_override(SceneStringName(font_color), editor->get_theme_color(SNAME("font_readonly_color"), SNAME("TextEdit")));
hint_label->add_theme_style_override(CoreStringName(normal), editor->get_theme_stylebox(SNAME("label_style"), SNAME("VShaderEditor")));
hb->add_child(hint_label);
}
@@ -1357,7 +1357,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
}
if (!error.is_empty()) {
Label *error_label = memnew(Label);
- error_label->add_theme_color_override("font_color", editor->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ error_label->add_theme_color_override(SceneStringName(font_color), editor->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
error_label->set_text(error);
error_label->set_autowrap_mode(TextServer::AUTOWRAP_WORD);
node->add_child(error_label);
@@ -1394,9 +1394,9 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
}
expression_box->begin_bulk_theme_override();
- expression_box->add_theme_font_override("font", editor->get_theme_font(SNAME("expression"), EditorStringName(EditorFonts)));
- expression_box->add_theme_font_size_override("font_size", editor->get_theme_font_size(SNAME("expression_size"), EditorStringName(EditorFonts)));
- expression_box->add_theme_color_override("font_color", text_color);
+ expression_box->add_theme_font_override(SceneStringName(font), editor->get_theme_font(SNAME("expression"), EditorStringName(EditorFonts)));
+ expression_box->add_theme_font_size_override(SceneStringName(font_size), editor->get_theme_font_size(SNAME("expression_size"), EditorStringName(EditorFonts)));
+ expression_box->add_theme_color_override(SceneStringName(font_color), text_color);
expression_box->end_bulk_theme_override();
expression_syntax_highlighter->set_number_color(number_color);
@@ -4906,7 +4906,7 @@ void VisualShaderEditor::_notification(int p_what) {
Color error_color = get_theme_color(SNAME("error_color"), EditorStringName(Editor));
preview_text->add_theme_color_override("background_color", background_color);
- varying_error_label->add_theme_color_override("font_color", error_color);
+ varying_error_label->add_theme_color_override(SceneStringName(font_color), error_color);
for (const String &E : keyword_list) {
if (ShaderLanguage::is_control_flow_keyword(E)) {
@@ -4917,9 +4917,9 @@ void VisualShaderEditor::_notification(int p_what) {
}
preview_text->begin_bulk_theme_override();
- preview_text->add_theme_font_override("font", get_theme_font(SNAME("expression"), EditorStringName(EditorFonts)));
- preview_text->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("expression_size"), EditorStringName(EditorFonts)));
- preview_text->add_theme_color_override("font_color", text_color);
+ preview_text->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("expression"), EditorStringName(EditorFonts)));
+ preview_text->add_theme_font_size_override(SceneStringName(font_size), get_theme_font_size(SNAME("expression_size"), EditorStringName(EditorFonts)));
+ preview_text->add_theme_color_override(SceneStringName(font_color), text_color);
preview_text->end_bulk_theme_override();
syntax_highlighter->set_number_color(number_color);
@@ -4936,9 +4936,9 @@ void VisualShaderEditor::_notification(int p_what) {
error_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Panel")));
error_label->begin_bulk_theme_override();
- error_label->add_theme_font_override("font", get_theme_font(SNAME("status_source"), EditorStringName(EditorFonts)));
- error_label->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("status_source_size"), EditorStringName(EditorFonts)));
- error_label->add_theme_color_override("font_color", error_color);
+ error_label->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("status_source"), EditorStringName(EditorFonts)));
+ error_label->add_theme_font_size_override(SceneStringName(font_size), get_theme_font_size(SNAME("status_source_size"), EditorStringName(EditorFonts)));
+ error_label->add_theme_color_override(SceneStringName(font_color), error_color);
error_label->end_bulk_theme_override();
}
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 79066608f9..be979f0f15 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -230,15 +230,15 @@ void ProjectManager::_update_theme(bool p_skip_creation) {
// Project list.
{
- loading_label->add_theme_font_override("font", get_theme_font(SNAME("bold"), EditorStringName(EditorFonts)));
+ loading_label->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("bold"), EditorStringName(EditorFonts)));
project_list_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("project_list"), SNAME("ProjectManager")));
empty_list_create_project->set_icon(get_editor_theme_icon(SNAME("Add")));
empty_list_import_project->set_icon(get_editor_theme_icon(SNAME("Load")));
empty_list_open_assetlib->set_icon(get_editor_theme_icon(SNAME("AssetLib")));
- empty_list_online_warning->add_theme_font_override("font", get_theme_font(SNAME("italic"), EditorStringName(EditorFonts)));
- empty_list_online_warning->add_theme_color_override("font_color", get_theme_color(SNAME("font_placeholder_color"), EditorStringName(Editor)));
+ empty_list_online_warning->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("italic"), EditorStringName(EditorFonts)));
+ empty_list_online_warning->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("font_placeholder_color"), EditorStringName(Editor)));
// Top bar.
search_box->set_right_icon(get_editor_theme_icon(SNAME("Search")));
@@ -256,8 +256,8 @@ void ProjectManager::_update_theme(bool p_skip_creation) {
erase_missing_btn->set_icon(get_editor_theme_icon(SNAME("Clear")));
create_tag_btn->set_icon(get_editor_theme_icon("Add"));
- tag_error->add_theme_color_override("font_color", get_theme_color("error_color", EditorStringName(Editor)));
- tag_edit_error->add_theme_color_override("font_color", get_theme_color("error_color", EditorStringName(Editor)));
+ tag_error->add_theme_color_override(SceneStringName(font_color), get_theme_color("error_color", EditorStringName(Editor)));
+ tag_edit_error->add_theme_color_override(SceneStringName(font_color), get_theme_color("error_color", EditorStringName(Editor)));
create_btn->add_theme_constant_override("h_separation", get_theme_constant(SNAME("sidebar_button_icon_separation"), SNAME("ProjectManager")));
import_btn->add_theme_constant_override("h_separation", get_theme_constant(SNAME("sidebar_button_icon_separation"), SNAME("ProjectManager")));
diff --git a/editor/project_manager/project_dialog.cpp b/editor/project_manager/project_dialog.cpp
index 99aa83a09c..90424aa2b8 100644
--- a/editor/project_manager/project_dialog.cpp
+++ b/editor/project_manager/project_dialog.cpp
@@ -54,15 +54,15 @@ void ProjectDialog::_set_message(const String &p_msg, MessageType p_type, InputT
Ref<Texture2D> new_icon;
switch (p_type) {
case MESSAGE_ERROR: {
- msg->add_theme_color_override("font_color", get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ msg->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
new_icon = get_editor_theme_icon(SNAME("StatusError"));
} break;
case MESSAGE_WARNING: {
- msg->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
+ msg->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
new_icon = get_editor_theme_icon(SNAME("StatusWarning"));
} break;
case MESSAGE_SUCCESS: {
- msg->add_theme_color_override("font_color", get_theme_color(SNAME("success_color"), EditorStringName(Editor)));
+ msg->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("success_color"), EditorStringName(Editor)));
new_icon = get_editor_theme_icon(SNAME("StatusSuccess"));
} break;
}
diff --git a/editor/project_manager/project_list.cpp b/editor/project_manager/project_list.cpp
index 0480be508a..092a6a1a18 100644
--- a/editor/project_manager/project_list.cpp
+++ b/editor/project_manager/project_list.cpp
@@ -57,12 +57,12 @@ void ProjectListItemControl::_notification(int p_what) {
}
project_title->begin_bulk_theme_override();
- project_title->add_theme_font_override("font", get_theme_font(SNAME("title"), EditorStringName(EditorFonts)));
- project_title->add_theme_font_size_override("font_size", get_theme_font_size(SNAME("title_size"), EditorStringName(EditorFonts)));
- project_title->add_theme_color_override("font_color", get_theme_color(SNAME("font_color"), SNAME("Tree")));
+ project_title->add_theme_font_override(SceneStringName(font), get_theme_font(SNAME("title"), EditorStringName(EditorFonts)));
+ project_title->add_theme_font_size_override(SceneStringName(font_size), get_theme_font_size(SNAME("title_size"), EditorStringName(EditorFonts)));
+ project_title->add_theme_color_override(SceneStringName(font_color), get_theme_color(SceneStringName(font_color), SNAME("Tree")));
project_title->end_bulk_theme_override();
- project_path->add_theme_color_override("font_color", get_theme_color(SNAME("font_color"), SNAME("Tree")));
+ project_path->add_theme_color_override(SceneStringName(font_color), get_theme_color(SceneStringName(font_color), SNAME("Tree")));
project_unsupported_features->set_texture(get_editor_theme_icon(SNAME("NodeWarning")));
favorite_button->set_texture_normal(get_editor_theme_icon(SNAME("Favorites")));
diff --git a/editor/project_manager/quick_settings_dialog.cpp b/editor/project_manager/quick_settings_dialog.cpp
index c9a43f863e..59b329c739 100644
--- a/editor/project_manager/quick_settings_dialog.cpp
+++ b/editor/project_manager/quick_settings_dialog.cpp
@@ -183,8 +183,8 @@ void QuickSettingsDialog::_notification(int p_what) {
case NOTIFICATION_THEME_CHANGED: {
settings_list_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("Background"), EditorStringName(EditorStyles)));
- restart_required_label->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
- custom_theme_label->add_theme_color_override("font_color", get_theme_color(SNAME("font_placeholder_color"), EditorStringName(Editor)));
+ restart_required_label->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
+ custom_theme_label->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("font_placeholder_color"), EditorStringName(Editor)));
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index 6a6e2b83ab..26b5797d44 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -589,7 +589,7 @@ void ProjectSettingsEditor::_update_theme() {
restart_close_button->set_icon(get_editor_theme_icon(SNAME("Close")));
restart_container->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree")));
restart_icon->set_texture(get_editor_theme_icon(SNAME("StatusWarning")));
- restart_label->add_theme_color_override("font_color", get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
+ restart_label->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));
type_box->clear();
for (int i = 0; i < Variant::VARIANT_MAX; i++) {
diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp
index edefaa61a8..9259ab13ab 100644
--- a/editor/rename_dialog.cpp
+++ b/editor/rename_dialog.cpp
@@ -399,9 +399,9 @@ void RenameDialog::_update_preview(const String &new_text) {
// New name is identical to the old one. Don't color it as much to avoid distracting the user.
const Color accent_color = EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("accent_color"), EditorStringName(Editor));
const Color text_color = EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("default_color"), SNAME("RichTextLabel"));
- lbl_preview->add_theme_color_override("font_color", accent_color.lerp(text_color, 0.5));
+ lbl_preview->add_theme_color_override(SceneStringName(font_color), accent_color.lerp(text_color, 0.5));
} else {
- lbl_preview->add_theme_color_override("font_color", EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("success_color"), EditorStringName(Editor)));
+ lbl_preview->add_theme_color_override(SceneStringName(font_color), EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("success_color"), EditorStringName(Editor)));
}
}
@@ -487,7 +487,7 @@ void RenameDialog::_error_handler(void *p_self, const char *p_func, const char *
self->has_errors = true;
self->lbl_preview_title->set_text(TTR("Regular Expression Error:"));
- self->lbl_preview->add_theme_color_override("font_color", EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("error_color"), EditorStringName(Editor)));
+ self->lbl_preview->add_theme_color_override(SceneStringName(font_color), EditorNode::get_singleton()->get_editor_theme()->get_color(SNAME("error_color"), EditorStringName(Editor)));
self->lbl_preview->set_text(vformat(TTR("At character %s"), err_str));
}
diff --git a/editor/themes/editor_fonts.cpp b/editor/themes/editor_fonts.cpp
index 3f43d3e25b..71a050bc23 100644
--- a/editor/themes/editor_fonts.cpp
+++ b/editor/themes/editor_fonts.cpp
@@ -36,6 +36,7 @@
#include "editor/themes/builtin_fonts.gen.h"
#include "editor/themes/editor_scale.h"
#include "scene/resources/font.h"
+#include "scene/scene_string_names.h"
Ref<FontFile> load_external_font(const String &p_path, TextServer::Hinting p_hinting, TextServer::FontAntialiasing p_aa, bool p_autohint, TextServer::SubpixelPositioning p_font_subpixel_positioning, bool p_font_disable_embedded_bitmaps, bool p_msdf = false, TypedArray<Font> *r_fallbacks = nullptr) {
Ref<FontFile> font;
@@ -401,24 +402,24 @@ void editor_register_fonts(const Ref<Theme> &p_theme) {
p_theme->set_font_size("title_size", EditorStringName(EditorFonts), default_font_size + 1 * EDSCALE);
p_theme->set_type_variation("MainScreenButton", "Button");
- p_theme->set_font("font", "MainScreenButton", bold_fc);
- p_theme->set_font_size("font_size", "MainScreenButton", default_font_size + 2 * EDSCALE);
+ p_theme->set_font(SceneStringName(font), "MainScreenButton", bold_fc);
+ p_theme->set_font_size(SceneStringName(font_size), "MainScreenButton", default_font_size + 2 * EDSCALE);
// Labels.
- p_theme->set_font("font", "Label", default_fc);
+ p_theme->set_font(SceneStringName(font), "Label", default_fc);
p_theme->set_type_variation("HeaderSmall", "Label");
- p_theme->set_font("font", "HeaderSmall", bold_fc);
- p_theme->set_font_size("font_size", "HeaderSmall", default_font_size);
+ p_theme->set_font(SceneStringName(font), "HeaderSmall", bold_fc);
+ p_theme->set_font_size(SceneStringName(font_size), "HeaderSmall", default_font_size);
p_theme->set_type_variation("HeaderMedium", "Label");
- p_theme->set_font("font", "HeaderMedium", bold_fc);
- p_theme->set_font_size("font_size", "HeaderMedium", default_font_size + 1 * EDSCALE);
+ p_theme->set_font(SceneStringName(font), "HeaderMedium", bold_fc);
+ p_theme->set_font_size(SceneStringName(font_size), "HeaderMedium", default_font_size + 1 * EDSCALE);
p_theme->set_type_variation("HeaderLarge", "Label");
- p_theme->set_font("font", "HeaderLarge", bold_fc);
- p_theme->set_font_size("font_size", "HeaderLarge", default_font_size + 3 * EDSCALE);
+ p_theme->set_font(SceneStringName(font), "HeaderLarge", bold_fc);
+ p_theme->set_font_size(SceneStringName(font_size), "HeaderLarge", default_font_size + 3 * EDSCALE);
p_theme->set_font("normal_font", "RichTextLabel", default_fc);
p_theme->set_font("bold_font", "RichTextLabel", bold_fc);
diff --git a/editor/themes/editor_theme_manager.cpp b/editor/themes/editor_theme_manager.cpp
index 10b7c64999..6d8a8fdb38 100644
--- a/editor/themes/editor_theme_manager.cpp
+++ b/editor/themes/editor_theme_manager.cpp
@@ -474,7 +474,7 @@ void EditorThemeManager::_create_shared_styles(const Ref<EditorTheme> &p_theme,
p_config.font_placeholder_color = Color(p_config.mono_color.r, p_config.mono_color.g, p_config.mono_color.b, 0.6);
p_config.font_outline_color = Color(0, 0, 0, 0);
- p_theme->set_color("font_color", EditorStringName(Editor), p_config.font_color);
+ p_theme->set_color(SceneStringName(font_color), EditorStringName(Editor), p_config.font_color);
p_theme->set_color("font_focus_color", EditorStringName(Editor), p_config.font_focus_color);
p_theme->set_color("font_hover_color", EditorStringName(Editor), p_config.font_hover_color);
p_theme->set_color("font_pressed_color", EditorStringName(Editor), p_config.font_pressed_color);
@@ -694,7 +694,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
// TooltipPanel is also used for custom tooltips, while TooltipLabel
// is only relevant for default tooltips.
- p_theme->set_color("font_color", "TooltipLabel", p_config.font_hover_color);
+ p_theme->set_color(SceneStringName(font_color), "TooltipLabel", p_config.font_hover_color);
p_theme->set_color("font_shadow_color", "TooltipLabel", Color(0, 0, 0, 0));
Ref<StyleBoxFlat> style_tooltip = p_config.popup_style->duplicate();
@@ -719,7 +719,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_stylebox("focus", "Button", p_config.button_style_focus);
p_theme->set_stylebox("disabled", "Button", p_config.button_style_disabled);
- p_theme->set_color("font_color", "Button", p_config.font_color);
+ p_theme->set_color(SceneStringName(font_color), "Button", p_config.font_color);
p_theme->set_color("font_hover_color", "Button", p_config.font_hover_color);
p_theme->set_color("font_hover_pressed_color", "Button", p_config.font_hover_pressed_color);
p_theme->set_color("font_focus_color", "Button", p_config.font_focus_color);
@@ -747,7 +747,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_stylebox("focus", "MenuButton", p_config.panel_container_style);
p_theme->set_stylebox("disabled", "MenuButton", p_config.panel_container_style);
- p_theme->set_color("font_color", "MenuButton", p_config.font_color);
+ p_theme->set_color(SceneStringName(font_color), "MenuButton", p_config.font_color);
p_theme->set_color("font_hover_color", "MenuButton", p_config.font_hover_color);
p_theme->set_color("font_hover_pressed_color", "MenuButton", p_config.font_hover_pressed_color);
p_theme->set_color("font_focus_color", "MenuButton", p_config.font_focus_color);
@@ -762,7 +762,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_stylebox(SceneStringName(pressed), "MenuBar", p_config.button_style_pressed);
p_theme->set_stylebox("disabled", "MenuBar", p_config.button_style_disabled);
- p_theme->set_color("font_color", "MenuBar", p_config.font_color);
+ p_theme->set_color(SceneStringName(font_color), "MenuBar", p_config.font_color);
p_theme->set_color("font_hover_color", "MenuBar", p_config.font_hover_color);
p_theme->set_color("font_hover_pressed_color", "MenuBar", p_config.font_hover_pressed_color);
p_theme->set_color("font_focus_color", "MenuBar", p_config.font_focus_color);
@@ -804,7 +804,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_stylebox("pressed_mirrored", "OptionButton", option_button_pressed_style);
p_theme->set_stylebox("disabled_mirrored", "OptionButton", option_button_disabled_style);
- p_theme->set_color("font_color", "OptionButton", p_config.font_color);
+ p_theme->set_color(SceneStringName(font_color), "OptionButton", p_config.font_color);
p_theme->set_color("font_hover_color", "OptionButton", p_config.font_hover_color);
p_theme->set_color("font_hover_pressed_color", "OptionButton", p_config.font_hover_pressed_color);
p_theme->set_color("font_focus_color", "OptionButton", p_config.font_focus_color);
@@ -843,7 +843,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_icon("unchecked_mirrored", "CheckButton", p_theme->get_icon(SNAME("GuiToggleOffMirrored"), EditorStringName(EditorIcons)));
p_theme->set_icon("unchecked_disabled_mirrored", "CheckButton", p_theme->get_icon(SNAME("GuiToggleOffDisabledMirrored"), EditorStringName(EditorIcons)));
- p_theme->set_color("font_color", "CheckButton", p_config.font_color);
+ p_theme->set_color(SceneStringName(font_color), "CheckButton", p_config.font_color);
p_theme->set_color("font_hover_color", "CheckButton", p_config.font_hover_color);
p_theme->set_color("font_hover_pressed_color", "CheckButton", p_config.font_hover_pressed_color);
p_theme->set_color("font_focus_color", "CheckButton", p_config.font_focus_color);
@@ -880,7 +880,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_icon("radio_checked_disabled", "CheckBox", p_theme->get_icon(SNAME("GuiRadioCheckedDisabled"), EditorStringName(EditorIcons)));
p_theme->set_icon("radio_unchecked_disabled", "CheckBox", p_theme->get_icon(SNAME("GuiRadioUncheckedDisabled"), EditorStringName(EditorIcons)));
- p_theme->set_color("font_color", "CheckBox", p_config.font_color);
+ p_theme->set_color(SceneStringName(font_color), "CheckBox", p_config.font_color);
p_theme->set_color("font_hover_color", "CheckBox", p_config.font_hover_color);
p_theme->set_color("font_hover_pressed_color", "CheckBox", p_config.font_hover_pressed_color);
p_theme->set_color("font_focus_color", "CheckBox", p_config.font_focus_color);
@@ -902,7 +902,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
// LinkButton.
p_theme->set_stylebox("focus", "LinkButton", p_config.base_empty_style);
- p_theme->set_color("font_color", "LinkButton", p_config.font_color);
+ p_theme->set_color(SceneStringName(font_color), "LinkButton", p_config.font_color);
p_theme->set_color("font_hover_color", "LinkButton", p_config.font_hover_color);
p_theme->set_color("font_hover_pressed_color", "LinkButton", p_config.font_hover_pressed_color);
p_theme->set_color("font_focus_color", "LinkButton", p_config.font_focus_color);
@@ -944,7 +944,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_stylebox("custom_button_hover", "Tree", p_config.button_style);
p_theme->set_color("custom_button_font_highlight", "Tree", p_config.font_hover_color);
- p_theme->set_color("font_color", "Tree", p_config.font_color);
+ p_theme->set_color(SceneStringName(font_color), "Tree", p_config.font_color);
p_theme->set_color("font_selected_color", "Tree", p_config.mono_color);
p_theme->set_color("font_disabled_color", "Tree", p_config.font_disabled_color);
p_theme->set_color("font_outline_color", "Tree", p_config.font_outline_color);
@@ -1047,7 +1047,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_stylebox("selected_focus", "ItemList", style_tree_focus);
p_theme->set_stylebox("selected", "ItemList", style_tree_selected);
p_theme->set_stylebox("hovered", "ItemList", style_itemlist_hover);
- p_theme->set_color("font_color", "ItemList", p_config.font_color);
+ p_theme->set_color(SceneStringName(font_color), "ItemList", p_config.font_color);
p_theme->set_color("font_hovered_color", "ItemList", p_config.mono_color);
p_theme->set_color("font_selected_color", "ItemList", p_config.mono_color);
p_theme->set_color("font_outline_color", "ItemList", p_config.font_outline_color);
@@ -1194,7 +1194,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_icon("clear", "LineEdit", p_theme->get_icon(SNAME("GuiClose"), EditorStringName(EditorIcons)));
- p_theme->set_color("font_color", "LineEdit", p_config.font_color);
+ p_theme->set_color(SceneStringName(font_color), "LineEdit", p_config.font_color);
p_theme->set_color("font_selected_color", "LineEdit", p_config.mono_color);
p_theme->set_color("font_uneditable_color", "LineEdit", p_config.font_readonly_color);
p_theme->set_color("font_placeholder_color", "LineEdit", p_config.font_placeholder_color);
@@ -1217,7 +1217,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_icon("tab", "TextEdit", p_theme->get_icon(SNAME("GuiTab"), EditorStringName(EditorIcons)));
p_theme->set_icon("space", "TextEdit", p_theme->get_icon(SNAME("GuiSpace"), EditorStringName(EditorIcons)));
- p_theme->set_color("font_color", "TextEdit", p_config.font_color);
+ p_theme->set_color(SceneStringName(font_color), "TextEdit", p_config.font_color);
p_theme->set_color("font_readonly_color", "TextEdit", p_config.font_readonly_color);
p_theme->set_color("font_placeholder_color", "TextEdit", p_config.font_placeholder_color);
p_theme->set_color("font_outline_color", "TextEdit", p_config.font_outline_color);
@@ -1348,7 +1348,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_stylebox("labeled_separator_left", "PopupMenu", style_popup_labeled_separator_left);
p_theme->set_stylebox("labeled_separator_right", "PopupMenu", style_popup_labeled_separator_right);
- p_theme->set_color("font_color", "PopupMenu", p_config.font_color);
+ p_theme->set_color(SceneStringName(font_color), "PopupMenu", p_config.font_color);
p_theme->set_color("font_hover_color", "PopupMenu", p_config.font_hover_color);
p_theme->set_color("font_accelerator_color", "PopupMenu", p_config.font_disabled_color);
p_theme->set_color("font_disabled_color", "PopupMenu", p_config.font_disabled_color);
@@ -1458,7 +1458,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_stylebox(CoreStringName(normal), "Label", p_config.base_empty_style);
- p_theme->set_color("font_color", "Label", p_config.font_color);
+ p_theme->set_color(SceneStringName(font_color), "Label", p_config.font_color);
p_theme->set_color("font_shadow_color", "Label", Color(0, 0, 0, 0));
p_theme->set_color("font_outline_color", "Label", p_config.font_outline_color);
@@ -1476,7 +1476,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
// ProgressBar.
p_theme->set_stylebox("background", "ProgressBar", make_stylebox(p_theme->get_icon(SNAME("GuiProgressBar"), EditorStringName(EditorIcons)), 4, 4, 4, 4, 0, 0, 0, 0));
p_theme->set_stylebox("fill", "ProgressBar", make_stylebox(p_theme->get_icon(SNAME("GuiProgressFill"), EditorStringName(EditorIcons)), 6, 6, 6, 6, 2, 1, 2, 1));
- p_theme->set_color("font_color", "ProgressBar", p_config.font_color);
+ p_theme->set_color(SceneStringName(font_color), "ProgressBar", p_config.font_color);
p_theme->set_color("font_outline_color", "ProgressBar", p_config.font_outline_color);
p_theme->set_constant("outline_size", "ProgressBar", 0);
@@ -1632,7 +1632,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
// GraphNode's title Label.
p_theme->set_type_variation("GraphNodeTitleLabel", "Label");
p_theme->set_stylebox(CoreStringName(normal), "GraphNodeTitleLabel", make_empty_stylebox(0, 0, 0, 0));
- p_theme->set_color("font_color", "GraphNodeTitleLabel", p_config.dark_theme ? p_config.font_color : Color(1, 1, 1)); // Also use a bright font color for light themes.
+ p_theme->set_color(SceneStringName(font_color), "GraphNodeTitleLabel", p_config.dark_theme ? p_config.font_color : Color(1, 1, 1)); // Also use a bright font color for light themes.
p_theme->set_color("font_shadow_color", "GraphNodeTitleLabel", Color(0, 0, 0, 0.35));
p_theme->set_constant("shadow_outline_size", "GraphNodeTitleLabel", 4);
p_theme->set_constant("shadow_offset_x", "GraphNodeTitleLabel", 0);
@@ -1664,8 +1664,8 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
// GraphFrame's title Label.
p_theme->set_type_variation("GraphFrameTitleLabel", "Label");
p_theme->set_stylebox(CoreStringName(normal), "GraphFrameTitleLabel", memnew(StyleBoxEmpty));
- p_theme->set_font_size("font_size", "GraphFrameTitleLabel", 22);
- p_theme->set_color("font_color", "GraphFrameTitleLabel", Color(1, 1, 1));
+ p_theme->set_font_size(SceneStringName(font_size), "GraphFrameTitleLabel", 22);
+ p_theme->set_color(SceneStringName(font_color), "GraphFrameTitleLabel", Color(1, 1, 1));
p_theme->set_color("font_shadow_color", "GraphFrameTitleLabel", Color(0, 0, 0, 0));
p_theme->set_color("font_outline_color", "GraphFrameTitleLabel", Color(1, 1, 1));
p_theme->set_constant("shadow_offset_x", "GraphFrameTitleLabel", 1 * EDSCALE);
@@ -1891,8 +1891,8 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
// Header LinkButton variation.
p_theme->set_type_variation("HeaderSmallLink", "LinkButton");
- p_theme->set_font("font", "HeaderSmallLink", p_theme->get_font(SNAME("font"), SNAME("HeaderSmall")));
- p_theme->set_font_size("font_size", "HeaderSmallLink", p_theme->get_font_size(SNAME("font_size"), SNAME("HeaderSmall")));
+ p_theme->set_font(SceneStringName(font), "HeaderSmallLink", p_theme->get_font(SceneStringName(font), SNAME("HeaderSmall")));
+ p_theme->set_font_size(SceneStringName(font_size), "HeaderSmallLink", p_theme->get_font_size(SceneStringName(font_size), SNAME("HeaderSmall")));
// Flat button variations.
{
@@ -1971,8 +1971,8 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
// Top bar selectors.
{
p_theme->set_type_variation("TopBarOptionButton", "OptionButton");
- p_theme->set_font("font", "TopBarOptionButton", p_theme->get_font(SNAME("bold"), EditorStringName(EditorFonts)));
- p_theme->set_font_size("font_size", "TopBarOptionButton", p_theme->get_font_size(SNAME("bold_size"), EditorStringName(EditorFonts)));
+ p_theme->set_font(SceneStringName(font), "TopBarOptionButton", p_theme->get_font(SNAME("bold"), EditorStringName(EditorFonts)));
+ p_theme->set_font_size(SceneStringName(font_size), "TopBarOptionButton", p_theme->get_font_size(SNAME("bold_size"), EditorStringName(EditorFonts)));
}
// Complex editor windows.
@@ -2102,7 +2102,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
// EditorInspectorSection.
Color inspector_section_color = p_config.font_color.lerp(Color(0.5, 0.5, 0.5), 0.35);
- p_theme->set_color("font_color", "EditorInspectorSection", inspector_section_color);
+ p_theme->set_color(SceneStringName(font_color), "EditorInspectorSection", inspector_section_color);
Color inspector_indent_color = p_config.accent_color;
inspector_indent_color.a = 0.2;
@@ -2358,8 +2358,8 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
sm_node_end_style->set_border_color(p_config.error_color);
p_theme->set_stylebox("node_frame_end", "GraphStateMachine", sm_node_end_style);
- p_theme->set_font("node_title_font", "GraphStateMachine", p_theme->get_font(SNAME("font"), SNAME("Label")));
- p_theme->set_font_size("node_title_font_size", "GraphStateMachine", p_theme->get_font_size(SNAME("font_size"), SNAME("Label")));
+ p_theme->set_font("node_title_font", "GraphStateMachine", p_theme->get_font(SceneStringName(font), SNAME("Label")));
+ p_theme->set_font_size("node_title_font_size", "GraphStateMachine", p_theme->get_font_size(SceneStringName(font_size), SNAME("Label")));
p_theme->set_color("node_title_font_color", "GraphStateMachine", p_config.font_color);
p_theme->set_color("transition_color", "GraphStateMachine", p_config.font_color);
@@ -2482,8 +2482,8 @@ void EditorThemeManager::_populate_text_editor_styles(const Ref<EditorTheme> &p_
}
// Now theme is loaded, apply it to CodeEdit.
- p_theme->set_font("font", "CodeEdit", p_theme->get_font(SNAME("source"), EditorStringName(EditorFonts)));
- p_theme->set_font_size("font_size", "CodeEdit", p_theme->get_font_size(SNAME("source_size"), EditorStringName(EditorFonts)));
+ p_theme->set_font(SceneStringName(font), "CodeEdit", p_theme->get_font(SNAME("source"), EditorStringName(EditorFonts)));
+ p_theme->set_font_size(SceneStringName(font_size), "CodeEdit", p_theme->get_font_size(SNAME("source_size"), EditorStringName(EditorFonts)));
/* clang-format off */
p_theme->set_icon("tab", "CodeEdit", p_theme->get_icon(SNAME("GuiTab"), EditorStringName(EditorIcons)));
@@ -2512,7 +2512,7 @@ void EditorThemeManager::_populate_text_editor_styles(const Ref<EditorTheme> &p_
p_theme->set_color("completion_existing_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_existing_color"));
p_theme->set_color("completion_scroll_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_scroll_color"));
p_theme->set_color("completion_scroll_hovered_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_scroll_hovered_color"));
- p_theme->set_color("font_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/text_color"));
+ p_theme->set_color(SceneStringName(font_color), "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/text_color"));
p_theme->set_color("line_number_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/line_number_color"));
p_theme->set_color("caret_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/caret_color"));
p_theme->set_color("font_selected_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/text_selected_color"));
diff --git a/editor/window_wrapper.cpp b/editor/window_wrapper.cpp
index b75d641509..9496ba016c 100644
--- a/editor/window_wrapper.cpp
+++ b/editor/window_wrapper.cpp
@@ -348,7 +348,7 @@ void ScreenSelect::_build_advanced_menu() {
}
// Populate screen list.
- const real_t height = real_t(get_theme_font_size("font_size")) * 1.5;
+ const real_t height = real_t(get_theme_font_size(SceneStringName(font_size))) * 1.5;
int current_screen = get_window()->get_current_screen();
for (int i = 0; i < DisplayServer::get_singleton()->get_screen_count(); i++) {
@@ -365,7 +365,7 @@ void ScreenSelect::_build_advanced_menu() {
if (i == current_screen) {
Color accent_color = get_theme_color("accent_color", EditorStringName(Editor));
- button->add_theme_color_override("font_color", accent_color);
+ button->add_theme_color_override(SceneStringName(font_color), accent_color);
}
button->connect(SceneStringName(pressed), callable_mp(this, &ScreenSelect::_emit_screen_signal).bind(i));
@@ -393,7 +393,7 @@ void ScreenSelect::_notification(int p_what) {
set_icon(get_editor_theme_icon("MakeFloating"));
popup_background->add_theme_style_override(SceneStringName(panel), get_theme_stylebox("PanelForeground", EditorStringName(EditorStyles)));
- const real_t popup_height = real_t(get_theme_font_size("font_size")) * 2.0;
+ const real_t popup_height = real_t(get_theme_font_size(SceneStringName(font_size))) * 2.0;
popup->set_min_size(Size2(0, popup_height * 3));
} break;
}
diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp
index f83b784f85..eecce70202 100644
--- a/modules/gdscript/editor/gdscript_highlighter.cpp
+++ b/modules/gdscript/editor/gdscript_highlighter.cpp
@@ -690,7 +690,7 @@ void GDScriptSyntaxHighlighter::_update_cache() {
color_regions.clear();
color_region_cache.clear();
- font_color = text_edit->get_theme_color(SNAME("font_color"));
+ font_color = text_edit->get_theme_color(SceneStringName(font_color));
symbol_color = EDITOR_GET("text_editor/theme/highlighting/symbol_color");
function_color = EDITOR_GET("text_editor/theme/highlighting/function_color");
number_color = EDITOR_GET("text_editor/theme/highlighting/number_color");
diff --git a/modules/gltf/editor/editor_scene_importer_blend.cpp b/modules/gltf/editor/editor_scene_importer_blend.cpp
index 822e11ea4b..4ad00c719b 100644
--- a/modules/gltf/editor/editor_scene_importer_blend.cpp
+++ b/modules/gltf/editor/editor_scene_importer_blend.cpp
@@ -395,10 +395,10 @@ void EditorFileSystemImportFormatSupportQueryBlend::_validate_path(String p_path
path_status->set_text(error);
if (success) {
- path_status->add_theme_color_override("font_color", path_status->get_theme_color(SNAME("success_color"), EditorStringName(Editor)));
+ path_status->add_theme_color_override(SceneStringName(font_color), path_status->get_theme_color(SNAME("success_color"), EditorStringName(Editor)));
configure_blender_dialog->get_ok_button()->set_disabled(false);
} else {
- path_status->add_theme_color_override("font_color", path_status->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
+ path_status->add_theme_color_override(SceneStringName(font_color), path_status->get_theme_color(SNAME("error_color"), EditorStringName(Editor)));
configure_blender_dialog->get_ok_button()->set_disabled(true);
}
}
diff --git a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp
index cd3814879a..28b875a4ad 100644
--- a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp
+++ b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp
@@ -161,7 +161,7 @@ void AudioStreamInteractiveTransitionEditor::_update_transitions() {
return;
}
int clip_count = audio_stream_interactive->get_clip_count();
- Color font_color = tree->get_theme_color("font_color", "Tree");
+ Color font_color = tree->get_theme_color(SceneStringName(font_color), "Tree");
Color font_color_default = font_color;
font_color_default.a *= 0.5;
Ref<Texture> fade_icons[5] = {
diff --git a/modules/multiplayer/editor/editor_network_profiler.cpp b/modules/multiplayer/editor/editor_network_profiler.cpp
index 75941207c7..d5d4b465d8 100644
--- a/modules/multiplayer/editor/editor_network_profiler.cpp
+++ b/modules/multiplayer/editor/editor_network_profiler.cpp
@@ -74,8 +74,8 @@ void EditorNetworkProfiler::_update_theme_item_cache() {
theme_cache.incoming_bandwidth_icon = get_theme_icon(SNAME("ArrowDown"), EditorStringName(EditorIcons));
theme_cache.outgoing_bandwidth_icon = get_theme_icon(SNAME("ArrowUp"), EditorStringName(EditorIcons));
- theme_cache.incoming_bandwidth_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
- theme_cache.outgoing_bandwidth_color = get_theme_color(SNAME("font_color"), EditorStringName(Editor));
+ theme_cache.incoming_bandwidth_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
+ theme_cache.outgoing_bandwidth_color = get_theme_color(SceneStringName(font_color), EditorStringName(Editor));
}
void EditorNetworkProfiler::_refresh() {
diff --git a/scene/3d/label_3d.cpp b/scene/3d/label_3d.cpp
index 0f2ce829eb..54adafbefb 100644
--- a/scene/3d/label_3d.cpp
+++ b/scene/3d/label_3d.cpp
@@ -796,7 +796,7 @@ Ref<Font> Label3D::_get_font_or_default() const {
return font_override;
}
- const StringName theme_name = "font";
+ const StringName theme_name = SceneStringName(font);
List<StringName> theme_types;
ThemeDB::get_singleton()->get_native_type_dependencies(get_class_name(), &theme_types);
diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp
index 58724cf4e9..23b99d1e53 100644
--- a/scene/gui/tab_container.cpp
+++ b/scene/gui/tab_container.cpp
@@ -243,8 +243,8 @@ void TabContainer::_on_theme_changed() {
tab_bar->add_theme_color_override(SNAME("font_disabled_color"), theme_cache.font_disabled_color);
tab_bar->add_theme_color_override(SNAME("font_outline_color"), theme_cache.font_outline_color);
- tab_bar->add_theme_font_override(SNAME("font"), theme_cache.tab_font);
- tab_bar->add_theme_font_size_override(SNAME("font_size"), theme_cache.tab_font_size);
+ tab_bar->add_theme_font_override(SceneStringName(font), theme_cache.tab_font);
+ tab_bar->add_theme_font_size_override(SceneStringName(font_size), theme_cache.tab_font_size);
tab_bar->add_theme_constant_override(SNAME("h_separation"), theme_cache.icon_separation);
tab_bar->add_theme_constant_override(SNAME("icon_max_width"), theme_cache.icon_max_width);
diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp
index c6a2151de5..6a05aa78da 100644
--- a/scene/scene_string_names.cpp
+++ b/scene/scene_string_names.cpp
@@ -101,6 +101,9 @@ SceneStringNames::SceneStringNames() {
area_exited = StaticCString::create("area_exited");
line_separation = StaticCString::create("line_separation");
+ font = StaticCString::create("font");
+ font_size = StaticCString::create("font_size");
+ font_color = StaticCString::create("font_color");
frame_changed = StaticCString::create("frame_changed");
texture_changed = StaticCString::create("texture_changed");
diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h
index 9af5422391..db11ec36a3 100644
--- a/scene/scene_string_names.h
+++ b/scene/scene_string_names.h
@@ -70,6 +70,9 @@ public:
StringName updated;
StringName line_separation;
+ StringName font;
+ StringName font_size;
+ StringName font_color;
StringName mouse_entered;
StringName mouse_exited;
diff --git a/scene/theme/default_theme.cpp b/scene/theme/default_theme.cpp
index 5315b0acc9..b2a3843b02 100644
--- a/scene/theme/default_theme.cpp
+++ b/scene/theme/default_theme.cpp
@@ -165,11 +165,11 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox("disabled", "Button", button_disabled);
theme->set_stylebox("focus", "Button", focus);
- theme->set_font("font", "Button", Ref<Font>());
- theme->set_font_size("font_size", "Button", -1);
+ theme->set_font(SceneStringName(font), "Button", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "Button", -1);
theme->set_constant("outline_size", "Button", 0);
- theme->set_color("font_color", "Button", control_font_color);
+ theme->set_color(SceneStringName(font_color), "Button", control_font_color);
theme->set_color("font_pressed_color", "Button", control_font_pressed_color);
theme->set_color("font_hover_color", "Button", control_font_hover_color);
theme->set_color("font_focus_color", "Button", control_font_focus_color);
@@ -195,11 +195,11 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox(SceneStringName(pressed), "MenuBar", button_pressed);
theme->set_stylebox("disabled", "MenuBar", button_disabled);
- theme->set_font("font", "MenuBar", Ref<Font>());
- theme->set_font_size("font_size", "MenuBar", -1);
+ theme->set_font(SceneStringName(font), "MenuBar", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "MenuBar", -1);
theme->set_constant("outline_size", "MenuBar", 0);
- theme->set_color("font_color", "MenuBar", control_font_color);
+ theme->set_color(SceneStringName(font_color), "MenuBar", control_font_color);
theme->set_color("font_pressed_color", "MenuBar", control_font_pressed_color);
theme->set_color("font_hover_color", "MenuBar", control_font_hover_color);
theme->set_color("font_focus_color", "MenuBar", control_font_focus_color);
@@ -213,10 +213,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox("focus", "LinkButton", focus);
- theme->set_font("font", "LinkButton", Ref<Font>());
- theme->set_font_size("font_size", "LinkButton", -1);
+ theme->set_font(SceneStringName(font), "LinkButton", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "LinkButton", -1);
- theme->set_color("font_color", "LinkButton", control_font_color);
+ theme->set_color(SceneStringName(font_color), "LinkButton", control_font_color);
theme->set_color("font_pressed_color", "LinkButton", control_font_pressed_color);
theme->set_color("font_hover_color", "LinkButton", control_font_hover_color);
theme->set_color("font_focus_color", "LinkButton", control_font_focus_color);
@@ -250,10 +250,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_icon("arrow", "OptionButton", icons["option_button_arrow"]);
- theme->set_font("font", "OptionButton", Ref<Font>());
- theme->set_font_size("font_size", "OptionButton", -1);
+ theme->set_font(SceneStringName(font), "OptionButton", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "OptionButton", -1);
- theme->set_color("font_color", "OptionButton", control_font_color);
+ theme->set_color(SceneStringName(font_color), "OptionButton", control_font_color);
theme->set_color("font_pressed_color", "OptionButton", control_font_pressed_color);
theme->set_color("font_hover_color", "OptionButton", control_font_hover_color);
theme->set_color("font_hover_pressed_color", "OptionButton", control_font_pressed_color);
@@ -274,10 +274,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox("disabled", "MenuButton", button_disabled);
theme->set_stylebox("focus", "MenuButton", focus);
- theme->set_font("font", "MenuButton", Ref<Font>());
- theme->set_font_size("font_size", "MenuButton", -1);
+ theme->set_font(SceneStringName(font), "MenuButton", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "MenuButton", -1);
- theme->set_color("font_color", "MenuButton", control_font_color);
+ theme->set_color(SceneStringName(font_color), "MenuButton", control_font_color);
theme->set_color("font_pressed_color", "MenuButton", control_font_pressed_color);
theme->set_color("font_hover_color", "MenuButton", control_font_hover_color);
theme->set_color("font_focus_color", "MenuButton", control_font_focus_color);
@@ -310,10 +310,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_icon("radio_unchecked", "CheckBox", icons["radio_unchecked"]);
theme->set_icon("radio_unchecked_disabled", "CheckBox", icons["radio_unchecked_disabled"]);
- theme->set_font("font", "CheckBox", Ref<Font>());
- theme->set_font_size("font_size", "CheckBox", -1);
+ theme->set_font(SceneStringName(font), "CheckBox", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "CheckBox", -1);
- theme->set_color("font_color", "CheckBox", control_font_color);
+ theme->set_color(SceneStringName(font_color), "CheckBox", control_font_color);
theme->set_color("font_pressed_color", "CheckBox", control_font_pressed_color);
theme->set_color("font_hover_color", "CheckBox", control_font_hover_color);
theme->set_color("font_hover_pressed_color", "CheckBox", control_font_pressed_color);
@@ -347,10 +347,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_icon("unchecked_mirrored", "CheckButton", icons["toggle_off_mirrored"]);
theme->set_icon("unchecked_disabled_mirrored", "CheckButton", icons["toggle_off_disabled_mirrored"]);
- theme->set_font("font", "CheckButton", Ref<Font>());
- theme->set_font_size("font_size", "CheckButton", -1);
+ theme->set_font(SceneStringName(font), "CheckButton", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "CheckButton", -1);
- theme->set_color("font_color", "CheckButton", control_font_color);
+ theme->set_color(SceneStringName(font_color), "CheckButton", control_font_color);
theme->set_color("font_pressed_color", "CheckButton", control_font_pressed_color);
theme->set_color("font_hover_color", "CheckButton", control_font_hover_color);
theme->set_color("font_hover_pressed_color", "CheckButton", control_font_pressed_color);
@@ -387,10 +387,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
// Label
theme->set_stylebox(CoreStringName(normal), "Label", memnew(StyleBoxEmpty));
- theme->set_font("font", "Label", Ref<Font>());
- theme->set_font_size("font_size", "Label", -1);
+ theme->set_font(SceneStringName(font), "Label", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "Label", -1);
- theme->set_color("font_color", "Label", Color(1, 1, 1));
+ theme->set_color(SceneStringName(font_color), "Label", Color(1, 1, 1));
theme->set_color("font_shadow_color", "Label", Color(0, 0, 0, 0));
theme->set_color("font_outline_color", "Label", Color(0, 0, 0));
@@ -401,13 +401,13 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_constant("line_spacing", "Label", Math::round(3 * scale));
theme->set_type_variation("HeaderSmall", "Label");
- theme->set_font_size("font_size", "HeaderSmall", default_font_size + 4);
+ theme->set_font_size(SceneStringName(font_size), "HeaderSmall", default_font_size + 4);
theme->set_type_variation("HeaderMedium", "Label");
- theme->set_font_size("font_size", "HeaderMedium", default_font_size + 8);
+ theme->set_font_size(SceneStringName(font_size), "HeaderMedium", default_font_size + 8);
theme->set_type_variation("HeaderLarge", "Label");
- theme->set_font_size("font_size", "HeaderLarge", default_font_size + 12);
+ theme->set_font_size(SceneStringName(font_size), "HeaderLarge", default_font_size + 12);
// LineEdit
@@ -425,10 +425,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
style_line_edit_read_only->set_border_color(style_pressed_color * Color(1, 1, 1, 0.5));
theme->set_stylebox("read_only", "LineEdit", style_line_edit_read_only);
- theme->set_font("font", "LineEdit", Ref<Font>());
- theme->set_font_size("font_size", "LineEdit", -1);
+ theme->set_font(SceneStringName(font), "LineEdit", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "LineEdit", -1);
- theme->set_color("font_color", "LineEdit", control_font_color);
+ theme->set_color(SceneStringName(font_color), "LineEdit", control_font_color);
theme->set_color("font_selected_color", "LineEdit", control_font_pressed_color);
theme->set_color("font_uneditable_color", "LineEdit", control_font_disabled_color);
theme->set_color("font_placeholder_color", "LineEdit", control_font_placeholder_color);
@@ -449,10 +449,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox("background", "ProgressBar", make_flat_stylebox(style_disabled_color, 2, 2, 2, 2, 6));
theme->set_stylebox("fill", "ProgressBar", make_flat_stylebox(style_progress_color, 2, 2, 2, 2, 6));
- theme->set_font("font", "ProgressBar", Ref<Font>());
- theme->set_font_size("font_size", "ProgressBar", -1);
+ theme->set_font(SceneStringName(font), "ProgressBar", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "ProgressBar", -1);
- theme->set_color("font_color", "ProgressBar", control_font_hover_color);
+ theme->set_color(SceneStringName(font_color), "ProgressBar", control_font_hover_color);
theme->set_color("font_outline_color", "ProgressBar", Color(0, 0, 0));
theme->set_constant("outline_size", "ProgressBar", 0);
@@ -466,11 +466,11 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_icon("tab", "TextEdit", icons["text_edit_tab"]);
theme->set_icon("space", "TextEdit", icons["text_edit_space"]);
- theme->set_font("font", "TextEdit", Ref<Font>());
- theme->set_font_size("font_size", "TextEdit", -1);
+ theme->set_font(SceneStringName(font), "TextEdit", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "TextEdit", -1);
theme->set_color("background_color", "TextEdit", Color(0, 0, 0, 0));
- theme->set_color("font_color", "TextEdit", control_font_color);
+ theme->set_color(SceneStringName(font_color), "TextEdit", control_font_color);
theme->set_color("font_selected_color", "TextEdit", Color(0, 0, 0, 0));
theme->set_color("font_readonly_color", "TextEdit", control_font_disabled_color);
theme->set_color("font_placeholder_color", "TextEdit", control_font_placeholder_color);
@@ -505,8 +505,8 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_icon("folded_code_region", "CodeEdit", icons["region_folded"]);
theme->set_icon("folded_eol_icon", "CodeEdit", icons["text_edit_ellipsis"]);
- theme->set_font("font", "CodeEdit", Ref<Font>());
- theme->set_font_size("font_size", "CodeEdit", -1);
+ theme->set_font(SceneStringName(font), "CodeEdit", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "CodeEdit", -1);
theme->set_color("background_color", "CodeEdit", Color(0, 0, 0, 0));
theme->set_color("completion_background_color", "CodeEdit", Color(0.17, 0.16, 0.2));
@@ -514,7 +514,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_color("completion_existing_color", "CodeEdit", Color(0.87, 0.87, 0.87, 0.13));
theme->set_color("completion_scroll_color", "CodeEdit", control_font_pressed_color * Color(1, 1, 1, 0.29));
theme->set_color("completion_scroll_hovered_color", "CodeEdit", control_font_pressed_color * Color(1, 1, 1, 0.4));
- theme->set_color("font_color", "CodeEdit", control_font_color);
+ theme->set_color(SceneStringName(font_color), "CodeEdit", control_font_color);
theme->set_color("font_selected_color", "CodeEdit", Color(0, 0, 0, 0));
theme->set_color("font_readonly_color", "CodeEdit", Color(control_font_color.r, control_font_color.g, control_font_color.b, 0.5f));
theme->set_color("font_placeholder_color", "CodeEdit", control_font_placeholder_color);
@@ -699,12 +699,12 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_icon("submenu", "PopupMenu", icons["popup_menu_arrow_right"]);
theme->set_icon("submenu_mirrored", "PopupMenu", icons["popup_menu_arrow_left"]);
- theme->set_font("font", "PopupMenu", Ref<Font>());
+ theme->set_font(SceneStringName(font), "PopupMenu", Ref<Font>());
theme->set_font("font_separator", "PopupMenu", Ref<Font>());
- theme->set_font_size("font_size", "PopupMenu", -1);
+ theme->set_font_size(SceneStringName(font_size), "PopupMenu", -1);
theme->set_font_size("font_separator_size", "PopupMenu", -1);
- theme->set_color("font_color", "PopupMenu", control_font_color);
+ theme->set_color(SceneStringName(font_color), "PopupMenu", control_font_color);
theme->set_color("font_accelerator_color", "PopupMenu", Color(0.7, 0.7, 0.7, 0.8));
theme->set_color("font_disabled_color", "PopupMenu", Color(0.4, 0.4, 0.4, 0.8));
theme->set_color("font_hover_color", "PopupMenu", control_font_color);
@@ -749,9 +749,9 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_type_variation("GraphNodeTitleLabel", "Label");
theme->set_stylebox(CoreStringName(normal), "GraphNodeTitleLabel", make_empty_stylebox(0, 0, 0, 0));
- theme->set_font("font", "GraphNodeTitleLabel", Ref<Font>());
- theme->set_font_size("font_size", "GraphNodeTitleLabel", -1);
- theme->set_color("font_color", "GraphNodeTitleLabel", control_font_color);
+ theme->set_font(SceneStringName(font), "GraphNodeTitleLabel", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "GraphNodeTitleLabel", -1);
+ theme->set_color(SceneStringName(font_color), "GraphNodeTitleLabel", control_font_color);
theme->set_color("font_shadow_color", "GraphNodeTitleLabel", Color(0, 0, 0, 0));
theme->set_color("font_outline_color", "GraphNodeTitleLabel", Color(0, 0, 0));
theme->set_constant("shadow_offset_x", "GraphNodeTitleLabel", Math::round(1 * scale));
@@ -780,8 +780,8 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_type_variation("GraphFrameTitleLabel", "Label");
theme->set_stylebox(CoreStringName(normal), "GraphFrameTitleLabel", memnew(StyleBoxEmpty));
- theme->set_font_size("font_size", "GraphFrameTitleLabel", 22);
- theme->set_color("font_color", "GraphFrameTitleLabel", Color(1, 1, 1));
+ theme->set_font_size(SceneStringName(font_size), "GraphFrameTitleLabel", 22);
+ theme->set_color(SceneStringName(font_color), "GraphFrameTitleLabel", Color(1, 1, 1));
theme->set_color("font_shadow_color", "GraphFrameTitleLabel", Color(0, 0, 0, 0));
theme->set_color("font_outline_color", "GraphFrameTitleLabel", Color(1, 1, 1));
theme->set_constant("shadow_offset_x", "GraphFrameTitleLabel", 1 * scale);
@@ -819,12 +819,12 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_icon("arrow_collapsed_mirrored", "Tree", icons["arrow_left"]);
theme->set_font("title_button_font", "Tree", Ref<Font>());
- theme->set_font("font", "Tree", Ref<Font>());
- theme->set_font_size("font_size", "Tree", -1);
+ theme->set_font(SceneStringName(font), "Tree", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "Tree", -1);
theme->set_font_size("title_button_font_size", "Tree", -1);
theme->set_color("title_button_color", "Tree", control_font_color);
- theme->set_color("font_color", "Tree", control_font_low_color);
+ theme->set_color(SceneStringName(font_color), "Tree", control_font_low_color);
theme->set_color("font_selected_color", "Tree", control_font_pressed_color);
theme->set_color("font_disabled_color", "Tree", control_font_disabled_color);
theme->set_color("font_outline_color", "Tree", Color(0, 0, 0));
@@ -869,10 +869,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_constant("icon_margin", "ItemList", Math::round(4 * scale));
theme->set_constant(SceneStringName(line_separation), "ItemList", Math::round(2 * scale));
- theme->set_font("font", "ItemList", Ref<Font>());
- theme->set_font_size("font_size", "ItemList", -1);
+ theme->set_font(SceneStringName(font), "ItemList", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "ItemList", -1);
- theme->set_color("font_color", "ItemList", control_font_lower_color);
+ theme->set_color(SceneStringName(font_color), "ItemList", control_font_lower_color);
theme->set_color("font_hovered_color", "ItemList", control_font_hover_color);
theme->set_color("font_selected_color", "ItemList", control_font_pressed_color);
theme->set_color("font_outline_color", "ItemList", Color(0, 0, 0));
@@ -917,8 +917,8 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_icon("menu", "TabContainer", icons["tabs_menu"]);
theme->set_icon("menu_highlight", "TabContainer", icons["tabs_menu_hl"]);
- theme->set_font("font", "TabContainer", Ref<Font>());
- theme->set_font_size("font_size", "TabContainer", -1);
+ theme->set_font(SceneStringName(font), "TabContainer", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "TabContainer", -1);
theme->set_color("font_selected_color", "TabContainer", control_font_hover_color);
theme->set_color("font_hovered_color", "TabContainer", control_font_hover_color);
@@ -949,8 +949,8 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_icon("drop_mark", "TabBar", icons["tabs_drop_mark"]);
theme->set_icon("close", "TabBar", icons["close"]);
- theme->set_font("font", "TabBar", Ref<Font>());
- theme->set_font_size("font_size", "TabBar", -1);
+ theme->set_font(SceneStringName(font), "TabBar", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "TabBar", -1);
theme->set_color("font_selected_color", "TabBar", control_font_hover_color);
theme->set_color("font_hovered_color", "TabBar", control_font_hover_color);
@@ -1058,10 +1058,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox("disabled", "ColorPickerButton", button_disabled);
theme->set_stylebox("focus", "ColorPickerButton", focus);
- theme->set_font("font", "ColorPickerButton", Ref<Font>());
- theme->set_font_size("font_size", "ColorPickerButton", -1);
+ theme->set_font(SceneStringName(font), "ColorPickerButton", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "ColorPickerButton", -1);
- theme->set_color("font_color", "ColorPickerButton", Color(1, 1, 1, 1));
+ theme->set_color(SceneStringName(font_color), "ColorPickerButton", Color(1, 1, 1, 1));
theme->set_color("font_pressed_color", "ColorPickerButton", Color(0.8, 0.8, 0.8, 1));
theme->set_color("font_hover_color", "ColorPickerButton", Color(1, 1, 1, 1));
theme->set_color("font_focus_color", "ColorPickerButton", Color(1, 1, 1, 1));
@@ -1089,10 +1089,10 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
make_flat_stylebox(Color(0, 0, 0, 0.5), 2 * default_margin, 0.5 * default_margin, 2 * default_margin, 0.5 * default_margin));
theme->set_type_variation("TooltipLabel", "Label");
- theme->set_font_size("font_size", "TooltipLabel", -1);
- theme->set_font("font", "TooltipLabel", Ref<Font>());
+ theme->set_font_size(SceneStringName(font_size), "TooltipLabel", -1);
+ theme->set_font(SceneStringName(font), "TooltipLabel", Ref<Font>());
- theme->set_color("font_color", "TooltipLabel", control_font_color);
+ theme->set_color(SceneStringName(font_color), "TooltipLabel", control_font_color);
theme->set_color("font_shadow_color", "TooltipLabel", Color(0, 0, 0, 0));
theme->set_color("font_outline_color", "TooltipLabel", Color(0, 0, 0));