diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-08-29 23:46:32 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-08-29 23:46:32 -0300 |
commit | 7bc9846f169a0a65970c64ca3fc2e799eaa8b990 (patch) | |
tree | 6bc7bda0fa1a4348a016ee6ed5eb5b82fff07c51 /scene | |
parent | 1bad27e1f8460424fa4476fe65209aa250d43115 (diff) |
-multi-selection (shift-click) working in scene tree
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/tree.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index b916a4cb89..252414cb3e 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1299,7 +1299,7 @@ void Tree::select_single_item(TreeItem *p_selected,TreeItem *p_current,int p_col } else if (select_mode==SELECT_SINGLE || select_mode==SELECT_MULTI) { - if (&selected_cell==&c) { + if (!r_in_range && &selected_cell==&c) { if (!selected_cell.selected) { @@ -1308,6 +1308,7 @@ void Tree::select_single_item(TreeItem *p_selected,TreeItem *p_current,int p_col selected_item=p_selected; selected_col=i; + emit_signal("cell_selected"); if (select_mode==SELECT_MULTI) emit_signal("multi_selected",p_current,i,true); @@ -1324,6 +1325,7 @@ void Tree::select_single_item(TreeItem *p_selected,TreeItem *p_current,int p_col if (r_in_range && *r_in_range) { + if (!c.selected && c.selectable) { c.selected=true; emit_signal("multi_selected",p_current,i,true); @@ -1474,7 +1476,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos,int x_ofs,int y_ofs,bool p_ if (select_mode==SELECT_MULTI && p_mod.shift && selected_item && selected_item!=p_item) { bool inrange=false; - print_line("SELECT MULTI AND SHIFT AND ALL"); + select_single_item( p_item, root, col,selected_item,&inrange ); } else { select_single_item( p_item, root, col ); |