* s/mulit/multi/ :)

* slight improvement in the menu handling -- when something was selected,
don't pop up menus when the user just clicks, but only unselect
everything. I think it's pretty irritating when the user just wants to
get rid of the selection and keeps getting menu popups.


SVN revision: 5617
This commit is contained in:
cpk 2001-11-03 15:33:21 +00:00 committed by cpk
parent a708bdfd42
commit c728727b17
5 changed files with 27 additions and 15 deletions

View File

@ -2,6 +2,6 @@
#include <Ecore.h> #include <Ecore.h>
Ecore_Event_Key_Modifiers mulit_select_mod = ECORE_EVENT_KEY_MODIFIER_SHIFT; Ecore_Event_Key_Modifiers multi_select_mod = ECORE_EVENT_KEY_MODIFIER_SHIFT;
Ecore_Event_Key_Modifiers range_select_mod = ECORE_EVENT_KEY_MODIFIER_CTRL; Ecore_Event_Key_Modifiers range_select_mod = ECORE_EVENT_KEY_MODIFIER_CTRL;
Evas_List views = NULL; Evas_List views = NULL;

View File

@ -1,7 +1,7 @@
#ifndef E_GLOBALS_H #ifndef E_GLOBALS_H
#define E_GLOBALS_H #define E_GLOBALS_H
extern Ecore_Event_Key_Modifiers mulit_select_mod; extern Ecore_Event_Key_Modifiers multi_select_mod;
extern Ecore_Event_Key_Modifiers range_select_mod; extern Ecore_Event_Key_Modifiers range_select_mod;
extern Evas_List views; extern Evas_List views;

View File

@ -40,7 +40,7 @@ e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{ {
if (!ic->state.selected) if (!ic->state.selected)
{ {
if ((e->mods & mulit_select_mod)) if ((e->mods & multi_select_mod))
{ {
e_icon_select(ic); e_icon_select(ic);
} }
@ -95,7 +95,7 @@ e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
} }
else else
{ {
if ((e->mods & mulit_select_mod)) if ((e->mods & multi_select_mod))
{ {
if ((ic->state.selected) && (!ic->state.just_selected)) if ((ic->state.selected) && (!ic->state.just_selected))
e_icon_deselect(ic); e_icon_deselect(ic);
@ -197,8 +197,8 @@ e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
Evas_List ll; Evas_List ll;
v = l->data; v = l->data;
D("sel count %i\n", v->sel_count); D("sel count %i\n", v->select.count);
if (v->sel_count > 0) if (v->select.count > 0)
{ {
for (ll = v->icons; ll; ll = ll->next) for (ll = v->icons; ll; ll = ll->next)
{ {
@ -272,7 +272,7 @@ e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
Evas_List ll; Evas_List ll;
v = l->data; v = l->data;
if (v->sel_count > 0) if (v->select.count > 0)
{ {
for (ll = v->icons; ll; ll = ll->next) { for (ll = v->icons; ll; ll = ll->next) {
E_Icon *ic; E_Icon *ic;
@ -830,7 +830,7 @@ e_icon_select(E_Icon *ic)
if (!ic->state.selected) if (!ic->state.selected)
{ {
ic->state.selected = 1; ic->state.selected = 1;
ic->view->sel_count++; ic->view->select.count++;
e_icon_update_state(ic); e_icon_update_state(ic);
} }
@ -845,7 +845,7 @@ e_icon_deselect(E_Icon *ic)
if (ic->state.selected) if (ic->state.selected)
{ {
ic->state.selected = 0; ic->state.selected = 0;
ic->view->sel_count--; ic->view->select.count--;
e_icon_update_state(ic); e_icon_update_state(ic);
} }

View File

@ -288,8 +288,13 @@ e_bg_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
if (!current_ev) D_RETURN; if (!current_ev) D_RETURN;
ev = current_ev->event; ev = current_ev->event;
v = _data; v = _data;
if (!(ev->mods & (mulit_select_mod | range_select_mod)))
e_view_deselect_all(); if (!(ev->mods & (multi_select_mod | range_select_mod)))
{
v->select.last_count = v->select.count;
e_view_deselect_all();
}
if (_b == 1) if (_b == 1)
{ {
v->select.down.x = _x; v->select.down.x = _x;
@ -340,6 +345,7 @@ e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
v = _data; v = _data;
dx = 0; dx = 0;
dy = 0; dy = 0;
if (v->select.on) if (v->select.on)
{ {
dx = v->select.down.x - _x; dx = v->select.down.x - _x;
@ -350,6 +356,7 @@ e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
v->select.on = 0; v->select.on = 0;
e_view_selection_update(v); e_view_selection_update(v);
} }
if ((_b == 1) && ((dx > 3) || (dy > 3))) if ((_b == 1) && ((dx > 3) || (dy > 3)))
{ {
Evas_List l; Evas_List l;
@ -370,11 +377,11 @@ e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
} }
} }
} }
else else if (v->select.last_count == 0)
{ {
if (_b == 1) if (_b == 1)
{ {
if (!(ev->mods & (mulit_select_mod | range_select_mod))) if (!(ev->mods & (multi_select_mod | range_select_mod)))
{ {
static E_Build_Menu *buildmenu = NULL; static E_Build_Menu *buildmenu = NULL;

View File

@ -78,6 +78,12 @@ struct _E_View
} spacing; } spacing;
struct { struct {
int on; int on;
/* The number of selected icons. */
int count;
/* The number of icons we selected the last time.
If this is > 0, we don't pop up menus when
the user clicks in a view. */
int last_count;
int x, y, w, h; int x, y, w, h;
struct { struct {
int x, y; int x, y;
@ -139,8 +145,7 @@ struct _E_View
int is_desktop; int is_desktop;
int have_resort_queued; int have_resort_queued;
int sel_count;
int changed; int changed;
E_Iconbar *iconbar; E_Iconbar *iconbar;