Skip to content

Commit

Permalink
Revert "-make sure single select after multi select works better"
Browse files Browse the repository at this point in the history
This reverts commit f909634.
It caused various regressions (godotengine#4556 and godotengine#4607).
  • Loading branch information
akien-mga committed May 13, 2016
1 parent c0df7da commit 9ed2084
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 27 deletions.
23 changes: 0 additions & 23 deletions scene/gui/item_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ void ItemList::remove_item(int p_idx){
items.remove(p_idx);
update();
shape_changed=true;
defer_select_single=-1;


}
Expand All @@ -289,7 +288,6 @@ void ItemList::clear(){
current=-1;
ensure_selected_visible=false;
update();
defer_select_single=-1;

}

Expand Down Expand Up @@ -367,20 +365,6 @@ Size2 ItemList::get_min_icon_size() const {


void ItemList::_input_event(const InputEvent& p_event) {

if (defer_select_single>=0 && p_event.type==InputEvent::MOUSE_MOTION) {
defer_select_single=-1;
return;
}
if (defer_select_single>=0 && p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==BUTTON_LEFT && !p_event.mouse_button.pressed) {

select(defer_select_single,true);

emit_signal("multi_selected",defer_select_single,true);
defer_select_single=-1;
return;
}

if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==BUTTON_LEFT && p_event.mouse_button.pressed) {

const InputEventMouseButton &mb = p_event.mouse_button;
Expand Down Expand Up @@ -434,13 +418,7 @@ void ItemList::_input_event(const InputEvent& p_event) {
emit_signal("multi_selected",i,true);
}
} else {

if (!mb.mod.command && select_mode==SELECT_MULTI && items[i].selectable && items[i].selected) {
defer_select_single=i;
return;
}
bool selected = !items[i].selected;

select(i,select_mode==SELECT_SINGLE || !mb.mod.command);
if (selected) {
if (select_mode==SELECT_SINGLE) {
Expand Down Expand Up @@ -1164,7 +1142,6 @@ ItemList::ItemList() {
current_columns=1;
search_time_msec=0;
ensure_selected_visible=false;
defer_select_single=-1;

}

Expand Down
2 changes: 0 additions & 2 deletions scene/gui/item_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ class ItemList : public Control {
int max_columns;
Size2 min_icon_size;

int defer_select_single;

void _scroll_changed(double);
void _input_event(const InputEvent& p_event);
protected:
Expand Down
2 changes: 1 addition & 1 deletion tools/editor/editor_file_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "os/thread_safe.h"
class FileAccess;

struct EditorProgressBG;
class EditorProgressBG;
class EditorFileSystemDirectory : public Object {

OBJ_TYPE( EditorFileSystemDirectory,Object );
Expand Down
2 changes: 1 addition & 1 deletion tools/editor/editor_import_export.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

class EditorExportPlatform;
class FileAccess;
struct EditorProgress;
class EditorProgress;

class EditorImportPlugin : public Reference {

Expand Down

0 comments on commit 9ed2084

Please sign in to comment.