From 088435ab78ed32830d430dd457acf0e2b74a2060 Mon Sep 17 00:00:00 2001 From: ajreckof <66184050+ajreckof@users.noreply.github.com> Date: Wed, 17 May 2023 05:56:24 +0200 Subject: [PATCH] prevent selecting unselectable `EditorProperty` with RMB --- editor/editor_inspector.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 2b02818645..98cfb407d1 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -598,6 +598,9 @@ void EditorProperty::add_focusable(Control *p_control) { void EditorProperty::select(int p_focusable) { bool already_selected = selected; + if (!selectable) { + return; + } if (p_focusable >= 0) { ERR_FAIL_INDEX(p_focusable, focusables.size()); @@ -671,11 +674,7 @@ void EditorProperty::gui_input(const Ref &p_event) { mpos.x = get_size().x - mpos.x; } - if (!selected && selectable) { - selected = true; - emit_signal(SNAME("selected"), property, -1); - queue_redraw(); - } + select(); if (keying_rect.has_point(mpos)) { accept_event();