@@ -185,10 +185,6 @@ void EditorSpinSlider::_grabber_gui_input(const Ref<InputEvent> &p_event) {
185185
186186 Ref<InputEventMouseButton> mb = p_event;
187187
188- if (is_read_only ()) {
189- return ;
190- }
191-
192188 if (grabbing_grabber) {
193189 if (mb.is_valid ()) {
194190 if (mb->get_button_index () == MouseButton::WHEEL_UP) {
@@ -241,7 +237,7 @@ void EditorSpinSlider::_grabber_gui_input(const Ref<InputEvent> &p_event) {
241237
242238void EditorSpinSlider::_value_input_gui_input (const Ref<InputEvent> &p_event) {
243239 Ref<InputEventKey> k = p_event;
244- if (k.is_valid () && k->is_pressed () && !is_read_only () ) {
240+ if (k.is_valid () && k->is_pressed () && !read_only ) {
245241 Key code = k->get_keycode ();
246242
247243 switch (code) {
@@ -315,7 +311,7 @@ void EditorSpinSlider::_draw_spin_slider() {
315311 bool rtl = is_layout_rtl ();
316312 Vector2 size = get_size ();
317313
318- Ref<StyleBox> sb = get_theme_stylebox (is_read_only () ? SNAME (" read_only" ) : CoreStringName (normal), SNAME (" LineEdit" ));
314+ Ref<StyleBox> sb = get_theme_stylebox (read_only ? SNAME (" read_only" ) : CoreStringName (normal), SNAME (" LineEdit" ));
319315 if (!flat) {
320316 draw_style_box (sb, Rect2 (Vector2 (), size));
321317 }
@@ -327,14 +323,14 @@ void EditorSpinSlider::_draw_spin_slider() {
327323 int label_width = font->get_string_size (label, HORIZONTAL_ALIGNMENT_LEFT, -1 , font_size).width ;
328324 int number_width = size.width - sb->get_minimum_size ().width - label_width - sep;
329325
330- Ref<Texture2D> updown = get_theme_icon (is_read_only () ? SNAME (" updown_disabled" ) : SNAME (" updown" ), SNAME (" SpinBox" ));
326+ Ref<Texture2D> updown = get_theme_icon (read_only ? SNAME (" updown_disabled" ) : SNAME (" updown" ), SNAME (" SpinBox" ));
331327
332328 String numstr = get_text_value ();
333329
334330 int vofs = (size.height - font->get_height (font_size)) / 2 + font->get_ascent (font_size);
335331
336- Color fc = get_theme_color (is_read_only () ? SNAME (" font_uneditable_color" ) : SceneStringName (font_color), SNAME (" LineEdit" ));
337- Color lc = get_theme_color (is_read_only () ? SNAME (" read_only_label_color" ) : SNAME (" label_color" ));
332+ Color fc = get_theme_color (read_only ? SNAME (" font_uneditable_color" ) : SceneStringName (font_color), SNAME (" LineEdit" ));
333+ Color lc = get_theme_color (read_only ? SNAME (" read_only_label_color" ) : SNAME (" label_color" ));
338334
339335 if (flat && !label.is_empty ()) {
340336 Ref<StyleBox> label_bg = get_theme_stylebox (SNAME (" label_bg" ), SNAME (" EditorSpinSlider" ));
@@ -384,7 +380,7 @@ void EditorSpinSlider::_draw_spin_slider() {
384380
385381 if (!hide_slider) {
386382 if (get_step () == 1 ) {
387- Ref<Texture2D> updown2 = is_read_only () ? theme_cache.updown_disabled_icon : theme_cache.updown_icon ;
383+ Ref<Texture2D> updown2 = read_only ? theme_cache.updown_disabled_icon : theme_cache.updown_icon ;
388384 int updown_vofs = (size.height - updown2->get_height ()) / 2 ;
389385 if (rtl) {
390386 updown_offset = sb->get_margin (SIDE_LEFT);
@@ -604,7 +600,7 @@ void EditorSpinSlider::_value_focus_exited() {
604600 return ;
605601 }
606602
607- if (is_read_only () ) {
603+ if (read_only ) {
608604 // Spin slider has become read only while it was being edited.
609605 return ;
610606 }
@@ -665,7 +661,7 @@ bool EditorSpinSlider::is_grabbing() const {
665661}
666662
667663void EditorSpinSlider::_focus_entered () {
668- if (is_read_only () ) {
664+ if (read_only ) {
669665 return ;
670666 }
671667
0 commit comments