[Scene] Add SceneStringNames::font(_size/_color)

This commit is contained in:
A Thousand Ships 2024-05-14 15:57:29 +02:00
parent b435551682
commit d519715d94
No known key found for this signature in database
GPG key ID: 2033189A662F8BD7
77 changed files with 453 additions and 446 deletions

View file

@ -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);