diff options
| author | Dmitry Koteroff <vortex@verona.im> | 2017-11-26 14:49:21 +0300 |
|---|---|---|
| committer | Dmitry Koteroff <vortex@verona.im> | 2017-11-26 18:30:48 +0300 |
| commit | b8b5bb657767698b5864356fb2549ee9681f1bd6 (patch) | |
| tree | fe365ad7237eec90e3a5055bc2b88be2257fd8cb /scene | |
| parent | 6086252f66ac185b97b0580352383e4b068b9fe5 (diff) | |
| download | redot-engine-b8b5bb657767698b5864356fb2549ee9681f1bd6.tar.gz | |
Scene Tree Dock: added ability to deselect items when clicking on empty space
Diffstat (limited to 'scene')
| -rw-r--r-- | scene/gui/tree.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 9213296c55..57c6737848 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1923,6 +1923,9 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool c = c->next; item_h += child_h; } + + if (!c && !p_mod->get_shift() && !p_mod->get_control() && !p_mod->get_command() && !click_handled && p_button != BUTTON_RIGHT) + emit_signal("nothing_selected"); } } @@ -3750,6 +3753,7 @@ void Tree::_bind_methods() { ADD_SIGNAL(MethodInfo("custom_popup_edited", PropertyInfo(Variant::BOOL, "arrow_clicked"))); ADD_SIGNAL(MethodInfo("item_activated")); ADD_SIGNAL(MethodInfo("column_title_pressed", PropertyInfo(Variant::INT, "column"))); + ADD_SIGNAL(MethodInfo("nothing_selected")); BIND_ENUM_CONSTANT(SELECT_SINGLE); BIND_ENUM_CONSTANT(SELECT_ROW); |
