forked from enlightenment/enlightenment
added e action for edge bindings. preferable to be used with theme from trunk/THEMES/evry-theme
thumb mode zoom now between 96/128/256 dont sort non-tolevel plugins in front of other items make text plugin non-top level, so that it is always reachable. e.g. when you want to search the type text with google etc SVN revision: 49207
This commit is contained in:
parent
a9f6e4186e
commit
253d8be915
|
@ -6,6 +6,7 @@
|
|||
|
||||
|
||||
static void _e_mod_action_cb(E_Object *obj, const char *params);
|
||||
static void _e_mod_action_cb_edge(E_Object *obj, const char *params, E_Event_Zone_Edge *ev);
|
||||
static int _e_mod_run_defer_cb(void *data);
|
||||
static void _e_mod_run_cb(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
static void _e_mod_menu_add(void *data, E_Menu *m);
|
||||
|
@ -77,6 +78,7 @@ e_modapi_init(E_Module *m)
|
|||
if (act)
|
||||
{
|
||||
act->func.go = _e_mod_action_cb;
|
||||
act->func.go_edge = _e_mod_action_cb_edge;
|
||||
e_action_predef_name_set
|
||||
(_("Everything Launcher"),
|
||||
_("Show Everything Dialog"),
|
||||
|
@ -96,7 +98,7 @@ e_modapi_init(E_Module *m)
|
|||
|
||||
|
||||
_evry_events[EVRY_EVENT_ITEMS_UPDATE] = ecore_event_type_new();
|
||||
_evry_events[EVRY_EVENT_ITEM_SELECTED] = ecore_event_type_new();
|
||||
_evry_events[EVRY_EVENT_ITEM_SELECTED] = ecore_event_type_new();
|
||||
_evry_events[EVRY_EVENT_ITEM_CHANGED] = ecore_event_type_new();
|
||||
_evry_events[EVRY_EVENT_ACTION_PERFORMED] = ecore_event_type_new();
|
||||
|
||||
|
@ -349,6 +351,8 @@ _config_init()
|
|||
E_CONFIG_VAL(D, T, version, INT);
|
||||
E_CONFIG_VAL(D, T, width, INT);
|
||||
E_CONFIG_VAL(D, T, height, INT);
|
||||
E_CONFIG_VAL(D, T, edge_width, INT);
|
||||
E_CONFIG_VAL(D, T, edge_height, INT);
|
||||
E_CONFIG_VAL(D, T, rel_x, DOUBLE);
|
||||
E_CONFIG_VAL(D, T, rel_y, DOUBLE);
|
||||
E_CONFIG_VAL(D, T, scroll_animate, INT);
|
||||
|
@ -388,7 +392,7 @@ _config_init()
|
|||
evry_conf->rel_x = 0.5;
|
||||
evry_conf->rel_y = 0.33;
|
||||
evry_conf->width = 450;
|
||||
evry_conf->height = 415;
|
||||
evry_conf->height = 315;
|
||||
evry_conf->scroll_animate = 1;
|
||||
evry_conf->scroll_speed = 10.0;
|
||||
evry_conf->hide_input = 0;
|
||||
|
@ -399,11 +403,13 @@ _config_init()
|
|||
evry_conf->cycle_mode = 0;
|
||||
evry_conf->history_sort_mode = 0;
|
||||
evry_conf->first_run = EINA_TRUE;
|
||||
evry_conf->width = 435;
|
||||
evry_conf->height = 415;
|
||||
evry_conf->width = 390;
|
||||
evry_conf->height = 495;
|
||||
evry_conf->rel_y = 0.40;
|
||||
evry_conf->edge_width = 450;
|
||||
evry_conf->edge_height = 515;
|
||||
IFMODCFGEND;
|
||||
|
||||
|
||||
evry_conf->version = MOD_CONFIG_FILE_VERSION;
|
||||
}
|
||||
|
||||
|
@ -454,7 +460,7 @@ _e_mod_run_defer_cb(void *data)
|
|||
E_Zone *zone;
|
||||
|
||||
zone = data;
|
||||
if (zone) evry_show(zone, _params);
|
||||
if (zone) evry_show(zone, E_ZONE_EDGE_NONE, _params);
|
||||
|
||||
_idler = NULL;
|
||||
return 0;
|
||||
|
@ -489,6 +495,18 @@ _e_mod_action_cb(E_Object *obj, const char *params)
|
|||
_idler = ecore_idle_enterer_add(_e_mod_run_defer_cb, zone);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_action_cb_edge(E_Object *obj, const char *params, E_Event_Zone_Edge *ev)
|
||||
{
|
||||
IF_RELEASE(_params);
|
||||
if (params && params[0])
|
||||
_params = eina_stringshare_add(params);
|
||||
|
||||
if (_idler) ecore_idle_enterer_del(_idler);
|
||||
|
||||
evry_show(ev->zone, ev->edge, _params);
|
||||
}
|
||||
|
||||
/* menu item callback(s) */
|
||||
static void
|
||||
_e_mod_run_cb(void *data __UNUSED__, E_Menu *m, E_Menu_Item *mi __UNUSED__)
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
#include "e.h"
|
||||
#include "evry_api.h"
|
||||
|
||||
#define MOD_CONFIG_FILE_EPOCH 0x0002
|
||||
#define MOD_CONFIG_FILE_GENERATION 0x0002
|
||||
#define MOD_CONFIG_FILE_EPOCH 0x0003
|
||||
#define MOD_CONFIG_FILE_GENERATION 0x0001
|
||||
#define MOD_CONFIG_FILE_VERSION \
|
||||
((MOD_CONFIG_FILE_EPOCH << 16) | MOD_CONFIG_FILE_GENERATION)
|
||||
|
||||
|
@ -26,6 +26,7 @@ struct _Evry_Window
|
|||
|
||||
Eina_Bool visible;
|
||||
Ecore_Timer *show_timer;
|
||||
Ecore_Timer *hide_timer;
|
||||
|
||||
Eina_List *handlers;
|
||||
|
||||
|
@ -152,6 +153,7 @@ struct _Config
|
|||
double rel_x, rel_y;
|
||||
/* size */
|
||||
int width, height;
|
||||
int edge_width, edge_height;
|
||||
|
||||
Eina_List *modules;
|
||||
|
||||
|
@ -285,7 +287,7 @@ void evry_plug_text_shutdown(void);
|
|||
|
||||
int evry_init(void);
|
||||
int evry_shutdown(void);
|
||||
int evry_show(E_Zone *zone, const char *params);
|
||||
int evry_show(E_Zone *zone, E_Zone_Edge edge, const char *params);
|
||||
void evry_hide(int clear);
|
||||
|
||||
int evry_plug_actions_init();
|
||||
|
|
|
@ -40,7 +40,7 @@ static void _evry_selector_label_set(Evry_Selector *sel, const char *part, const
|
|||
static void _evry_selector_signal_emit(Evry_Selector *sel, const char *msg);
|
||||
static int _evry_selectors_shift(int dir);;
|
||||
|
||||
static Evry_Window *_evry_window_new(E_Zone *zone);
|
||||
static Evry_Window *_evry_window_new(E_Zone *zone, E_Zone_Edge edge);
|
||||
static void _evry_window_free(Evry_Window *win);
|
||||
static void _evry_list_win_show(void);
|
||||
static void _evry_list_win_update(Evry_State *s);
|
||||
|
@ -59,6 +59,8 @@ static void _evry_item_sel(Evry_State *s, Evry_Item *it);
|
|||
static int _evry_cb_key_down(void *data, int type, void *event);
|
||||
static int _evry_cb_selection_notify(void *data, int type, void *event);
|
||||
static int _evry_cb_mouse(void *data, int type, void *event);
|
||||
static int _evry_cb_mouse_in(void *data, int type, void *event);
|
||||
static int _evry_cb_mouse_out(void *data, int type, void *event);
|
||||
|
||||
/* local subsystem globals */
|
||||
static Evry_Window *win = NULL;
|
||||
|
@ -158,8 +160,17 @@ _cb_show_timer(void *data)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
_cb_hide_timer(void *data)
|
||||
{
|
||||
win->hide_timer = NULL;
|
||||
|
||||
evry_hide(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
evry_show(E_Zone *zone, const char *params)
|
||||
evry_show(E_Zone *zone, E_Zone_Edge edge, const char *params)
|
||||
{
|
||||
E_OBJECT_CHECK_RETURN(zone, 0);
|
||||
E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, 0);
|
||||
|
@ -180,7 +191,7 @@ evry_show(E_Zone *zone, const char *params)
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (!(params && eina_list_count((SUBJ_SEL)->states) == 1))
|
||||
if (eina_list_count((SUBJ_SEL)->states) < 2)
|
||||
evry_hide(1);
|
||||
|
||||
if (win && CUR_SEL && params)
|
||||
|
@ -197,15 +208,18 @@ evry_show(E_Zone *zone, const char *params)
|
|||
|
||||
input_window = ecore_x_window_input_new(zone->container->win, 0, 0, 1, 1);
|
||||
ecore_x_window_show(input_window);
|
||||
if (!e_grabinput_get(input_window, 0, input_window))
|
||||
return 0;
|
||||
|
||||
ecore_x_sync();
|
||||
if (edge == E_ZONE_EDGE_NONE)
|
||||
{
|
||||
if (!e_grabinput_get(input_window, 0, input_window))
|
||||
return 0;
|
||||
}
|
||||
|
||||
win = _evry_window_new(zone);
|
||||
win = _evry_window_new(zone, edge);
|
||||
if (!win)
|
||||
{
|
||||
ecore_x_window_free(input_window);
|
||||
e_grabinput_release(input_window, input_window);
|
||||
input_window = 0;
|
||||
return 0;
|
||||
}
|
||||
|
@ -259,17 +273,30 @@ evry_show(E_Zone *zone, const char *params)
|
|||
(ECORE_EVENT_MOUSE_WHEEL,
|
||||
_evry_cb_mouse, win));
|
||||
|
||||
if (edge)
|
||||
{
|
||||
win->handlers = eina_list_append
|
||||
(win->handlers, ecore_event_handler_add
|
||||
(ECORE_X_EVENT_MOUSE_IN,
|
||||
_evry_cb_mouse_in, win));
|
||||
|
||||
win->handlers = eina_list_append
|
||||
(win->handlers, ecore_event_handler_add
|
||||
(ECORE_X_EVENT_MOUSE_OUT,
|
||||
_evry_cb_mouse_out, win));
|
||||
}
|
||||
|
||||
e_popup_layer_set(win->popup, 255);
|
||||
e_popup_show(win->popup);
|
||||
|
||||
ecore_x_window_raise(input_window);
|
||||
_evry_selector_subjects_get(params);
|
||||
_evry_selector_update(SUBJ_SEL);
|
||||
_evry_selector_activate(SUBJ_SEL);
|
||||
|
||||
if (!evry_conf->hide_input)
|
||||
if (!evry_conf->hide_input || edge)
|
||||
edje_object_signal_emit(win->o_main, "list:e,state,entry_show", "e");
|
||||
|
||||
if (!evry_conf->hide_list)
|
||||
if (!evry_conf->hide_list || edge)
|
||||
win->show_timer = ecore_timer_add(0.01, _cb_show_timer, win);
|
||||
|
||||
return 1;
|
||||
|
@ -334,6 +361,8 @@ evry_hide(int clear)
|
|||
|
||||
if (win->show_timer)
|
||||
ecore_timer_del(win->show_timer);
|
||||
if (win->hide_timer)
|
||||
ecore_timer_del(win->hide_timer);
|
||||
|
||||
win->visible = EINA_FALSE;
|
||||
|
||||
|
@ -348,9 +377,12 @@ evry_hide(int clear)
|
|||
_evry_window_free(win);
|
||||
win = NULL;
|
||||
|
||||
ecore_x_window_free(input_window);
|
||||
e_grabinput_release(input_window, input_window);
|
||||
input_window = 0;
|
||||
if (input_window)
|
||||
{
|
||||
ecore_x_window_free(input_window);
|
||||
e_grabinput_release(input_window, input_window);
|
||||
input_window = 0;
|
||||
}
|
||||
|
||||
evry_history_unload();
|
||||
}
|
||||
|
@ -718,9 +750,9 @@ _evry_list_win_clear(int hide)
|
|||
}
|
||||
|
||||
static Evry_Window *
|
||||
_evry_window_new(E_Zone *zone)
|
||||
_evry_window_new(E_Zone *zone, E_Zone_Edge edge)
|
||||
{
|
||||
int x, y, mw, mh;
|
||||
int x, y, mw, mh, h, w;
|
||||
Evry_Window *win;
|
||||
E_Popup *popup;
|
||||
Evas_Object *o;
|
||||
|
@ -757,18 +789,65 @@ _evry_window_new(E_Zone *zone)
|
|||
|
||||
edje_object_size_min_calc(o, &mw, &mh);
|
||||
|
||||
if (edge == E_ZONE_EDGE_NONE)
|
||||
{
|
||||
w = evry_conf->width;
|
||||
h = evry_conf->height;
|
||||
}
|
||||
else
|
||||
{
|
||||
w = evry_conf->edge_width;
|
||||
h = evry_conf->edge_height;
|
||||
}
|
||||
|
||||
evry_conf->min_w = mw;
|
||||
if (evry_conf->width > mw)
|
||||
mw = evry_conf->width;
|
||||
if (w > mw) mw = w;
|
||||
|
||||
evry_conf->min_h = mh;
|
||||
if (evry_conf->height > mh)
|
||||
mh = evry_conf->height;
|
||||
if (h > mh) mh = h;
|
||||
|
||||
mw += offset_s*2;
|
||||
mh += offset_s*2;
|
||||
x = (zone->w * evry_conf->rel_x) - (mw / 2);
|
||||
y = (zone->h * evry_conf->rel_y) - (mh / 2);
|
||||
if (edge == E_ZONE_EDGE_NONE)
|
||||
{
|
||||
mw += offset_s*2;
|
||||
mh += offset_s*2;
|
||||
|
||||
x = (zone->w * evry_conf->rel_x) - (mw / 2);
|
||||
y = (zone->h * evry_conf->rel_y) - (mh / 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (edge)
|
||||
{
|
||||
case E_ZONE_EDGE_TOP_LEFT:
|
||||
x = 3 - offset_s;
|
||||
y = 3 - offset_s;
|
||||
break;
|
||||
case E_ZONE_EDGE_TOP_RIGHT:
|
||||
x = zone->w - (mw + offset_s + 3);
|
||||
y = 3 - offset_s;
|
||||
break;
|
||||
case E_ZONE_EDGE_BOTTOM_RIGHT:
|
||||
x = zone->w - (mw + offset_s + 3);
|
||||
y = zone->h - (mh + offset_s + 3);
|
||||
break;
|
||||
case E_ZONE_EDGE_BOTTOM_LEFT:
|
||||
x = 3 - offset_s;
|
||||
y = zone->h - (mh + offset_s + 3);
|
||||
break;
|
||||
|
||||
default:
|
||||
mw += offset_s*2;
|
||||
mh += offset_s*2;
|
||||
x = (zone->w * evry_conf->rel_x) - (mw / 2);
|
||||
y = (zone->h * evry_conf->rel_y) - (mh / 2);
|
||||
break;
|
||||
}
|
||||
|
||||
mw += offset_s*2;
|
||||
mh += offset_s*2;
|
||||
}
|
||||
|
||||
ecore_x_window_move_resize(input_window, x, y, mw, mh);
|
||||
|
||||
e_popup_move_resize(popup, x, y, mw, mh);
|
||||
|
||||
|
@ -792,6 +871,41 @@ _evry_cb_drag_finished(E_Drag *drag, int dropped)
|
|||
E_FREE(drag->data);
|
||||
}
|
||||
|
||||
static int
|
||||
_evry_cb_mouse_in(void *data, int type, void *event)
|
||||
{
|
||||
Ecore_X_Event_Mouse_In *ev = event;
|
||||
|
||||
if (ev->event_win != input_window)
|
||||
return 1;
|
||||
|
||||
e_grabinput_get(input_window, 0, input_window);
|
||||
|
||||
if (win && win->hide_timer)
|
||||
{
|
||||
ecore_timer_del(win->hide_timer);
|
||||
win->hide_timer = NULL;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_evry_cb_mouse_out(void *data, int type, void *event)
|
||||
{
|
||||
Ecore_X_Event_Mouse_In *ev = event;
|
||||
|
||||
if (!win || (ev->event_win != input_window))
|
||||
return 1;
|
||||
|
||||
if (win->hide_timer)
|
||||
return 1;
|
||||
|
||||
win->hide_timer = ecore_timer_add(0.3, _cb_hide_timer, win);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_evry_cb_mouse(void *data, int type, void *event)
|
||||
{
|
||||
|
@ -799,7 +913,9 @@ _evry_cb_mouse(void *data, int type, void *event)
|
|||
E_Popup *pop;
|
||||
|
||||
ev = event;
|
||||
if (ev->window != input_window) return 1;
|
||||
|
||||
if (ev->event_window != input_window)
|
||||
return 1;
|
||||
|
||||
pop = win->popup;
|
||||
|
||||
|
@ -811,8 +927,7 @@ _evry_cb_mouse(void *data, int type, void *event)
|
|||
if ((win->mouse_button == 3) &&
|
||||
(s = (CUR_SEL)->state) && (s->cur_item) &&
|
||||
(CHECK_TYPE(s->cur_item, EVRY_TYPE_FILE)) &&
|
||||
(!E_INSIDE(ev->x, ev->y, pop->x + pop->zone->x,
|
||||
pop->y + pop->zone->y, pop->w, pop->h)))
|
||||
(!E_INSIDE(ev->x, ev->y, pop->zone->x, pop->zone->y, pop->w, pop->h)))
|
||||
{
|
||||
const char *drag_types[] = { "text/uri-list" };
|
||||
E_Drag *d;
|
||||
|
@ -847,8 +962,8 @@ _evry_cb_mouse(void *data, int type, void *event)
|
|||
|
||||
evas_event_feed_mouse_move
|
||||
(pop->evas,
|
||||
ev->x - pop->x + pop->zone->x,
|
||||
ev->y - pop->y + pop->zone->y,
|
||||
ev->x - pop->zone->x,
|
||||
ev->y - pop->zone->y,
|
||||
ev->timestamp, NULL);
|
||||
}
|
||||
else if (type == ECORE_EVENT_MOUSE_BUTTON_DOWN)
|
||||
|
@ -856,8 +971,7 @@ _evry_cb_mouse(void *data, int type, void *event)
|
|||
win->mouse_out = 0;
|
||||
|
||||
/* XXX shift triple click in flags when needed */
|
||||
if (!E_INSIDE(ev->x, ev->y, pop->x + pop->zone->x,
|
||||
pop->y + pop->zone->y, pop->w, pop->h))
|
||||
if (!E_INSIDE(ev->x, ev->y, pop->zone->x, pop->zone->y, pop->w, pop->h))
|
||||
{
|
||||
win->mouse_out = 1;
|
||||
return 1;
|
||||
|
@ -875,8 +989,7 @@ _evry_cb_mouse(void *data, int type, void *event)
|
|||
win->mouse_button = 0;
|
||||
|
||||
if (win->mouse_out &&
|
||||
!E_INSIDE(ev->x, ev->y, pop->x + pop->zone->x,
|
||||
pop->y + pop->zone->y, pop->w, pop->h))
|
||||
!E_INSIDE(ev->x, ev->y, pop->zone->x, pop->zone->y, pop->w, pop->h))
|
||||
{
|
||||
evry_hide(0);
|
||||
return 1;
|
||||
|
@ -2343,6 +2456,7 @@ _evry_view_show(Evry_View *v, int slide)
|
|||
evas_object_show(v->o_list);
|
||||
|
||||
edje_object_signal_emit(win->o_main, "list:e,action,slide,left", "e");
|
||||
edje_object_signal_emit(v->o_list, "e,action,show,list", "e");
|
||||
}
|
||||
else if (slide > 0)
|
||||
{
|
||||
|
@ -2350,6 +2464,7 @@ _evry_view_show(Evry_View *v, int slide)
|
|||
evas_object_show(v->o_list);
|
||||
|
||||
edje_object_signal_emit(win->o_main, "list:e,action,slide,right", "e");
|
||||
edje_object_signal_emit(v->o_list, "e,action,show,list", "e");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2357,6 +2472,7 @@ _evry_view_show(Evry_View *v, int slide)
|
|||
evas_object_show(v->o_list);
|
||||
|
||||
edje_object_signal_emit(win->o_main, "list:e,action,slide,default", "e");
|
||||
edje_object_signal_emit(v->o_list, "e,action,show,list", "e");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2411,8 +2527,9 @@ _evry_view_hide(Evry_View *v, int slide)
|
|||
|
||||
edje_object_part_swallow(win->o_main, "list:e.swallow.list2", v->o_list);
|
||||
evas_object_show(v->o_list);
|
||||
v->clear_timer = ecore_timer_add(0.2, _clear_timer, v);
|
||||
|
||||
edje_object_signal_emit(v->o_list, "e,action,hide,list", "e");
|
||||
edje_object_signal_emit(v->o_list, "e.swallow.list:e,action,hide,list", "e");
|
||||
v->clear_timer = ecore_timer_add(0.3, _clear_timer, v);
|
||||
win->view_freeing = v;
|
||||
}
|
||||
else
|
||||
|
@ -2422,8 +2539,9 @@ _evry_view_hide(Evry_View *v, int slide)
|
|||
|
||||
edje_object_part_swallow(win->o_main, "list:e.swallow.list", v->o_list);
|
||||
evas_object_show(v->o_list);
|
||||
|
||||
v->clear_timer = ecore_timer_add(0.2, _clear_timer, v);
|
||||
edje_object_signal_emit(v->o_list, "e,action,hide,list", "e");
|
||||
edje_object_signal_emit(v->o_list, "e.swallow.list:e,action,hide,list", "e");
|
||||
v->clear_timer = ecore_timer_add(0.3, _clear_timer, v);
|
||||
win->view_clearing = v;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ struct _E_Config_Dialog_Data
|
|||
int quick_nav;
|
||||
|
||||
int width, height;
|
||||
int edge_width, edge_height;
|
||||
double rel_x, rel_y;
|
||||
int scroll_animate;
|
||||
double scroll_speed;
|
||||
|
@ -85,6 +86,8 @@ _fill_data(E_Config_Dialog_Data *cfdata)
|
|||
#define C(_name) cfdata->_name = evry_conf->_name
|
||||
C(height);
|
||||
C(width);
|
||||
C(edge_height);
|
||||
C(edge_width);
|
||||
C(hide_list);
|
||||
C(hide_input);
|
||||
C(quick_nav);
|
||||
|
@ -132,6 +135,8 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
|||
#define C(_name) evry_conf->_name = cfdata->_name
|
||||
C(height);
|
||||
C(width);
|
||||
C(edge_height);
|
||||
C(edge_width);
|
||||
C(hide_list);
|
||||
C(hide_input);
|
||||
C(quick_nav);
|
||||
|
@ -563,6 +568,23 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *e, E_Config_Dialog_Data *cfdat
|
|||
e_widget_framelist_object_append(of, ob);
|
||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||
|
||||
of = e_widget_framelist_add(e, _("Edge Popup Size"), 0);
|
||||
ob = e_widget_label_add(e, _("Popup Width"));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
ob = e_widget_slider_add(e, 1, 0, _("%1.0f"),
|
||||
evry_conf->min_w, 800, 5, 0, NULL,
|
||||
&(cfdata->edge_width), 200);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
|
||||
ob = e_widget_label_add(e, _("Popup Height"));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
ob = e_widget_slider_add(e, 1, 0, _("%1.0f"),
|
||||
evry_conf->min_h, 800, 5, 0, NULL,
|
||||
&(cfdata->edge_height), 200);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||
|
||||
|
||||
e_widget_toolbook_page_append(otb, NULL, _("Geometry"),
|
||||
o, 1, 0, 1, 0, 0.5, 0.0);
|
||||
|
||||
|
|
|
@ -444,7 +444,11 @@ evry_history_item_usage_set(Evry_Item *it, const char *input, const char *ctxt)
|
|||
if (hi->last_used > it->usage)
|
||||
it->usage = hi->last_used;
|
||||
}
|
||||
|
||||
if (it->fuzzy_match > 0)
|
||||
it->usage /= (double) it->fuzzy_match;
|
||||
else
|
||||
it->usage /= 100.0;
|
||||
|
||||
if (it->usage > 0.0)
|
||||
return 1;
|
||||
|
||||
|
|
|
@ -83,12 +83,12 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
|||
it->usage = 0;
|
||||
it->fuzzy_match = 0;
|
||||
|
||||
if (input)
|
||||
{
|
||||
evry_history_item_usage_set(it, NULL, NULL);
|
||||
it->usage /= 100.0;
|
||||
it->fuzzy_match = 6;
|
||||
}
|
||||
/* if (input)
|
||||
* {
|
||||
* evry_history_item_usage_set(it, NULL, NULL);
|
||||
* it->usage /= 100.0;
|
||||
* it->fuzzy_match = ;
|
||||
* } */
|
||||
|
||||
snprintf(buf, sizeof(buf), "%d %s", eina_list_count(pp->items), _("Items"));
|
||||
if (it->detail)
|
||||
|
@ -97,6 +97,12 @@ _fetch(Evry_Plugin *plugin, const char *input)
|
|||
|
||||
items = eina_list_append(items, it);
|
||||
}
|
||||
/* only one plugin: show items */
|
||||
if (eina_list_count(s->cur_plugins) == 1 && items)
|
||||
{
|
||||
lp = items;
|
||||
items = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (!lp && !items) return 0;
|
||||
|
|
|
@ -46,17 +46,19 @@ evry_plug_text_init(void)
|
|||
|
||||
if (evry_plugin_register(p1, EVRY_PLUGIN_OBJECT,999))
|
||||
{
|
||||
p1->config->trigger_only = 1;
|
||||
/* p1->config->trigger_only = 1; */
|
||||
p1->config->trigger = eina_stringshare_add(" ");
|
||||
p1->config->aggregate = EINA_FALSE;
|
||||
p1->config->top_level = EINA_FALSE;
|
||||
p1->config->view_mode = VIEW_MODE_LIST;
|
||||
}
|
||||
|
||||
if (evry_plugin_register(p2, EVRY_PLUGIN_SUBJECT, 999))
|
||||
{
|
||||
p2->config->trigger_only = 1;
|
||||
/* p2->config->trigger_only = 1; */
|
||||
p2->config->trigger = eina_stringshare_add(" ");
|
||||
p2->config->aggregate = EINA_FALSE;
|
||||
p2->config->top_level = EINA_FALSE;
|
||||
p2->config->view_mode = VIEW_MODE_LIST;
|
||||
}
|
||||
|
||||
|
|
|
@ -163,8 +163,8 @@ evry_plugin_register(Evry_Plugin *p, int type, int priority)
|
|||
|
||||
conf[type] = eina_list_sort(conf[type], -1, _evry_cb_plugin_sort);
|
||||
|
||||
EINA_LIST_FOREACH(conf[type], l, pc)
|
||||
pc->priority = i++;
|
||||
/* EINA_LIST_FOREACH(conf[type], l, pc)
|
||||
* pc->priority = i++; */
|
||||
|
||||
evry_conf->conf_subjects = conf[0];
|
||||
evry_conf->conf_actions = conf[1];
|
||||
|
|
|
@ -41,11 +41,7 @@ struct _Smart_Data
|
|||
Evas_Coord sx, sy;
|
||||
Eina_List *queue;
|
||||
|
||||
Evas_Object *selector;
|
||||
|
||||
double last_select;
|
||||
double sel_pos_to;
|
||||
double sel_pos;
|
||||
double scroll_align;
|
||||
double scroll_align_to;
|
||||
Ecore_Animator *animator;
|
||||
|
@ -228,9 +224,6 @@ _item_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
sd->mouse_x = ev->canvas.x;
|
||||
sd->mouse_y = ev->canvas.y;
|
||||
|
||||
if (sd->selector && evas_object_visible_get(sd->selector))
|
||||
evas_object_hide(sd->selector);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -255,18 +248,12 @@ _item_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
if (!(ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
|
||||
{
|
||||
if (sd->selector)
|
||||
evas_object_hide(sd->selector);
|
||||
|
||||
evry_item_select(sd->view->state, it->item);
|
||||
_pan_item_select(it->obj, it, 0);
|
||||
}
|
||||
}
|
||||
else if (ev->button == 3)
|
||||
{
|
||||
if (sd->selector)
|
||||
evas_object_hide(sd->selector);
|
||||
|
||||
evry_item_select(sd->view->state, it->item);
|
||||
_pan_item_select(it->obj, it, 0);
|
||||
|
||||
|
@ -302,7 +289,7 @@ _item_show(View *v, Item *it, Evas_Object *list)
|
|||
|
||||
evas_object_clip_set(it->frame, evas_object_clip_get(list));
|
||||
|
||||
if (it->selected && v->mode == VIEW_MODE_THUMB)
|
||||
if (it->selected)
|
||||
edje_object_signal_emit(it->frame, "e,state,selected", "e");
|
||||
|
||||
if (it->item->marked)
|
||||
|
@ -372,30 +359,30 @@ _e_smart_reconfigure_do(void *data)
|
|||
}
|
||||
else
|
||||
{
|
||||
int size;
|
||||
int cnt = eina_list_count(sd->items);
|
||||
double col;
|
||||
|
||||
if (sd->view->zoom == 0)
|
||||
{
|
||||
int cnt = eina_list_count(sd->items);
|
||||
|
||||
aspect_w *= 3;
|
||||
aspect_w /= 4;
|
||||
|
||||
if (cnt < 3)
|
||||
iw = (double)sd->w / 2.5;
|
||||
else if (cnt < 7)
|
||||
iw = sd->w / 3;
|
||||
else
|
||||
iw = sd->w / 4;
|
||||
}
|
||||
size = 96;
|
||||
else if (sd->view->zoom == 1)
|
||||
{
|
||||
aspect_w *= 2;
|
||||
aspect_w /= 3;
|
||||
iw = sd->w / 3;
|
||||
}
|
||||
else /* if (sd->zoom == 2) */
|
||||
{
|
||||
iw = sd->w;
|
||||
}
|
||||
size = 128;
|
||||
else if (sd->view->zoom == 2)
|
||||
size = 256;
|
||||
|
||||
aspect_w *= 1 + (sd->h / size);
|
||||
|
||||
if (cnt < 3)
|
||||
col = 2;
|
||||
else if (cnt < 7)
|
||||
col = 3;
|
||||
else
|
||||
col = sd->w / size;
|
||||
|
||||
if (col < 1) col = 1;
|
||||
|
||||
iw = sd->w / col;
|
||||
aspect_w /= col;
|
||||
}
|
||||
|
||||
if (aspect_w <= 0) aspect_w = 1;
|
||||
|
@ -452,30 +439,6 @@ _e_smart_reconfigure_do(void *data)
|
|||
{
|
||||
if (sd->w > sd->cw) ox = (sd->w - sd->cw) / 2;
|
||||
if (sd->h > sd->ch) oy = (sd->h - sd->ch) / 2;
|
||||
|
||||
if (sd->selector)
|
||||
evas_object_hide(sd->selector);
|
||||
}
|
||||
else if (!sd->mouse_act)
|
||||
{
|
||||
if (!sd->selector)
|
||||
{
|
||||
sd->selector = edje_object_add(sd->view->evas);
|
||||
e_theme_edje_object_set(sd->selector, "base/theme/everything",
|
||||
"e/modules/everything/thumbview/item/list");
|
||||
|
||||
evas_object_smart_member_add(sd->selector, obj);
|
||||
evas_object_clip_set(sd->selector, evas_object_clip_get(obj));
|
||||
edje_object_signal_emit(sd->selector, "e,state,selected", "e");
|
||||
}
|
||||
|
||||
if (sd->cur_item)
|
||||
evas_object_show(sd->selector);
|
||||
else
|
||||
evas_object_hide(sd->selector);
|
||||
|
||||
evas_object_resize(sd->selector, ww, hh);
|
||||
evas_object_move(sd->selector, sd->x, sd->y + sd->sel_pos);
|
||||
}
|
||||
|
||||
EINA_LIST_FOREACH(sd->items, l, it)
|
||||
|
@ -547,9 +510,6 @@ _e_smart_del(Evas_Object *obj)
|
|||
|
||||
_animator_del(obj);
|
||||
|
||||
if (sd->selector)
|
||||
evas_object_del(sd->selector);
|
||||
|
||||
free(sd);
|
||||
evas_object_smart_data_set(obj, NULL);
|
||||
}
|
||||
|
@ -724,26 +684,10 @@ _animator(void *data)
|
|||
double da;
|
||||
double spd = ((25.0/ (double)e_config->framerate) /
|
||||
(double) (1 + sd->view->zoom));
|
||||
/* if (sd->sliding) spd *= 1.5; */
|
||||
if (spd > 0.9) spd = 0.9;
|
||||
|
||||
int wait = 0;
|
||||
|
||||
if (sd->sel_pos != sd->sel_pos_to)
|
||||
{
|
||||
sd->sel_pos = ((sd->sel_pos * (1.0 - spd)) +
|
||||
(sd->sel_pos_to * spd));
|
||||
|
||||
da = sd->sel_pos - sd->sel_pos_to;
|
||||
if (da < 0.0) da = -da;
|
||||
if (da < 0.02)
|
||||
sd->sel_pos = sd->sel_pos_to;
|
||||
else
|
||||
wait++;
|
||||
|
||||
_e_smart_reconfigure(data);
|
||||
}
|
||||
|
||||
if (sd->scroll_align != sd->scroll_align_to)
|
||||
{
|
||||
sd->scroll_align = ((sd->scroll_align * (1.0 - spd)) +
|
||||
|
@ -769,6 +713,31 @@ _animator(void *data)
|
|||
|
||||
}
|
||||
|
||||
static int
|
||||
_child_region_get(Evas_Object *obj, Evas_Coord y, Evas_Coord h)
|
||||
{
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
Evas_Coord my = 0, ch = 0, py = 0, ny;
|
||||
|
||||
py = sd->cy;
|
||||
ch = sd->ch;
|
||||
|
||||
if (sd->h < sd->ch)
|
||||
my = sd->ch - sd->h;
|
||||
else
|
||||
my = 0;
|
||||
|
||||
ny = py;
|
||||
if (y < py) ny = y;
|
||||
else if ((y + h) > (py + (ch - my)))
|
||||
{
|
||||
ny = y + h - (ch - my);
|
||||
if (ny > y) ny = y;
|
||||
}
|
||||
|
||||
return ny;
|
||||
}
|
||||
|
||||
static void
|
||||
_pan_item_select(Evas_Object *obj, Item *it, int scroll)
|
||||
{
|
||||
|
@ -776,6 +745,7 @@ _pan_item_select(Evas_Object *obj, Item *it, int scroll)
|
|||
double align = -1;
|
||||
int prev = -1;
|
||||
int align_to = -1;
|
||||
int cur_pos, new_pos;
|
||||
|
||||
if (sd->cur_item)
|
||||
{
|
||||
|
@ -783,23 +753,24 @@ _pan_item_select(Evas_Object *obj, Item *it, int scroll)
|
|||
sd->cur_item->selected = EINA_FALSE;
|
||||
edje_object_signal_emit(sd->cur_item->frame,
|
||||
"e,state,unselected", "e");
|
||||
sd->cur_item = NULL;
|
||||
}
|
||||
|
||||
sd->cur_item = NULL;
|
||||
|
||||
if (!it) return;
|
||||
|
||||
sd->cur_item = it;
|
||||
sd->cur_item->selected = EINA_TRUE;
|
||||
it->selected = EINA_TRUE;
|
||||
|
||||
edje_object_signal_emit(sd->cur_item->frame,
|
||||
"e,state,selected", "e");
|
||||
|
||||
if (evry_conf->scroll_animate)
|
||||
{
|
||||
double now = ecore_time_get();
|
||||
|
||||
if (now - sd->last_select < 0.1 && sd->sel_pos == sd->sel_pos_to)
|
||||
if (now - sd->last_select < 0.08)
|
||||
{
|
||||
sd->scroll_align = sd->scroll_align_to;
|
||||
|
||||
scroll = 0;
|
||||
}
|
||||
|
||||
|
@ -810,90 +781,30 @@ _pan_item_select(Evas_Object *obj, Item *it, int scroll)
|
|||
if (sd->mouse_act &&
|
||||
((sd->view->mode == VIEW_MODE_LIST ||
|
||||
sd->view->mode == VIEW_MODE_DETAIL)))
|
||||
{
|
||||
edje_object_signal_emit(sd->cur_item->frame,
|
||||
"e,state,selected", "e");
|
||||
return;
|
||||
}
|
||||
else if (it->h && (sd->view->mode == VIEW_MODE_LIST ||
|
||||
sd->view->mode == VIEW_MODE_DETAIL))
|
||||
{
|
||||
int all = sd->ch / it->h;
|
||||
int rows = (it->h && sd->h < sd->ch) ? (sd->h / it->h) : all;
|
||||
int cur = it->h ? it->y /it->h : 1;
|
||||
int dist = rows/2;
|
||||
int scroll = (prev > 0 ? cur - prev : 0);
|
||||
return;
|
||||
|
||||
if (scroll >= 0)
|
||||
{
|
||||
if (cur <= dist || all < rows)
|
||||
{
|
||||
/* step down start */
|
||||
align = 0;
|
||||
align_to = cur;
|
||||
|
||||
}
|
||||
else if ((all >= rows) && (all - cur < rows - dist))
|
||||
{
|
||||
/* step down end */
|
||||
align = (cur - dist);
|
||||
align_to = rows - (all - cur);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* align */
|
||||
align = (cur - dist);
|
||||
align_to = cur - align;
|
||||
}
|
||||
}
|
||||
else if (scroll < 0)
|
||||
{
|
||||
if (cur < rows - dist)
|
||||
{
|
||||
/* step up start */
|
||||
align = 0;
|
||||
align_to = cur;
|
||||
}
|
||||
else if ((all >= rows) && (all - cur <= rows - dist))
|
||||
{
|
||||
/* step up end */
|
||||
align = (cur - dist);
|
||||
align_to = rows - (all - cur);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* align */
|
||||
align = (cur - dist);
|
||||
align_to = cur - align;
|
||||
}
|
||||
}
|
||||
|
||||
align *= it->h;
|
||||
}
|
||||
else if (sd->view->mode == VIEW_MODE_THUMB)
|
||||
if (sd->view->mode == VIEW_MODE_THUMB)
|
||||
{
|
||||
if (sd->view->zoom < 2)
|
||||
{
|
||||
edje_object_signal_emit(sd->cur_item->frame,
|
||||
"e,state,selected", "e");
|
||||
}
|
||||
|
||||
if ((it->y + it->h) - sd->cy > sd->h)
|
||||
align = it->y - (2 - sd->view->zoom) * it->h;
|
||||
else if (it->y < sd->cy)
|
||||
align = it->y;
|
||||
align = _child_region_get(obj, it->y - it->h, it->h * 3);
|
||||
else
|
||||
align = _child_region_get(obj, it->y, it->h);
|
||||
}
|
||||
else
|
||||
{
|
||||
align = _child_region_get(obj, it->y - it->h*2, it->h * 5);
|
||||
}
|
||||
|
||||
if (!scroll || !evry_conf->scroll_animate)
|
||||
if (scroll && evry_conf->scroll_animate)
|
||||
{
|
||||
sd->scroll_align_to = align;
|
||||
|
||||
if (align != sd->cy && !sd->animator)
|
||||
sd->animator = ecore_animator_add(_animator, obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
sd->scroll_align = sd->scroll_align_to;
|
||||
sd->sel_pos = sd->sel_pos_to;
|
||||
|
||||
if (align_to >= 0)
|
||||
{
|
||||
sd->sel_pos = align_to * it->h;
|
||||
sd->sel_pos_to = sd->sel_pos;
|
||||
}
|
||||
|
||||
if (align >= 0)
|
||||
{
|
||||
|
@ -905,17 +816,6 @@ _pan_item_select(Evas_Object *obj, Item *it, int scroll)
|
|||
|
||||
_animator_del(obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (align_to >= 0)
|
||||
sd->sel_pos_to = align_to * it->h;
|
||||
|
||||
if (align >= 0)
|
||||
sd->scroll_align_to = align;
|
||||
|
||||
if (!sd->animator)
|
||||
sd->animator = ecore_animator_add(_animator, obj);
|
||||
}
|
||||
|
||||
_e_smart_reconfigure(obj);
|
||||
}
|
||||
|
@ -939,10 +839,6 @@ _clear_items(Evas_Object *obj)
|
|||
if (sd->thumb_idler)
|
||||
ecore_idle_enterer_del(sd->thumb_idler);
|
||||
sd->thumb_idler = NULL;
|
||||
|
||||
if (sd->selector)
|
||||
evas_object_del(sd->selector);
|
||||
sd->selector = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -996,14 +892,6 @@ _update_frame(Evas_Object *obj)
|
|||
|
||||
_e_smart_reconfigure_do(obj);
|
||||
|
||||
if (sd->view->mode)
|
||||
{
|
||||
evas_object_show(sd->selector);
|
||||
edje_object_signal_emit(sd->selector, "e,state,selected", "e");
|
||||
}
|
||||
else
|
||||
evas_object_hide(sd->selector);
|
||||
|
||||
_pan_item_select(obj, sd->cur_item, 0);
|
||||
|
||||
_e_smart_reconfigure(obj);
|
||||
|
@ -1465,7 +1353,6 @@ _view_cb_mouse_wheel(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
|
||||
if (ev->z)
|
||||
{
|
||||
evas_object_hide(sd->selector);
|
||||
if (sd->cur_item)
|
||||
edje_object_signal_emit(sd->cur_item->frame, "e,state,selected", "e");
|
||||
sd->mouse_act = 1;
|
||||
|
|
Loading…
Reference in New Issue