From 4fad3f45018866e8f0b29d0a3bdbbb4bdcad7864 Mon Sep 17 00:00:00 2001 From: Hannes Janetzek Date: Wed, 19 May 2010 02:43:41 +0000 Subject: [PATCH] show indicator for when thumb slide for/back is possible SVN revision: 48996 --- data/themes/default.edc | 111 ++++++++++++++---- src/modules/everything/e_mod_main.h | 2 + src/modules/everything/evry.c | 15 +-- src/modules/everything/evry_plug_view_thumb.c | 18 ++- 4 files changed, 110 insertions(+), 36 deletions(-) diff --git a/data/themes/default.edc b/data/themes/default.edc index 722cbbe21..ad59b73fc 100644 --- a/data/themes/default.edc +++ b/data/themes/default.edc @@ -33230,29 +33230,6 @@ collections { color: 200 200 200 255; } } - part { - name: "list_over2"; - clip_to: "base"; - mouse_events: 0; - description { - state: "default" 0.0; - rel1 { - offset: -1 -1; - to: "list_bg"; - } - rel2 { - offset: -1 -1; - to: "list_bg"; - } - image { - normal: "inset_sunk.png"; - border: 7 7 7 7; - middle: 0; - } - fill.smooth : 0; - color: 200 200 200 255; - } - } part { name: "box"; mouse_events: 0; @@ -33278,6 +33255,7 @@ collections { part { name: "win"; type: RECT; + mouse_events: 0; description { state: "default" 0.0; visible: 0; @@ -33295,12 +33273,13 @@ collections { part { name: "frame"; type: RECT; + mouse_events: 0;; description { state: "default" 0.0; visible: 0; rel1.to: "win"; rel2.to: "win"; -} + } description { state: "composite" 0.0; inherit: "default" 0.0; @@ -33310,6 +33289,7 @@ collections { } part { name: "shadow"; + mouse_events: 0; description { state: "default" 0.0; visible: 0; @@ -33334,6 +33314,7 @@ collections { } part { name: "bg"; + mouse_events: 0; description { state: "default" 0.0; max: 999 118; @@ -33962,6 +33943,10 @@ collections { group { name: "e/modules/everything/thumbview/main/window"; + images { + image: "icon_left_arrow.png" COMP; + image: "icon_right_arrow.png" COMP; + } parts { part { name: "e.swallow.list"; @@ -33978,6 +33963,84 @@ collections { } } } + part { + name: "left_arrow"; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + image.normal: "icon_left_arrow.png"; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + align: 0.0 0.5; + min: 32 32; + max: 32 32; + color: 255 255 255 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "right_arrow"; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + image.normal: "icon_right_arrow.png"; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + align: 1.0 0.5; + min: 32 32; + max: 32 32; + color: 255 255 255 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + } + programs { + program { + name: "go_into_show"; + signal: "e,action,show,into"; + source: "e"; + action: STATE_SET "visible" 0.0; + transition: LINEAR 0.5; + target: "right_arrow"; + } + program { + name: "go_into_hide"; + signal: "e,action,hide,into"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "right_arrow"; + transition: LINEAR 0.5; + } + program { + name: "go_back_show"; + signal: "e,action,show,back"; + source: "e"; + action: STATE_SET "visible" 0.0; + transition: LINEAR 0.5; + target: "left_arrow"; + } + program { + name: "go_back_hide"; + signal: "e,action,hide,back"; + source: "e"; + action: STATE_SET "default" 0.0; + target: "left_arrow"; + transition: LINEAR 0.5; + } } } group { diff --git a/src/modules/everything/e_mod_main.h b/src/modules/everything/e_mod_main.h index 3628d7746..11710335d 100644 --- a/src/modules/everything/e_mod_main.h +++ b/src/modules/everything/e_mod_main.h @@ -70,6 +70,8 @@ struct _Evry_Selector struct _Evry_State { + Evry_State *prev; + char *inp; /* alloced input */ char *input; /* pointer to input + trigger */ diff --git a/src/modules/everything/evry.c b/src/modules/everything/evry.c index df0e04bf0..a9d540e9f 100644 --- a/src/modules/everything/evry.c +++ b/src/modules/everything/evry.c @@ -1099,9 +1099,6 @@ _evry_selector_activate(Evry_Selector *sel) _evry_selector_label_set(sel, "e.text.plugin", ""); _evry_selector_signal_emit(sel, "e,state,unselected"); - /* edje_object_signal_emit(win->o_main, "", "e"); - * edje_object_part_text_set(win->o_main, "e.text.plugin", ""); */ - if (sel->state && sel->state->view) _evry_view_hide(sel->state->view, 0); @@ -1114,10 +1111,9 @@ _evry_selector_activate(Evry_Selector *sel) return; } - _evry_selector_signal_emit(sel, "e,state,selected"); - /* edje_object_signal_emit(sel->o_main, "e,state,selected", "e"); */ - win->selector = sel; + + _evry_selector_signal_emit(sel, "e,state,selected"); if ((s = sel->state)) { @@ -1126,9 +1122,6 @@ _evry_selector_activate(Evry_Selector *sel) if (s->cur_item) _evry_selector_label_set(sel, "e.text.plugin", EVRY_ITEM(s->cur_item->plugin)->label); - /* edje_object_part_text_set(sel->o_main, "e.text.plugin", - * EVRY_ITEM(s->cur_item->plugin)->label); */ - _evry_view_show(s->view); _evry_list_win_update(s); } @@ -1281,8 +1274,8 @@ _evry_selector_item_update(Evry_Selector *sel) else if (sel == win->selectors[2]) edje_object_part_swallow(win->o_main, "object_selector:e.swallow.icons", o); - sel->o_icon = o; evas_object_show(o); + sel->o_icon = o; } } @@ -1470,6 +1463,8 @@ _evry_state_new(Evry_Selector *sel, Eina_List *plugins) s->plugins = plugins; + s->prev = (sel->states ? sel->states->data : NULL); + sel->states = eina_list_prepend(sel->states, s); sel->state = s; diff --git a/src/modules/everything/evry_plug_view_thumb.c b/src/modules/everything/evry_plug_view_thumb.c index 670f210de..f20f76d8c 100644 --- a/src/modules/everything/evry_plug_view_thumb.c +++ b/src/modules/everything/evry_plug_view_thumb.c @@ -230,6 +230,8 @@ _item_up(void *data, Evas *e, Evas_Object *obj, void *event_info) if (!sd->it_down) return; + edje_object_signal_emit(sd->view->bg, "e,action,hide,into", "e"); + edje_object_signal_emit(sd->view->bg, "e,action,hide,back", "e"); sd->it_down = NULL; if (ev->button == 1) @@ -1551,8 +1553,18 @@ _view_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info) diff_x = abs(ev->cur.canvas.x - sd->mouse_x); diff_y = abs(ev->cur.canvas.y - sd->mouse_y); - if (diff_y > 10 + (diff_x/2)) - goto end; + if (diff_y > 15 + (diff_x/2)) + { + edje_object_signal_emit(sd->view->bg, "e,action,hide,into", "e"); + edje_object_signal_emit(sd->view->bg, "e,action,hide,back", "e"); + goto end; + } + + if (sd->view->state->prev) + edje_object_signal_emit(sd->view->bg, "e,action,show,back", "e"); + + if (sd->it_down->item->browseable) + edje_object_signal_emit(sd->view->bg, "e,action,show,into", "e"); if ((sd->cur_item != sd->it_down) && (diff_x > 10)) { @@ -1572,6 +1584,8 @@ _view_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info) } else if (sd->mouse_x - ev->cur.canvas.x > 100) { + edje_object_signal_emit(sd->view->bg, "e,action,hide,into", "e"); + edje_object_signal_emit(sd->view->bg, "e,action,hide,back", "e"); sd->it_down = NULL; sd->mouse_x = 0; sd->mouse_y = 0;