summaryrefslogtreecommitdiff
path: root/scene/gui/check_box.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/check_box.cpp')
-rw-r--r--scene/gui/check_box.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/scene/gui/check_box.cpp b/scene/gui/check_box.cpp
index c0650a8f3f..d93107df2d 100644
--- a/scene/gui/check_box.cpp
+++ b/scene/gui/check_box.cpp
@@ -33,12 +33,12 @@
#include "servers/rendering_server.h"
Size2 CheckBox::get_icon_size() const {
- Ref<Texture2D> checked = Control::get_theme_icon("checked");
- Ref<Texture2D> checked_disabled = Control::get_theme_icon("checked_disabled");
- Ref<Texture2D> unchecked = Control::get_theme_icon("unchecked");
- Ref<Texture2D> unchecked_disabled = Control::get_theme_icon("unchecked_disabled");
- Ref<Texture2D> radio_checked = Control::get_theme_icon("radio_checked");
- Ref<Texture2D> radio_unchecked = Control::get_theme_icon("radio_unchecked");
+ Ref<Texture2D> checked = Control::get_theme_icon(SNAME("checked"));
+ Ref<Texture2D> checked_disabled = Control::get_theme_icon(SNAME("checked_disabled"));
+ Ref<Texture2D> unchecked = Control::get_theme_icon(SNAME("unchecked"));
+ Ref<Texture2D> unchecked_disabled = Control::get_theme_icon(SNAME("unchecked_disabled"));
+ Ref<Texture2D> radio_checked = Control::get_theme_icon(SNAME("radio_checked"));
+ Ref<Texture2D> radio_unchecked = Control::get_theme_icon(SNAME("radio_unchecked"));
Size2 tex_size = Size2(0, 0);
if (!checked.is_null()) {
@@ -61,9 +61,9 @@ Size2 CheckBox::get_minimum_size() const {
Size2 tex_size = get_icon_size();
minsize.width += tex_size.width;
if (get_text().length() > 0) {
- minsize.width += get_theme_constant("hseparation");
+ minsize.width += get_theme_constant(SNAME("hseparation"));
}
- Ref<StyleBox> sb = get_theme_stylebox("normal");
+ Ref<StyleBox> sb = get_theme_stylebox(SNAME("normal"));
minsize.height = MAX(minsize.height, tex_size.height + sb->get_margin(SIDE_TOP) + sb->get_margin(SIDE_BOTTOM));
return minsize;
@@ -83,7 +83,7 @@ void CheckBox::_notification(int p_what) {
Ref<Texture2D> on = Control::get_theme_icon(vformat("%s%s", is_radio() ? "radio_checked" : "checked", is_disabled() ? "_disabled" : ""));
Ref<Texture2D> off = Control::get_theme_icon(vformat("%s%s", is_radio() ? "radio_unchecked" : "unchecked", is_disabled() ? "_disabled" : ""));
- Ref<StyleBox> sb = get_theme_stylebox("normal");
+ Ref<StyleBox> sb = get_theme_stylebox(SNAME("normal"));
Vector2 ofs;
if (is_layout_rtl()) {
@@ -91,7 +91,7 @@ void CheckBox::_notification(int p_what) {
} else {
ofs.x = sb->get_margin(SIDE_LEFT);
}
- ofs.y = int((get_size().height - get_icon_size().height) / 2) + get_theme_constant("check_vadjust");
+ ofs.y = int((get_size().height - get_icon_size().height) / 2) + get_theme_constant(SNAME("check_vadjust"));
if (is_pressed()) {
on->draw(ci, ofs);