Add selector file
Signed-off-by: Chris Michael <devilhorns@comcast.net>
This commit is contained in:
parent
8500247adf
commit
48efe689bf
|
@ -0,0 +1,667 @@
|
|||
#include "private.h"
|
||||
|
||||
typedef struct _Selector Selector;
|
||||
typedef struct _Entry Entry;
|
||||
|
||||
struct _Selector
|
||||
{
|
||||
Evas_Object_Smart_Clipped_Data __clipped_data;
|
||||
Evas *evas;
|
||||
|
||||
Evas_Object *o_clip;
|
||||
Evas_Object *o_event;
|
||||
|
||||
Eina_List *entries;
|
||||
|
||||
int w, h;
|
||||
Evas_Coord px, px0, px1;
|
||||
Evas_Coord py, py0, py1;
|
||||
|
||||
double interp;
|
||||
double start, total;
|
||||
double zoom, zoom0, zoom1;
|
||||
double orig_zoom;
|
||||
|
||||
struct
|
||||
{
|
||||
Evas_Coord x, y;
|
||||
Eina_Bool down : 1;
|
||||
} mouse;
|
||||
|
||||
Ecore_Animator *anim;
|
||||
Ecore_Timer *autozoom;
|
||||
|
||||
Eina_Bool select : 1;
|
||||
Eina_Bool exit_me : 1;
|
||||
Eina_Bool exit_now : 1;
|
||||
Eina_Bool exit_on_sel : 1;
|
||||
Eina_Bool pending : 1;
|
||||
Eina_Bool use_px : 1;
|
||||
};
|
||||
|
||||
struct _Entry
|
||||
{
|
||||
Evas_Object *obj;
|
||||
Evas_Object *o_bg;
|
||||
Evas_Object *o_grid;
|
||||
|
||||
Eina_Bool selected : 1;
|
||||
Eina_Bool before : 1;
|
||||
Eina_Bool orig : 1;
|
||||
Eina_Bool was_selected : 1;
|
||||
};
|
||||
|
||||
/* local variables */
|
||||
static Evas_Smart *_smart = NULL;
|
||||
static Evas_Smart_Class _parent_sc = EVAS_SMART_CLASS_INIT_NULL;
|
||||
|
||||
static void _selector_transit(Evas_Object *obj, double t);
|
||||
|
||||
/* local functions */
|
||||
static void
|
||||
_selector_layout(Evas_Object *obj)
|
||||
{
|
||||
Selector *sd;
|
||||
Entry *en;
|
||||
Eina_List *l;
|
||||
Evas_Coord ox = 0, oy = 0, ow = 0, oh = 0;
|
||||
Evas_Coord w = 0, h = 0, px = 0, py = 0;
|
||||
int count = 0, ew = 0, eh = 0, x = 0, y = 0;
|
||||
|
||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
||||
|
||||
count = eina_list_count(sd->entries);
|
||||
evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
|
||||
|
||||
ew = sqrt(count);
|
||||
if (ew < 1) ew = 1;
|
||||
eh = ((count + (ew - 1)) / ew);
|
||||
if (eh < 1) eh = 1;
|
||||
|
||||
w = (ow * sd->zoom);
|
||||
h = (oh * sd->zoom);
|
||||
|
||||
if (!sd->use_px)
|
||||
{
|
||||
EINA_LIST_FOREACH(sd->entries, l, en)
|
||||
{
|
||||
if (en->before)
|
||||
{
|
||||
sd->px0 = (x * w);
|
||||
sd->py0 = (y * h);
|
||||
}
|
||||
if ((sd->exit_on_sel) && (!sd->exit_now))
|
||||
{
|
||||
if (en->before)
|
||||
{
|
||||
sd->px1 = (x * w);
|
||||
sd->py1 = (y * h);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (en->selected)
|
||||
{
|
||||
sd->px1 = (x * w);
|
||||
sd->py1 = (y * h);
|
||||
}
|
||||
}
|
||||
x++;
|
||||
if (x >= ew)
|
||||
{
|
||||
x = 0;
|
||||
y++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sd->px = (sd->px0 + ((sd->px1 - sd->px0) * sd->interp));
|
||||
sd->py = (sd->py0 + ((sd->py1 - sd->py0) * sd->interp));
|
||||
|
||||
px = sd->px;
|
||||
py = sd->py;
|
||||
|
||||
if ((ew > 0) && (w > 0) && (eh > 0) && (h > 0))
|
||||
{
|
||||
Evas_Coord ww, hh;
|
||||
|
||||
ww = (ew * w);
|
||||
hh = (eh * h);
|
||||
if (ww <= w) px = (ww - ow) / 2;
|
||||
else px = px - ((px * (ow - w)) / (ww - w));
|
||||
if (hh <= h) py = (hh - oh) / 2;
|
||||
else py = py - ((py * (oh - h)) / (hh - h));
|
||||
}
|
||||
x = y = 0;
|
||||
|
||||
EINA_LIST_FOREACH(sd->entries, l, en)
|
||||
{
|
||||
evas_object_move(en->o_bg, ox + (x * w) - px, oy + (y * h) - py);
|
||||
evas_object_resize(en->o_bg, w, h);
|
||||
evas_object_show(en->o_bg);
|
||||
x++;
|
||||
if (x >= ew)
|
||||
{
|
||||
x = 0;
|
||||
y++;
|
||||
}
|
||||
}
|
||||
|
||||
if ((sd->w > 0) && (sd->h > 0) && (sd->pending))
|
||||
{
|
||||
sd->pending = EINA_FALSE;
|
||||
EINA_LIST_FOREACH(sd->entries, l, en)
|
||||
{
|
||||
if ((!en->was_selected) && (en->selected))
|
||||
edje_object_signal_emit(en->o_bg, "selected", "express");
|
||||
else if ((en->was_selected) && (!en->selected))
|
||||
edje_object_signal_emit(en->o_bg, "unselected", "express");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_selector_cb_anim(void *data)
|
||||
{
|
||||
Evas_Object *obj;
|
||||
Selector *sd;
|
||||
double t = 1.0;
|
||||
|
||||
if (!(obj = data)) return EINA_FALSE;
|
||||
if (!(sd = evas_object_smart_data_get(obj))) return EINA_FALSE;
|
||||
|
||||
if (sd->total > 0.0)
|
||||
{
|
||||
t = (ecore_loop_time_get() - sd->start) / sd->total;
|
||||
if (t < 0.0) t = 0.0;
|
||||
else if (t > 1.0) t = 1.0;
|
||||
}
|
||||
|
||||
sd->interp = ecore_animator_pos_map(t, ECORE_POS_MAP_DECELERATE, 0, 0);
|
||||
sd->zoom = sd->zoom0 + ((sd->zoom1 - sd->zoom0) * sd->interp);
|
||||
_selector_layout(obj);
|
||||
|
||||
if (t >= 1.0)
|
||||
{
|
||||
sd->anim = NULL;
|
||||
if ((sd->exit_on_sel) && (!sd->exit_now))
|
||||
{
|
||||
if (sd->autozoom)
|
||||
{
|
||||
ecore_timer_del(sd->autozoom);
|
||||
sd->autozoom = NULL;
|
||||
}
|
||||
sd->exit_now = EINA_TRUE;
|
||||
evas_object_smart_callback_call(obj, "ending", NULL);
|
||||
_selector_zoom(obj, 1.0);
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
if ((sd->select) || (sd->exit_now))
|
||||
{
|
||||
Entry *en;
|
||||
Eina_List *l;
|
||||
Evas_Object *entry = NULL;
|
||||
|
||||
EINA_LIST_FOREACH(sd->entries, l, en)
|
||||
{
|
||||
if (en->selected) entry = en->obj;
|
||||
}
|
||||
if (entry)
|
||||
evas_object_smart_callback_call(obj, "selected", entry);
|
||||
}
|
||||
else if (sd->exit_me)
|
||||
evas_object_smart_callback_call(obj, "exit", NULL);
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_selector_cb_mouse_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
|
||||
{
|
||||
Selector *sd;
|
||||
Evas_Event_Mouse_Up *ev;
|
||||
Evas_Coord dx, dy, size;
|
||||
|
||||
ev = event;
|
||||
if (!(sd = evas_object_smart_data_get(data))) return;
|
||||
|
||||
if (!sd->mouse.down) return;
|
||||
sd->mouse.down = EINA_FALSE;
|
||||
dx = abs(ev->canvas.x - sd->mouse.x);
|
||||
dy = abs(ev->canvas.y - sd->mouse.y);
|
||||
|
||||
size = elm_config_finger_size_get();
|
||||
if ((dx <= size) && (dy <= size))
|
||||
{
|
||||
Entry *en;
|
||||
Eina_List *l;
|
||||
Evas_Coord x, y, ox, oy, ow, oh;
|
||||
|
||||
x = ev->canvas.x;
|
||||
y = ev->canvas.y;
|
||||
EINA_LIST_FOREACH(sd->entries, l, en)
|
||||
{
|
||||
evas_object_geometry_get(en->o_bg, &ox, &oy, &ow, &oh);
|
||||
if (ELM_RECTS_INTERSECT(ox, oy, ow, oh, x, y, 1, 1))
|
||||
{
|
||||
_selector_entry_selected_set(data, en->obj, EINA_FALSE);
|
||||
sd->select = EINA_TRUE;
|
||||
sd->exit_me = EINA_FALSE;
|
||||
if (sd->autozoom)
|
||||
{
|
||||
ecore_timer_del(sd->autozoom);
|
||||
sd->autozoom = NULL;
|
||||
}
|
||||
evas_object_smart_callback_call(data, "ending", NULL);
|
||||
_selector_zoom(data, 1.0);
|
||||
return;
|
||||
}
|
||||
evas_object_smart_callback_call(data, "clicked", NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_selector_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
|
||||
{
|
||||
Selector *sd;
|
||||
Evas_Event_Mouse_Down *ev;
|
||||
|
||||
ev = event;
|
||||
if (!(sd = evas_object_smart_data_get(data))) return;
|
||||
|
||||
if (sd->mouse.down) return;
|
||||
if (ev->button != 1) return;
|
||||
sd->mouse.x = ev->canvas.x;
|
||||
sd->mouse.y = ev->canvas.y;
|
||||
sd->mouse.down = EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_selector_cb_mouse_move(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
|
||||
{
|
||||
Selector *sd;
|
||||
Evas_Event_Mouse_Move *ev;
|
||||
Evas_Coord x = 0, y = 0, w = 0, h = 0;
|
||||
Evas_Coord sw = 0, sh = 0;
|
||||
int ew = 0, eh = 0, count = 0;
|
||||
|
||||
ev = event;
|
||||
if (!(sd = evas_object_smart_data_get(data))) return;
|
||||
|
||||
if ((sd->exit_me) || (sd->exit_now) || (sd->select)) return;
|
||||
|
||||
count = eina_list_count(sd->entries);
|
||||
|
||||
ew = sqrt(count);
|
||||
if (ew < 1) ew = 1;
|
||||
eh = (count + (ew - 1)) / ew;
|
||||
if (ew < 1) ew = 1;
|
||||
|
||||
evas_object_geometry_get(data, &x, &y, &w, &h);
|
||||
sw = w * sd->zoom;
|
||||
sh = h * sd->zoom;
|
||||
if (!sd->mouse.down)
|
||||
{
|
||||
if ((w > 0) && (h > 0))
|
||||
{
|
||||
_selector_transit(data, 0.5);
|
||||
sd->px1 = ((ev->cur.canvas.x - x) * ((ew - 1) * sw)) / w;
|
||||
sd->py1 = ((ev->cur.canvas.y - y) * ((eh - 1) * sh)) / h;
|
||||
sd->use_px = EINA_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_selector_entry_grid_cb_del(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
|
||||
{
|
||||
Entry *en;
|
||||
|
||||
if (!(en = data)) return;
|
||||
if (en->o_grid)
|
||||
evas_object_event_callback_del_full(en->o_grid, EVAS_CALLBACK_DEL,
|
||||
_selector_entry_grid_cb_del, en);
|
||||
en->o_grid = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_selector_entry_cb_del(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
|
||||
{
|
||||
Entry *en;
|
||||
|
||||
if (!(en = data)) return;
|
||||
if (en->obj)
|
||||
evas_object_event_callback_del_full(en->obj, EVAS_CALLBACK_DEL,
|
||||
_selector_entry_cb_del, en);
|
||||
en->obj = NULL;
|
||||
|
||||
if (en->o_grid)
|
||||
{
|
||||
/* TODO: callbacks del */
|
||||
evas_object_event_callback_del_full(en->o_grid, EVAS_CALLBACK_DEL,
|
||||
_selector_entry_grid_cb_del, en);
|
||||
}
|
||||
en->o_grid = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_selector_transit(Evas_Object *obj, double t)
|
||||
{
|
||||
Selector *sd;
|
||||
|
||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
||||
sd->px0 = sd->px;
|
||||
sd->py0 = sd->py;
|
||||
sd->zoom0 = sd->zoom;
|
||||
sd->start = ecore_loop_time_get();
|
||||
sd->total = t;
|
||||
sd->interp = 0.0;
|
||||
if (!sd->anim) sd->anim = ecore_animator_add(_selector_cb_anim, obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_selector_label_redo(Entry *en)
|
||||
{
|
||||
const char *n;
|
||||
|
||||
if (!en->obj) return;
|
||||
if (!en->o_grid) return;
|
||||
if ((n = _grid_name_get(en->o_grid)))
|
||||
edje_object_part_text_set(en->o_bg, "label", n);
|
||||
}
|
||||
|
||||
static void
|
||||
_smart_add(Evas_Object *obj)
|
||||
{
|
||||
Selector *sd;
|
||||
|
||||
if (!(sd = calloc(1, sizeof(Selector)))) return;
|
||||
|
||||
evas_object_smart_data_set(obj, sd);
|
||||
|
||||
_parent_sc.add(obj);
|
||||
|
||||
sd->evas = evas_object_evas_get(obj);
|
||||
sd->o_clip = evas_object_rectangle_add(sd->evas);
|
||||
evas_object_color_set(sd->o_clip, 255, 255, 255, 255);
|
||||
evas_object_smart_member_add(sd->o_clip, obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_smart_del(Evas_Object *obj)
|
||||
{
|
||||
Selector *sd;
|
||||
Entry *en;
|
||||
|
||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
||||
|
||||
if (sd->o_clip) evas_object_del(sd->o_clip);
|
||||
if (sd->o_event) evas_object_del(sd->o_event);
|
||||
|
||||
if (sd->anim) ecore_animator_del(sd->anim);
|
||||
if (sd->autozoom) ecore_timer_del(sd->autozoom);
|
||||
|
||||
EINA_LIST_FREE(sd->entries, en)
|
||||
{
|
||||
if (en->o_grid)
|
||||
{
|
||||
/* TODO: */
|
||||
evas_object_event_callback_del_full(en->o_grid,
|
||||
EVAS_CALLBACK_DEL,
|
||||
_selector_entry_grid_cb_del,
|
||||
en);
|
||||
}
|
||||
if (en->obj)
|
||||
{
|
||||
evas_object_event_callback_del_full(en->obj, EVAS_CALLBACK_DEL,
|
||||
_selector_entry_cb_del, en);
|
||||
evas_object_del(en->obj);
|
||||
}
|
||||
if (en->o_bg) evas_object_del(en->o_bg);
|
||||
free(en);
|
||||
}
|
||||
|
||||
_parent_sc.del(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_smart_move(Evas_Object *obj, Evas_Coord x EINA_UNUSED, Evas_Coord y EINA_UNUSED)
|
||||
{
|
||||
Selector *sd;
|
||||
|
||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
||||
evas_object_smart_changed(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
||||
{
|
||||
Selector *sd;
|
||||
Evas_Coord ow = 0, oh = 0;
|
||||
|
||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
||||
|
||||
evas_object_geometry_get(obj, NULL, NULL, &ow, &oh);
|
||||
if ((ow == w) && (oh == h)) return;
|
||||
evas_object_smart_changed(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_smart_calculate(Evas_Object *obj)
|
||||
{
|
||||
Selector *sd;
|
||||
Evas_Coord ox = 0, oy = 0, ow = 0, oh = 0;
|
||||
|
||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
||||
evas_object_geometry_get(obj, &ox, &oy, &ow, &oh);
|
||||
sd->w = ow;
|
||||
sd->h = oh;
|
||||
evas_object_move(sd->o_clip, ox, oy);
|
||||
evas_object_resize(sd->o_clip, ow, oh);
|
||||
evas_object_move(sd->o_event, ox, oy);
|
||||
evas_object_resize(sd->o_event, ow, oh);
|
||||
|
||||
_selector_layout(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_smart_init(void)
|
||||
{
|
||||
static Evas_Smart_Class sc;
|
||||
|
||||
evas_object_smart_clipped_smart_set(&_parent_sc);
|
||||
|
||||
sc = _parent_sc;
|
||||
sc.name = "selector";
|
||||
sc.version = EVAS_SMART_CLASS_VERSION;
|
||||
sc.add = _smart_add;
|
||||
sc.del = _smart_del;
|
||||
sc.resize = _smart_resize;
|
||||
sc.move = _smart_move;
|
||||
sc.calculate = _smart_calculate;
|
||||
|
||||
_smart = evas_smart_class_new(&sc);
|
||||
}
|
||||
|
||||
/* external functions */
|
||||
Evas_Object *
|
||||
_selector_add(Evas_Object *parent)
|
||||
{
|
||||
Evas_Object *obj;
|
||||
Selector *sd;
|
||||
Evas *evas;
|
||||
|
||||
if (!parent) return NULL;
|
||||
if (!(evas = evas_object_evas_get(parent))) return NULL;
|
||||
|
||||
if (!_smart) _smart_init();
|
||||
|
||||
obj = evas_object_smart_add(evas, _smart);
|
||||
if (!(sd = evas_object_smart_data_get(obj))) return obj;
|
||||
|
||||
sd->o_event = evas_object_rectangle_add(evas);
|
||||
evas_object_color_set(sd->o_event, 0, 0, 0, 0);
|
||||
evas_object_repeat_events_set(sd->o_event, EINA_TRUE);
|
||||
evas_object_smart_member_add(sd->o_event, obj);
|
||||
evas_object_clip_set(sd->o_event, sd->o_clip);
|
||||
evas_object_show(sd->o_event);
|
||||
|
||||
evas_object_event_callback_add(sd->o_event, EVAS_CALLBACK_MOUSE_UP,
|
||||
_selector_cb_mouse_up, obj);
|
||||
evas_object_event_callback_add(sd->o_event, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_selector_cb_mouse_down, obj);
|
||||
evas_object_event_callback_add(sd->o_event, EVAS_CALLBACK_MOUSE_MOVE,
|
||||
_selector_cb_mouse_move, obj);
|
||||
/* TODO: key down callback */
|
||||
|
||||
sd->zoom = 1.0;
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
void
|
||||
_selector_entry_add(Evas_Object *obj, Evas_Object *entry, Eina_Bool selected, Eina_Bool bell)
|
||||
{
|
||||
Selector *sd;
|
||||
Entry *en;
|
||||
|
||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
||||
|
||||
if (!(en = calloc(1, sizeof(Entry)))) return;
|
||||
|
||||
sd->entries = eina_list_append(sd->entries, en);
|
||||
|
||||
en->obj = entry;
|
||||
en->selected = selected;
|
||||
en->before = selected;
|
||||
en->orig = selected;
|
||||
|
||||
en->o_bg = edje_object_add(evas_object_evas_get(obj));
|
||||
_theme_apply(en->o_bg, "express/selector/entry");
|
||||
evas_object_smart_member_add(en->o_bg, obj);
|
||||
evas_object_clip_set(en->o_bg, sd->o_clip);
|
||||
edje_object_part_swallow(en->o_bg, "content", en->obj);
|
||||
evas_object_show(en->obj);
|
||||
|
||||
evas_object_stack_below(en->o_bg, sd->o_event);
|
||||
if (en->selected)
|
||||
edje_object_signal_emit(en->o_bg, "selected,start", "express");
|
||||
if (bell)
|
||||
edje_object_signal_emit(en->o_bg, "bell", "express");
|
||||
|
||||
if ((en->selected) || (bell))
|
||||
edje_object_message_signal_process(en->o_bg);
|
||||
|
||||
sd->interp = 1.0;
|
||||
|
||||
if ((en->o_grid = evas_object_data_get(en->obj, "grid")))
|
||||
{
|
||||
/* TODO */
|
||||
_selector_label_redo(en);
|
||||
evas_object_event_callback_add(en->o_grid, EVAS_CALLBACK_DEL,
|
||||
_selector_entry_grid_cb_del, en);
|
||||
}
|
||||
|
||||
evas_object_event_callback_add(en->obj, EVAS_CALLBACK_DEL,
|
||||
_selector_entry_cb_del, en);
|
||||
}
|
||||
|
||||
void
|
||||
_selector_entry_selected_set(Evas_Object *obj, Evas_Object *entry, Eina_Bool keep)
|
||||
{
|
||||
Selector *sd;
|
||||
Entry *en;
|
||||
Eina_List *l;
|
||||
|
||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
||||
|
||||
EINA_LIST_FOREACH(sd->entries, l, en)
|
||||
{
|
||||
if (en->obj == entry)
|
||||
{
|
||||
if ((sd->w > 0) && (sd->h > 0))
|
||||
edje_object_signal_emit(en->o_bg, "selected", "express");
|
||||
else
|
||||
sd->pending = EINA_TRUE;
|
||||
|
||||
evas_object_stack_below(en->o_bg, sd->o_event);
|
||||
|
||||
en->was_selected = EINA_FALSE;
|
||||
en->selected = EINA_TRUE;
|
||||
}
|
||||
else if (en->obj != entry)
|
||||
{
|
||||
if (en->selected)
|
||||
{
|
||||
if ((sd->w > 0) && (sd->h > 0))
|
||||
edje_object_signal_emit(en->o_bg, "unselected", "express");
|
||||
else
|
||||
{
|
||||
en->was_selected = EINA_TRUE;
|
||||
sd->pending = EINA_TRUE;
|
||||
}
|
||||
en->selected = EINA_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!keep) en->before = EINA_FALSE;
|
||||
}
|
||||
|
||||
sd->use_px = EINA_FALSE;
|
||||
_selector_transit(obj, _ex_cfg->gui.zoom);
|
||||
}
|
||||
|
||||
void
|
||||
_selector_zoom_set(Evas_Object *obj, double zoom)
|
||||
{
|
||||
Selector *sd;
|
||||
|
||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
||||
sd->orig_zoom = zoom;
|
||||
}
|
||||
|
||||
void
|
||||
_selector_zoom(Evas_Object *obj, double zoom)
|
||||
{
|
||||
Selector *sd;
|
||||
|
||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
||||
sd->zoom1 = zoom;
|
||||
_selector_transit(obj, _ex_cfg->gui.zoom);
|
||||
}
|
||||
|
||||
void
|
||||
_selector_go(Evas_Object *obj)
|
||||
{
|
||||
Selector *sd;
|
||||
Entry *en;
|
||||
Eina_List *l;
|
||||
|
||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
||||
|
||||
_selector_layout(obj);
|
||||
|
||||
evas_object_show(sd->o_clip);
|
||||
EINA_LIST_FOREACH(sd->entries, l, en)
|
||||
{
|
||||
if (en->selected)
|
||||
{
|
||||
evas_object_stack_below(en->o_bg, sd->o_event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_selector_exit(Evas_Object *obj)
|
||||
{
|
||||
Selector *sd;
|
||||
|
||||
if (!(sd = evas_object_smart_data_get(obj))) return;
|
||||
sd->exit_on_sel = EINA_TRUE;
|
||||
}
|
Loading…
Reference in New Issue