1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Add disabled theme icons for CheckBox

(cherry picked from commit 3a40c268a6)
This commit is contained in:
Tomasz Chabora
2020-04-10 13:40:52 +02:00
committed by Rémi Verschelde
parent cc419fcf8f
commit 44e84c61a6
8 changed files with 32 additions and 2 deletions

View File

@@ -34,7 +34,9 @@
Size2 CheckBox::get_icon_size() const {
Ref<Texture> checked = Control::get_icon("checked");
Ref<Texture> checked_disabled = Control::get_icon("checked_disabled");
Ref<Texture> unchecked = Control::get_icon("unchecked");
Ref<Texture> unchecked_disabled = Control::get_icon("unchecked_disabled");
Ref<Texture> radio_checked = Control::get_icon("radio_checked");
Ref<Texture> radio_unchecked = Control::get_icon("radio_unchecked");
@@ -73,8 +75,8 @@ void CheckBox::_notification(int p_what) {
RID ci = get_canvas_item();
Ref<Texture> on = Control::get_icon(is_radio() ? "radio_checked" : "checked");
Ref<Texture> off = Control::get_icon(is_radio() ? "radio_unchecked" : "unchecked");
Ref<Texture> on = Control::get_icon(vformat("%s%s", is_radio() ? "radio_checked" : "checked", is_disabled() ? "_disabled" : ""));
Ref<Texture> off = Control::get_icon(vformat("%s%s", is_radio() ? "radio_unchecked" : "unchecked", is_disabled() ? "_disabled" : ""));
Ref<StyleBox> sb = get_stylebox("normal");
Vector2 ofs;