diff options
Diffstat (limited to 'editor/editor_spin_slider.cpp')
-rw-r--r-- | editor/editor_spin_slider.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index 436d67b882..58ab7d3cef 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -88,7 +88,7 @@ void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) { } } else if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_UP || mb->get_button_index() == MOUSE_BUTTON_WHEEL_DOWN) { if (grabber->is_visible()) { - call_deferred("update"); + call_deferred(SNAME("update")); } } } @@ -193,7 +193,7 @@ void EditorSpinSlider::_update_value_input_stylebox() { // when it's edited. The LineEdit "focus" stylebox uses the "normal" stylebox's // default margins. Ref<StyleBoxFlat> stylebox = - EditorNode::get_singleton()->get_theme_base()->get_theme_stylebox("normal", "LineEdit")->duplicate(); + EditorNode::get_singleton()->get_theme_base()->get_theme_stylebox(SNAME("normal"), SNAME("LineEdit"))->duplicate(); // EditorSpinSliders with a label have more space on the left, so add an // higher margin to match the location where the text begins. // The margin values below were determined by empirical testing. @@ -229,19 +229,19 @@ void EditorSpinSlider::_notification(int p_what) { bool rtl = is_layout_rtl(); Vector2 size = get_size(); - Ref<StyleBox> sb = get_theme_stylebox("normal", "LineEdit"); + Ref<StyleBox> sb = get_theme_stylebox(SNAME("normal"), SNAME("LineEdit")); if (!flat) { draw_style_box(sb, Rect2(Vector2(), size)); } - Ref<Font> font = get_theme_font("font", "LineEdit"); - int font_size = get_theme_font_size("font_size", "LineEdit"); + Ref<Font> font = get_theme_font(SNAME("font"), SNAME("LineEdit")); + int font_size = get_theme_font_size(SNAME("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 int label_width = font->get_string_size(label, font_size).width; int number_width = size.width - sb->get_minimum_size().width - label_width - sep; - Ref<Texture2D> updown = get_theme_icon("updown", "SpinBox"); + Ref<Texture2D> updown = get_theme_icon(SNAME("updown"), SNAME("SpinBox")); if (get_step() == 1) { number_width -= updown->get_width(); @@ -251,7 +251,7 @@ void EditorSpinSlider::_notification(int p_what) { int vofs = (size.height - font->get_height(font_size)) / 2 + font->get_ascent(font_size); - Color fc = get_theme_color("font_color", "LineEdit"); + Color fc = get_theme_color(SNAME("font_color"), SNAME("LineEdit")); Color lc; if (use_custom_label_color) { lc = custom_label_color; @@ -260,7 +260,7 @@ void EditorSpinSlider::_notification(int p_what) { } if (flat && label != String()) { - Color label_bg_color = get_theme_color("dark_color_3", "Editor"); + Color label_bg_color = get_theme_color(SNAME("dark_color_3"), SNAME("Editor")); if (rtl) { draw_rect(Rect2(Vector2(size.width - (sb->get_offset().x * 2 + label_width), 0), Vector2(sb->get_offset().x * 2 + label_width, size.height)), label_bg_color); } else { @@ -269,7 +269,7 @@ void EditorSpinSlider::_notification(int p_what) { } if (has_focus()) { - Ref<StyleBox> focus = get_theme_stylebox("focus", "LineEdit"); + Ref<StyleBox> focus = get_theme_stylebox(SNAME("focus"), SNAME("LineEdit")); draw_style_box(focus, Rect2(Vector2(), size)); } @@ -307,7 +307,7 @@ void EditorSpinSlider::_notification(int p_what) { TS->free(num_rid); if (get_step() == 1) { - Ref<Texture2D> updown2 = get_theme_icon("updown", "SpinBox"); + Ref<Texture2D> updown2 = get_theme_icon(SNAME("updown"), SNAME("SpinBox")); int updown_vofs = (size.height - updown2->get_height()) / 2; if (rtl) { updown_offset = sb->get_margin(SIDE_LEFT); @@ -350,9 +350,9 @@ void EditorSpinSlider::_notification(int p_what) { if (display_grabber) { Ref<Texture2D> grabber_tex; if (mouse_over_grabber) { - grabber_tex = get_theme_icon("grabber_highlight", "HSlider"); + grabber_tex = get_theme_icon(SNAME("grabber_highlight"), SNAME("HSlider")); } else { - grabber_tex = get_theme_icon("grabber", "HSlider"); + grabber_tex = get_theme_icon(SNAME("grabber"), SNAME("HSlider")); } if (grabber->get_texture() != grabber_tex) { @@ -395,9 +395,9 @@ LineEdit *EditorSpinSlider::get_line_edit() { } Size2 EditorSpinSlider::get_minimum_size() const { - Ref<StyleBox> sb = get_theme_stylebox("normal", "LineEdit"); - Ref<Font> font = get_theme_font("font", "LineEdit"); - int font_size = get_theme_font_size("font_size", "LineEdit"); + Ref<StyleBox> sb = get_theme_stylebox(SNAME("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")); Size2 ms = sb->get_minimum_size(); ms.height += font->get_height(font_size); @@ -529,9 +529,9 @@ void EditorSpinSlider::_focus_entered() { value_input->set_text(get_text_value()); value_input_popup->set_position(gr.position); value_input_popup->set_size(gr.size); - value_input_popup->call_deferred("popup"); - value_input->call_deferred("grab_focus"); - value_input->call_deferred("select_all"); + value_input_popup->call_deferred(SNAME("popup")); + value_input->call_deferred(SNAME("grab_focus")); + value_input->call_deferred(SNAME("select_all")); value_input->set_focus_next(find_next_valid_focus()->get_path()); value_input->set_focus_previous(find_prev_valid_focus()->get_path()); } |