Skip to content

Commit

Permalink
Merge pull request godotengine#67814 from opl-/fix/editor-inspector-a…
Browse files Browse the repository at this point in the history
…ccept-event

Fix editor inspector classes not accepting events
  • Loading branch information
akien-mga committed Nov 29, 2022
2 parents 9d64a2e + 5d7a9f8 commit 447f699
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions editor/editor_inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ void EditorProperty::gui_input(const Ref<InputEvent> &p_event) {
}

if (keying_rect.has_point(mpos)) {
accept_event();
emit_signal(SNAME("property_keyed"), property, use_keying_next());

if (use_keying_next()) {
Expand All @@ -683,10 +684,12 @@ void EditorProperty::gui_input(const Ref<InputEvent> &p_event) {
}
}
if (delete_rect.has_point(mpos)) {
accept_event();
emit_signal(SNAME("property_deleted"), property);
}

if (revert_rect.has_point(mpos)) {
accept_event();
bool is_valid_revert = false;
Variant revert_value = EditorPropertyRevert::get_property_revert_value(object, property, &is_valid_revert);
ERR_FAIL_COND(!is_valid_revert);
Expand All @@ -695,11 +698,13 @@ void EditorProperty::gui_input(const Ref<InputEvent> &p_event) {
}

if (check_rect.has_point(mpos)) {
accept_event();
checked = !checked;
queue_redraw();
emit_signal(SNAME("property_checked"), property, checked);
}
} else if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == MouseButton::RIGHT) {
accept_event();
_update_popup();
menu->set_position(get_screen_position() + get_local_mouse_position());
menu->reset_size();
Expand Down Expand Up @@ -1482,6 +1487,8 @@ void EditorInspectorSection::gui_input(const Ref<InputEvent> &p_event) {
return;
}

accept_event();

bool should_unfold = !object->editor_is_section_unfolded(section);
if (should_unfold) {
unfold();
Expand Down Expand Up @@ -1680,6 +1687,7 @@ void EditorInspectorArray::_panel_gui_input(Ref<InputEvent> p_event, int p_index
Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid()) {
if (movable && mb->get_button_index() == MouseButton::RIGHT) {
array_elements[p_index].panel->accept_event();
popup_array_index_pressed = begin_array_index + p_index;
rmb_popup->set_item_disabled(OPTION_MOVE_UP, popup_array_index_pressed == 0);
rmb_popup->set_item_disabled(OPTION_MOVE_DOWN, popup_array_index_pressed == count - 1);
Expand Down

0 comments on commit 447f699

Please sign in to comment.