From facf8f1883bad95c7617df8abfbc1039feafeda8 Mon Sep 17 00:00:00 2001 From: Silc 'Tokage' Renew Date: Mon, 16 Aug 2021 11:42:24 +0900 Subject: Apply set_read_only() to child classes of EditorProperty elements --- scene/gui/check_box.cpp | 18 ++++++++++++++++-- scene/gui/line_edit.cpp | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'scene/gui') diff --git a/scene/gui/check_box.cpp b/scene/gui/check_box.cpp index d93107df2d..411fb2e1f0 100644 --- a/scene/gui/check_box.cpp +++ b/scene/gui/check_box.cpp @@ -34,11 +34,13 @@ Size2 CheckBox::get_icon_size() const { Ref checked = Control::get_theme_icon(SNAME("checked")); - Ref checked_disabled = Control::get_theme_icon(SNAME("checked_disabled")); Ref unchecked = Control::get_theme_icon(SNAME("unchecked")); - Ref unchecked_disabled = Control::get_theme_icon(SNAME("unchecked_disabled")); Ref radio_checked = Control::get_theme_icon(SNAME("radio_checked")); Ref radio_unchecked = Control::get_theme_icon(SNAME("radio_unchecked")); + Ref checked_disabled = Control::get_theme_icon(SNAME("checked_disabled")); + Ref unchecked_disabled = Control::get_theme_icon(SNAME("unchecked_disabled")); + Ref radio_checked_disabled = Control::get_theme_icon(SNAME("radio_checked_disabled")); + Ref radio_unchecked_disabled = Control::get_theme_icon(SNAME("radio_unchecked_disabled")); Size2 tex_size = Size2(0, 0); if (!checked.is_null()) { @@ -53,6 +55,18 @@ Size2 CheckBox::get_icon_size() const { if (!radio_unchecked.is_null()) { tex_size = Size2(MAX(tex_size.width, radio_unchecked->get_width()), MAX(tex_size.height, radio_unchecked->get_height())); } + if (!checked_disabled.is_null()) { + tex_size = Size2(MAX(tex_size.width, checked_disabled->get_width()), MAX(tex_size.height, checked_disabled->get_height())); + } + if (!unchecked_disabled.is_null()) { + tex_size = Size2(MAX(tex_size.width, unchecked_disabled->get_width()), MAX(tex_size.height, unchecked_disabled->get_height())); + } + if (!radio_checked_disabled.is_null()) { + tex_size = Size2(MAX(tex_size.width, radio_checked_disabled->get_width()), MAX(tex_size.height, radio_checked_disabled->get_height())); + } + if (!radio_unchecked_disabled.is_null()) { + tex_size = Size2(MAX(tex_size.width, radio_unchecked_disabled->get_width()), MAX(tex_size.height, radio_unchecked_disabled->get_height())); + } return tex_size; } diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 3605842224..d9acbeb828 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -674,7 +674,7 @@ void LineEdit::_notification(int p_what) { int y_ofs = style->get_offset().y + (y_area - text_height) / 2; Color selection_color = get_theme_color(SNAME("selection_color")); - Color font_color = is_editable() ? get_theme_color(SNAME("font_color")) : get_theme_color(SNAME("font_uneditable_color")); + Color font_color = get_theme_color(is_editable() ? SNAME("font_color") : SNAME("font_uneditable_color")); Color font_selected_color = get_theme_color(SNAME("font_selected_color")); Color caret_color = get_theme_color(SNAME("caret_color")); -- cgit v1.2.3