prevent selecting unselectable `EditorProperty` with RMB
(cherry picked from commit 088435ab78
)
This commit is contained in:
parent
8129d83ee9
commit
a3951382cd
|
@ -592,6 +592,9 @@ void EditorProperty::add_focusable(Control *p_control) {
|
||||||
|
|
||||||
void EditorProperty::select(int p_focusable) {
|
void EditorProperty::select(int p_focusable) {
|
||||||
bool already_selected = selected;
|
bool already_selected = selected;
|
||||||
|
if (!selectable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (p_focusable >= 0) {
|
if (p_focusable >= 0) {
|
||||||
ERR_FAIL_INDEX(p_focusable, focusables.size());
|
ERR_FAIL_INDEX(p_focusable, focusables.size());
|
||||||
|
@ -665,11 +668,7 @@ void EditorProperty::gui_input(const Ref<InputEvent> &p_event) {
|
||||||
mpos.x = get_size().x - mpos.x;
|
mpos.x = get_size().x - mpos.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!selected && selectable) {
|
select();
|
||||||
selected = true;
|
|
||||||
emit_signal(SNAME("selected"), property, -1);
|
|
||||||
queue_redraw();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (keying_rect.has_point(mpos)) {
|
if (keying_rect.has_point(mpos)) {
|
||||||
accept_event();
|
accept_event();
|
||||||
|
|
Loading…
Reference in New Issue