summaryrefslogtreecommitdiff
path: root/editor/editor_inspector.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-04-23 12:05:22 +0200
committerGitHub <noreply@github.com>2019-04-23 12:05:22 +0200
commitbaad65709123d6e7385fd5dc6a16187c7b32e5bb (patch)
tree5a6cb9165302a9a404712e2ebce008433fbf1530 /editor/editor_inspector.cpp
parentf2d3d3e6791591a572515ea0768bf9c8fb71acd8 (diff)
parentc230c6db98e98c3a473e13d6116481fef9fa4ac1 (diff)
Merge pull request #28321 from jbuck3/checkable-property-fix
Fix drawing of checkable editor properties
Diffstat (limited to 'editor/editor_inspector.cpp')
-rw-r--r--editor/editor_inspector.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index f1f68a14de..f7527763eb 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -211,12 +211,14 @@ void EditorProperty::_notification(int p_what) {
}
int ofs = 0;
+ int text_limit = text_size;
+
if (checkable) {
Ref<Texture> checkbox;
if (checked)
- checkbox = get_icon("checked", "CheckBox");
+ checkbox = get_icon("GuiChecked", "EditorIcons");
else
- checkbox = get_icon("unchecked", "CheckBox");
+ checkbox = get_icon("GuiUnchecked", "EditorIcons");
Color color2(1, 1, 1);
if (check_hover) {
@@ -228,12 +230,11 @@ void EditorProperty::_notification(int p_what) {
draw_texture(checkbox, check_rect.position, color2);
ofs += get_constant("hseparator", "Tree");
ofs += checkbox->get_width();
+ text_limit -= ofs;
} else {
check_rect = Rect2();
}
- int text_limit = text_size;
-
if (can_revert) {
Ref<Texture> reload_icon = get_icon("ReloadSmall", "EditorIcons");
text_limit -= reload_icon->get_width() + get_constant("hseparator", "Tree") * 2;