forked from enlightenment/enlightenment
prevent selections in multiple views of the same dir. I do it like this to
keep selection info out of the view_model because it really doesnt belong there, I think. SVN revision: 5992
This commit is contained in:
parent
963526152c
commit
12fe3a8611
28
src/icons.c
28
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue