diff --git a/src/icons.c b/src/icons.c index 781286d54..956e8214c 100644 --- a/src/icons.c +++ b/src/icons.c @@ -829,7 +829,21 @@ e_icon_invert_selection(E_Icon *ic) void e_icon_select(E_Icon *ic) { + Evas_List l; D_ENTER; + if (ic->view->select.lock) + D_RETURN; + if (ic->view->select.count == 0) + { + /* lock all other views of our dir */ + for (l= ic->view->model->views;l;l=l->next) + { + E_View *v = (E_View *) l->data; + v->select.lock = 1; + } + /* unlock ourselves */ + ic->view->select.lock = 0; + } if (!ic->state.selected) { @@ -844,7 +858,10 @@ e_icon_select(E_Icon *ic) void e_icon_deselect(E_Icon *ic) { + Evas_List l; D_ENTER; + if (ic->view->select.lock) + D_RETURN; if (ic->state.selected) { @@ -852,7 +869,16 @@ e_icon_deselect(E_Icon *ic) ic->view->select.count--; e_icon_update_state(ic); } - + if (ic->view->select.count == 0) + { + /* we have just unselected the last icon. Unlock all + * other views of our model. */ + for (l= ic->view->model->views;l;l=l->next) + { + E_View *v = (E_View *) l->data; + v->select.lock = 0; + } + } D_RETURN; } diff --git a/src/view.c b/src/view.c index 717781eef..dd0484e85 100644 --- a/src/view.c +++ b/src/view.c @@ -1652,6 +1652,7 @@ e_view_new(void) v->options.back_pixmap = 0; #endif #endif + v->select.lock = 0; v->select.config.grad_size.l = 8; v->select.config.grad_size.r = 8; v->select.config.grad_size.t = 8; diff --git a/src/view.h b/src/view.h index d125536f3..23e9dbfd7 100644 --- a/src/view.h +++ b/src/view.h @@ -49,7 +49,7 @@ struct _E_View char * name; E_View_Model *model; - + struct { Evas_Render_Method render_method; int back_pixmap; @@ -94,6 +94,9 @@ struct _E_View } spacing; struct { int on; + /* we set this in all other views of our view_model + * when the first icon in a view is selected. */ + int lock; /* The number of selected icons. */ int count; /* The number of icons we selected the last time.