diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-03-26 17:23:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-26 17:23:11 +0100 |
commit | 5f1107aa30295e686be6f41cb6d17fc2cff1e036 (patch) | |
tree | 7bce4c680e6686c9d29be8b479be5b39205ce7a3 /editor/animation_bezier_editor.cpp | |
parent | a2da99f40cf2123c0906c734a2eb01e9b65a45a2 (diff) | |
parent | be07f86f85ab70a48b310b42faa64e72a74ca694 (diff) |
Merge pull request #37317 from akien-mga/display-server-rebased
Separate DisplayServer from OS and add multiple windows support
Diffstat (limited to 'editor/animation_bezier_editor.cpp')
-rw-r--r-- | editor/animation_bezier_editor.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index 6dcc9dd8ae..f3e3025e81 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -215,20 +215,20 @@ void AnimationBezierTrackEdit::_draw_line_clipped(const Vector2 &p_from, const V void AnimationBezierTrackEdit::_notification(int p_what) { if (p_what == NOTIFICATION_THEME_CHANGED || p_what == NOTIFICATION_ENTER_TREE) { - bezier_icon = get_icon("KeyBezierPoint", "EditorIcons"); - bezier_handle_icon = get_icon("KeyBezierHandle", "EditorIcons"); - selected_icon = get_icon("KeyBezierSelected", "EditorIcons"); + bezier_icon = get_theme_icon("KeyBezierPoint", "EditorIcons"); + bezier_handle_icon = get_theme_icon("KeyBezierHandle", "EditorIcons"); + selected_icon = get_theme_icon("KeyBezierSelected", "EditorIcons"); if (handle_mode_option->get_item_count() == 0) { - handle_mode_option->add_icon_item(get_icon("BezierHandlesFree", "EditorIcons"), TTR("Free"), HANDLE_MODE_FREE); - handle_mode_option->add_icon_item(get_icon("BezierHandlesBalanced", "EditorIcons"), TTR("Balanced"), HANDLE_MODE_BALANCED); - handle_mode_option->add_icon_item(get_icon("BezierHandlesMirror", "EditorIcons"), TTR("Mirror"), HANDLE_MODE_MIRROR); + handle_mode_option->add_icon_item(get_theme_icon("BezierHandlesFree", "EditorIcons"), TTR("Free"), HANDLE_MODE_FREE); + handle_mode_option->add_icon_item(get_theme_icon("BezierHandlesBalanced", "EditorIcons"), TTR("Balanced"), HANDLE_MODE_BALANCED); + handle_mode_option->add_icon_item(get_theme_icon("BezierHandlesMirror", "EditorIcons"), TTR("Mirror"), HANDLE_MODE_MIRROR); } } if (p_what == NOTIFICATION_RESIZED) { int right_limit = get_size().width - timeline->get_buttons_width(); - int hsep = get_constant("hseparation", "ItemList"); - int vsep = get_constant("vseparation", "ItemList"); + int hsep = get_theme_constant("hseparation", "ItemList"); + int vsep = get_theme_constant("vseparation", "ItemList"); handle_mode_option->set_position(Vector2(right_limit + hsep, get_size().height - handle_mode_option->get_combined_minimum_size().height - vsep)); handle_mode_option->set_size(Vector2(timeline->get_buttons_width() - hsep * 2, handle_mode_option->get_combined_minimum_size().height)); @@ -240,15 +240,15 @@ void AnimationBezierTrackEdit::_notification(int p_what) { int limit = timeline->get_name_limit(); if (has_focus()) { - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); accent.a *= 0.7; draw_rect(Rect2(Point2(), get_size()), accent, false); } - Ref<Font> font = get_font("font", "Label"); - Color color = get_color("font_color", "Label"); - int hsep = get_constant("hseparation", "ItemList"); - int vsep = get_constant("vseparation", "ItemList"); + Ref<Font> font = get_theme_font("font", "Label"); + Color color = get_theme_color("font_color", "Label"); + int hsep = get_theme_constant("hseparation", "ItemList"); + int vsep = get_theme_constant("vseparation", "ItemList"); Color linecolor = color; linecolor.a = 0.2; @@ -258,7 +258,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { draw_line(Point2(right_limit, 0), Point2(right_limit, get_size().height), linecolor); - Ref<Texture2D> close_icon = get_icon("Close", "EditorIcons"); + Ref<Texture2D> close_icon = get_theme_icon("Close", "EditorIcons"); close_icon_rect.position = Vector2(get_size().width - close_icon->get_width() - hsep, hsep); close_icon_rect.size = close_icon->get_size(); @@ -340,7 +340,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { subtracks[i] = rect; } else { - Color ac = get_color("accent_color", "Editor"); + Color ac = get_theme_color("accent_color", "Editor"); ac.a = 0.5; draw_rect(rect, ac); } @@ -349,7 +349,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { vofs += font->get_height() + vsep; } - Color accent = get_color("accent_color", "Editor"); + Color accent = get_theme_color("accent_color", "Editor"); { //guides float min_left_scale = font->get_height() + vsep; @@ -391,7 +391,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { { //draw OTHER curves float scale = timeline->get_zoom_scale(); - Ref<Texture2D> point = get_icon("KeyValue", "EditorIcons"); + Ref<Texture2D> point = get_theme_icon("KeyValue", "EditorIcons"); for (Map<int, Color>::Element *E = subtrack_colors.front(); E; E = E->next()) { _draw_track(E->key(), E->get()); @@ -410,7 +410,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) { } //draw edited curve - const Color highlight = get_color("highlight_color", "Editor"); + const Color highlight = get_theme_color("highlight_color", "Editor"); _draw_track(track, highlight); } @@ -540,7 +540,7 @@ void AnimationBezierTrackEdit::_play_position_draw() { int px = (-timeline->get_value() + play_position_pos) * scale + timeline->get_name_limit(); if (px >= timeline->get_name_limit() && px < (get_size().width - timeline->get_buttons_width())) { - Color color = get_color("accent_color", "Editor"); + Color color = get_theme_color("accent_color", "Editor"); play_position->draw_line(Point2(px, 0), Point2(px, h), color); } } @@ -657,9 +657,9 @@ void AnimationBezierTrackEdit::_gui_input(const Ref<InputEvent> &p_event) { menu->add_icon_item(bezier_icon, TTR("Insert Key Here"), MENU_KEY_INSERT); if (selection.size()) { menu->add_separator(); - menu->add_icon_item(get_icon("Duplicate", "EditorIcons"), TTR("Duplicate Selected Key(s)"), MENU_KEY_DUPLICATE); + menu->add_icon_item(get_theme_icon("Duplicate", "EditorIcons"), TTR("Duplicate Selected Key(s)"), MENU_KEY_DUPLICATE); menu->add_separator(); - menu->add_icon_item(get_icon("Remove", "EditorIcons"), TTR("Delete Selected Key(s)"), MENU_KEY_DELETE); + menu->add_icon_item(get_theme_icon("Remove", "EditorIcons"), TTR("Delete Selected Key(s)"), MENU_KEY_DELETE); } menu->set_as_minsize(); |