forked from enlightenment/enlightenment
* 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:
parent
a708bdfd42
commit
c728727b17
|
@ -2,6 +2,6 @@
|
|||
#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;
|
||||
Evas_List views = NULL;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef 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 Evas_List views;
|
||||
|
||||
|
|
14
src/icons.c
14
src/icons.c
|
@ -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 ((e->mods & mulit_select_mod))
|
||||
if ((e->mods & multi_select_mod))
|
||||
{
|
||||
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
|
||||
{
|
||||
if ((e->mods & mulit_select_mod))
|
||||
if ((e->mods & multi_select_mod))
|
||||
{
|
||||
if ((ic->state.selected) && (!ic->state.just_selected))
|
||||
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;
|
||||
|
||||
v = l->data;
|
||||
D("sel count %i\n", v->sel_count);
|
||||
if (v->sel_count > 0)
|
||||
D("sel count %i\n", v->select.count);
|
||||
if (v->select.count > 0)
|
||||
{
|
||||
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;
|
||||
|
||||
v = l->data;
|
||||
if (v->sel_count > 0)
|
||||
if (v->select.count > 0)
|
||||
{
|
||||
for (ll = v->icons; ll; ll = ll->next) {
|
||||
E_Icon *ic;
|
||||
|
@ -830,7 +830,7 @@ e_icon_select(E_Icon *ic)
|
|||
if (!ic->state.selected)
|
||||
{
|
||||
ic->state.selected = 1;
|
||||
ic->view->sel_count++;
|
||||
ic->view->select.count++;
|
||||
e_icon_update_state(ic);
|
||||
}
|
||||
|
||||
|
@ -845,7 +845,7 @@ e_icon_deselect(E_Icon *ic)
|
|||
if (ic->state.selected)
|
||||
{
|
||||
ic->state.selected = 0;
|
||||
ic->view->sel_count--;
|
||||
ic->view->select.count--;
|
||||
e_icon_update_state(ic);
|
||||
}
|
||||
|
||||
|
|
13
src/view.c
13
src/view.c
|
@ -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;
|
||||
ev = current_ev->event;
|
||||
v = _data;
|
||||
if (!(ev->mods & (mulit_select_mod | range_select_mod)))
|
||||
|
||||
if (!(ev->mods & (multi_select_mod | range_select_mod)))
|
||||
{
|
||||
v->select.last_count = v->select.count;
|
||||
e_view_deselect_all();
|
||||
}
|
||||
|
||||
if (_b == 1)
|
||||
{
|
||||
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;
|
||||
dx = 0;
|
||||
dy = 0;
|
||||
|
||||
if (v->select.on)
|
||||
{
|
||||
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;
|
||||
e_view_selection_update(v);
|
||||
}
|
||||
|
||||
if ((_b == 1) && ((dx > 3) || (dy > 3)))
|
||||
{
|
||||
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 (!(ev->mods & (mulit_select_mod | range_select_mod)))
|
||||
if (!(ev->mods & (multi_select_mod | range_select_mod)))
|
||||
{
|
||||
static E_Build_Menu *buildmenu = NULL;
|
||||
|
||||
|
|
|
@ -78,6 +78,12 @@ struct _E_View
|
|||
} spacing;
|
||||
struct {
|
||||
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;
|
||||
struct {
|
||||
int x, y;
|
||||
|
@ -139,7 +145,6 @@ struct _E_View
|
|||
|
||||
int is_desktop;
|
||||
int have_resort_queued;
|
||||
int sel_count;
|
||||
|
||||
int changed;
|
||||
|
||||
|
|
Loading…
Reference in New Issue