- fix sliding back from list with no items
- allow direct sliding back. i.e. no need for mouse up and down again - fix theme path to /modules/everything SVN revision: 49236
This commit is contained in:
parent
71df71f4c8
commit
4bc1ed355e
|
@ -34189,6 +34189,15 @@ collections {
|
|||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
part {
|
||||
name: "event";
|
||||
repeat_events: 1;
|
||||
type: RECT;
|
||||
description {
|
||||
state: "default" 0.0;
|
||||
color: 0 0 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program {
|
||||
|
|
|
@ -758,7 +758,7 @@ _evry_window_new(E_Zone *zone, E_Zone_Edge edge)
|
|||
|
||||
o = edje_object_add(popup->evas);
|
||||
win->o_main = o;
|
||||
e_theme_edje_object_set(o, "base/theme/everything",
|
||||
e_theme_edje_object_set(o, "base/theme/modules/everything",
|
||||
"e/modules/everything/main");
|
||||
|
||||
if (e_config->use_composite)
|
||||
|
@ -1848,7 +1848,7 @@ evry_selectors_switch(int dir, int slide)
|
|||
|
||||
if (!s || !(it = s->cur_item) || !(it->plugin == (CUR_SEL)->actions))
|
||||
return 0;
|
||||
|
||||
|
||||
GET_ACTION(act,it);
|
||||
if (!act->it2.type)
|
||||
return 0;
|
||||
|
@ -2557,6 +2557,10 @@ _evry_view_slide_clear(Evry_View *v)
|
|||
evas_object_hide(v->o_list);
|
||||
}
|
||||
win->view_clearing = NULL;
|
||||
|
||||
/* replay mouse down to allow direct sliding back */
|
||||
if (win->mouse_button)
|
||||
evas_event_feed_mouse_down(win->popup->evas, win->mouse_button, 0, 0, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2570,6 +2574,10 @@ _evry_view_hide(Evry_View *v, int slide, int destroy)
|
|||
|
||||
if (slide && v->o_list)
|
||||
{
|
||||
/* replay mouse up to allow direct sliding back */
|
||||
if (win->mouse_button)
|
||||
evas_event_feed_mouse_up(win->popup->evas, win->mouse_button, 0, 0, NULL);
|
||||
|
||||
if (slide == SLIDE_RIGHT)
|
||||
{
|
||||
evas_object_hide(v->o_list);
|
||||
|
|
|
@ -434,7 +434,7 @@ Evas_Object *
|
|||
evry_icon_theme_get(const char *icon, Evas *e)
|
||||
{
|
||||
Evas_Object *o = e_icon_add(e);
|
||||
e_icon_preload_set(o, 1);
|
||||
/* e_icon_preload_set(o, 1); */
|
||||
|
||||
if (e_config->icon_theme_overrides)
|
||||
{
|
||||
|
@ -514,7 +514,7 @@ _file_icon_get(Evry_Item *it, Evas *e)
|
|||
if (it->icon[0] == '/')
|
||||
{
|
||||
o = e_icon_add(e);
|
||||
e_icon_preload_set(o, 1);
|
||||
/* e_icon_preload_set(o, 1); */
|
||||
|
||||
if (!e_icon_file_set(o, it->icon))
|
||||
{
|
||||
|
@ -575,7 +575,7 @@ evry_util_icon_get(Evry_Item *it, Evas *e)
|
|||
if (!o && it->icon && it->icon[0] == '/')
|
||||
{
|
||||
o = e_icon_add(e);
|
||||
e_icon_preload_set(o, 1);
|
||||
/* e_icon_preload_set(o, 1); */
|
||||
|
||||
if (!e_icon_file_set(o, it->icon))
|
||||
{
|
||||
|
|
|
@ -267,12 +267,12 @@ _item_show(View *v, Item *it, Evas_Object *list)
|
|||
it->frame = edje_object_add(v->evas);
|
||||
if (v->mode == VIEW_MODE_THUMB)
|
||||
{
|
||||
e_theme_edje_object_set(it->frame, "base/theme/everything",
|
||||
e_theme_edje_object_set(it->frame, "base/theme/modules/everything",
|
||||
"e/modules/everything/thumbview/item/thumb");
|
||||
}
|
||||
else
|
||||
{
|
||||
e_theme_edje_object_set(it->frame, "base/theme/everything",
|
||||
e_theme_edje_object_set(it->frame, "base/theme/modules/everything",
|
||||
"e/modules/everything/thumbview/item/list");
|
||||
|
||||
if (v->mode == VIEW_MODE_DETAIL)
|
||||
|
@ -971,13 +971,10 @@ _view_update(Evry_View *view)
|
|||
{
|
||||
sd->cur_item = v_it;
|
||||
v_it->selected = EINA_TRUE;
|
||||
if (v->mode == VIEW_MODE_THUMB)
|
||||
edje_object_signal_emit(v_it->frame, "e,state,selected", "e");
|
||||
}
|
||||
else
|
||||
{
|
||||
v_it->selected = EINA_FALSE;
|
||||
edje_object_signal_emit(v_it->frame, "e,state,unselected", "e");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -986,8 +983,7 @@ _view_update(Evry_View *view)
|
|||
|
||||
if (v_it->visible)
|
||||
{
|
||||
if (!first_vis)
|
||||
first_vis = v_it->pos;
|
||||
if (!first_vis) first_vis = v_it->pos;
|
||||
last_vis = v_it->pos;
|
||||
}
|
||||
|
||||
|
@ -1315,9 +1311,7 @@ _cb_item_changed(void *data, int type, void *event)
|
|||
Eina_List *l;
|
||||
Item *it;
|
||||
Smart_Data *sd = evas_object_smart_data_get(v->span);
|
||||
|
||||
if (!sd)
|
||||
return 1;
|
||||
if (!sd) return 1;
|
||||
|
||||
EINA_LIST_FOREACH(sd->items, l, it)
|
||||
if (it->item == ev->item)
|
||||
|
@ -1364,7 +1358,7 @@ _view_cb_mouse_wheel(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
Evas_Event_Mouse_Wheel *ev = event_info;
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
|
||||
if (!sd) return;
|
||||
if (ev->z)
|
||||
{
|
||||
if (sd->cur_item)
|
||||
|
@ -1373,13 +1367,38 @@ _view_cb_mouse_wheel(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_view_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Evas_Event_Mouse_Down *ev = event_info;
|
||||
Smart_Data *sd = evas_object_smart_data_get(data);
|
||||
if (!sd) return;
|
||||
sd->mouse_act = 1;
|
||||
sd->mouse_button = ev->button;
|
||||
sd->mouse_x = ev->canvas.x;
|
||||
sd->mouse_y = ev->canvas.y;
|
||||
}
|
||||
|
||||
static void
|
||||
_view_cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Evas_Event_Mouse_Up *ev = event_info;
|
||||
Smart_Data *sd = evas_object_smart_data_get(data);
|
||||
if (!sd) return;
|
||||
sd->mouse_x = 0;
|
||||
sd->mouse_y = 0;
|
||||
sd->mouse_button = 0;
|
||||
edje_object_signal_emit(sd->view->bg, "e,action,hide,into", "e");
|
||||
edje_object_signal_emit(sd->view->bg, "e,action,hide,back", "e");
|
||||
}
|
||||
|
||||
#define SLIDE_RESISTANCE 80
|
||||
|
||||
static void
|
||||
_view_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Evas_Event_Mouse_Move *ev = event_info;
|
||||
Smart_Data *sd = evas_object_smart_data_get(obj);
|
||||
Smart_Data *sd = evas_object_smart_data_get(data);
|
||||
Evry_Selector *sel;
|
||||
int diff_y, diff_x;
|
||||
|
||||
|
@ -1388,10 +1407,8 @@ _view_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
if (!sd->mouse_x)
|
||||
goto end;
|
||||
|
||||
if (!sd->it_down)
|
||||
goto end;
|
||||
|
||||
sel = sd->view->state->selector;
|
||||
|
||||
diff_x = abs(ev->cur.canvas.x - sd->mouse_x);
|
||||
diff_y = abs(ev->cur.canvas.y - sd->mouse_y);
|
||||
|
||||
|
@ -1402,21 +1419,23 @@ _view_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
goto end;
|
||||
}
|
||||
|
||||
if (sel->states->next)
|
||||
if (sel->states->next || (sel != sel->win->selectors[0]))
|
||||
edje_object_signal_emit(sd->view->bg, "e,action,show,back", "e");
|
||||
|
||||
if ((sd->it_down->item->browseable) ||
|
||||
(sel != sel->win->selectors[2]))
|
||||
edje_object_signal_emit(sd->view->bg, "e,action,show,into", "e");
|
||||
|
||||
if ((sd->cur_item != sd->it_down) && (diff_x > 10))
|
||||
if (sd->it_down)
|
||||
{
|
||||
evry_item_select(sd->view->state, sd->it_down->item);
|
||||
_pan_item_select(obj, sd->it_down, 0);
|
||||
if ((sd->it_down->item->browseable) ||
|
||||
(sel != sel->win->selectors[2]))
|
||||
edje_object_signal_emit(sd->view->bg, "e,action,show,into", "e");
|
||||
|
||||
if ((sd->cur_item != sd->it_down) && (diff_x > 10))
|
||||
{
|
||||
evry_item_select(sd->view->state, sd->it_down->item);
|
||||
_pan_item_select(data, sd->it_down, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if ((sd->mouse_button == 1) &&
|
||||
(sd->cur_item == sd->it_down))
|
||||
if (sd->mouse_button == 1)
|
||||
{
|
||||
if (ev->cur.canvas.x - sd->mouse_x > SLIDE_RESISTANCE)
|
||||
{
|
||||
|
@ -1428,7 +1447,8 @@ _view_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
else
|
||||
evry_selectors_switch(-1, EINA_TRUE);
|
||||
}
|
||||
else if (sd->mouse_x - ev->cur.canvas.x > SLIDE_RESISTANCE)
|
||||
else if ((sd->it_down && (sd->cur_item == sd->it_down)) &&
|
||||
(sd->mouse_x - ev->cur.canvas.x > SLIDE_RESISTANCE))
|
||||
{
|
||||
edje_object_signal_emit(sd->view->bg, "e,action,hide,into", "e");
|
||||
edje_object_signal_emit(sd->view->bg, "e,action,hide,back", "e");
|
||||
|
@ -1439,13 +1459,9 @@ _view_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((sel != sel->win->selectors[2]) &&
|
||||
/* dont jump out of sub-action */
|
||||
(!((sel == sel->win->selectors[1]) &&
|
||||
(sel->states->next))))
|
||||
evry_selectors_switch(1, EINA_TRUE);
|
||||
evry_selectors_switch(1, EINA_TRUE);
|
||||
}
|
||||
|
||||
|
||||
sd->it_down = NULL;
|
||||
sd->mouse_x = 0;
|
||||
sd->mouse_y = 0;
|
||||
|
@ -1492,19 +1508,24 @@ _view_create(Evry_View *view, const Evry_State *s, const Evas_Object *swallow)
|
|||
v->zoom = parent->zoom;
|
||||
|
||||
v->bg = edje_object_add(v->evas);
|
||||
e_theme_edje_object_set(v->bg, "base/theme/everything",
|
||||
e_theme_edje_object_set(v->bg, "base/theme/modules/everything",
|
||||
"e/modules/everything/thumbview/main/window");
|
||||
// scrolled thumbs
|
||||
v->span = _pan_add(v->evas);
|
||||
_pan_view_set(v->span, v);
|
||||
evas_object_event_callback_add(v->span, EVAS_CALLBACK_MOUSE_WHEEL,
|
||||
_view_cb_mouse_wheel, NULL);
|
||||
evas_object_event_callback_add(v->span, EVAS_CALLBACK_MOUSE_MOVE,
|
||||
_view_cb_mouse_move, NULL);
|
||||
|
||||
evas_object_event_callback_add(v->bg, EVAS_CALLBACK_MOUSE_MOVE,
|
||||
_view_cb_mouse_move, v->span);
|
||||
evas_object_event_callback_add(v->bg, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_view_cb_mouse_down, v->span);
|
||||
evas_object_event_callback_add(v->bg, EVAS_CALLBACK_MOUSE_UP,
|
||||
_view_cb_mouse_up, v->span);
|
||||
|
||||
// the scrollframe holding the scrolled thumbs
|
||||
v->sframe = e_scrollframe_add(v->evas);
|
||||
e_scrollframe_custom_theme_set(v->sframe, "base/theme/everything",
|
||||
e_scrollframe_custom_theme_set(v->sframe, "base/theme/modules/everything",
|
||||
"e/modules/everything/thumbview/main/scrollframe");
|
||||
e_scrollframe_thumbscroll_force(v->sframe, 1);
|
||||
|
||||
|
|
|
@ -196,7 +196,7 @@ _tabs_update(Tab_View *v)
|
|||
tab->plugin = p;
|
||||
tab->tab_view = v;
|
||||
o = edje_object_add(v->evas);
|
||||
e_theme_edje_object_set(o, "base/theme/everything",
|
||||
e_theme_edje_object_set(o, "base/theme/modules/everything",
|
||||
"e/modules/everything/tab_item");
|
||||
edje_object_part_text_set(o, "e.text.label", EVRY_ITEM(p)->label);
|
||||
|
||||
|
|
Loading…
Reference in New Issue