From a3951382cd5a7a6bf949475b541f2c666d8816d3 Mon Sep 17 00:00:00 2001 From: ajreckof <66184050+ajreckof@users.noreply.github.com> Date: Thu, 29 Jun 2023 16:03:22 +0200 Subject: [PATCH] prevent selecting unselectable `EditorProperty` with RMB (cherry picked from commit 088435ab78ed32830d430dd457acf0e2b74a2060) --- 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 8118e202fe9..6f560074aba 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -592,6 +592,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()); @@ -665,11 +668,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();