summaryrefslogtreecommitdiff
path: root/editor/editor_spin_slider.cpp
diff options
context:
space:
mode:
authorSilc 'Tokage' Renew <tokage.it.lab@gmail.com>2021-08-16 11:42:24 +0900
committerSilc 'Tokage' Renew <tokage.it.lab@gmail.com>2021-09-05 18:22:17 +0900
commitfacf8f1883bad95c7617df8abfbc1039feafeda8 (patch)
treeb7dcd4953e5f6f51630298f405c5c05be71b6a24 /editor/editor_spin_slider.cpp
parent0bdbce672c3c7b1894a6ac76cb2202966b05e735 (diff)
Apply set_read_only() to child classes of EditorProperty elements
Diffstat (limited to 'editor/editor_spin_slider.cpp')
-rw-r--r--editor/editor_spin_slider.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp
index 3f65b101f7..8cd636ddf3 100644
--- a/editor/editor_spin_slider.cpp
+++ b/editor/editor_spin_slider.cpp
@@ -221,7 +221,7 @@ void EditorSpinSlider::_draw_spin_slider() {
bool rtl = is_layout_rtl();
Vector2 size = get_size();
- Ref<StyleBox> sb = get_theme_stylebox(SNAME("normal"), SNAME("LineEdit"));
+ Ref<StyleBox> sb = get_theme_stylebox(is_read_only() ? SNAME("read_only") : SNAME("normal"), SNAME("LineEdit"));
if (!flat) {
draw_style_box(sb, Rect2(Vector2(), size));
}
@@ -233,7 +233,7 @@ void EditorSpinSlider::_draw_spin_slider() {
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(SNAME("updown"), SNAME("SpinBox"));
+ Ref<Texture2D> updown = get_theme_icon(is_read_only() ? SNAME("updown_disabled") : SNAME("updown"), SNAME("SpinBox"));
if (get_step() == 1) {
number_width -= updown->get_width();
@@ -243,7 +243,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(SNAME("font_color"), SNAME("LineEdit"));
+ Color fc = get_theme_color(is_read_only() ? SNAME("font_uneditable_color") : SNAME("font_color"), SNAME("LineEdit"));
Color lc;
if (use_custom_label_color) {
lc = custom_label_color;
@@ -299,7 +299,7 @@ void EditorSpinSlider::_draw_spin_slider() {
TS->free(num_rid);
if (get_step() == 1) {
- Ref<Texture2D> updown2 = get_theme_icon(SNAME("updown"), SNAME("SpinBox"));
+ Ref<Texture2D> updown2 = get_theme_icon(is_read_only() ? SNAME("updown_disabled") : SNAME("updown"), SNAME("SpinBox"));
int updown_vofs = (size.height - updown2->get_height()) / 2;
if (rtl) {
updown_offset = sb->get_margin(SIDE_LEFT);