Ephoto: Use multi select with control in grid. Fix zoom fit so it fits.

This commit is contained in:
Stephen Houston 2015-11-24 17:17:55 -06:00
parent 70d48d1920
commit 3812d7b246
2 changed files with 8 additions and 9 deletions

View File

@ -223,8 +223,8 @@ _viewer_zoom_fit_apply(Ephoto_Viewer *v)
EINA_SAFETY_ON_TRUE_RETURN(iw <= 0); EINA_SAFETY_ON_TRUE_RETURN(iw <= 0);
EINA_SAFETY_ON_TRUE_RETURN(ih <= 0); EINA_SAFETY_ON_TRUE_RETURN(ih <= 0);
zx = (double) cw / (double) iw; zx = (double) (cw-10) / (double) iw;
zy = (double) ch / (double) ih; zy = (double) (ch-10) / (double) ih;
zoom = (zx < zy) ? zx : zy; zoom = (zx < zy) ? zx : zy;
_viewer_zoom_apply(v, zoom); _viewer_zoom_apply(v, zoom);

View File

@ -162,13 +162,16 @@ _ephoto_dir_item_icon_get(void *data EINA_UNUSED, Evas_Object *obj,
static Evas_Object * static Evas_Object *
_ephoto_thumb_file_icon_get(void *data, Evas_Object *obj, _ephoto_thumb_file_icon_get(void *data, Evas_Object *obj,
const char *part EINA_UNUSED) const char *part)
{ {
Ephoto_Entry *e = data; Ephoto_Entry *e = data;
Evas_Object *thumb = NULL; Evas_Object *thumb = NULL;
if (strcmp(part, "elm.swallow.icon"))
return NULL;
if (e) if (e)
thumb = ephoto_thumb_add(e->ephoto, obj, e->path); thumb = ephoto_thumb_add(e->ephoto, obj, e->path);
return thumb; return thumb;
} }
@ -3340,15 +3343,11 @@ ephoto_thumb_browser_add(Ephoto *ephoto, Evas_Object *parent)
evas_object_size_hint_weight_set(tb->grid, EVAS_HINT_EXPAND, evas_object_size_hint_weight_set(tb->grid, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND); EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(tb->grid, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_align_set(tb->grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_gengrid_align_set(tb->grid, 0.5, 0.0); elm_gengrid_align_set(tb->grid, 0.5, 0.0);
elm_gengrid_multi_select_set(tb->grid, EINA_TRUE); elm_gengrid_multi_select_set(tb->grid, EINA_TRUE);
elm_gengrid_multi_select_mode_set(tb->grid, elm_gengrid_multi_select_mode_set(tb->grid,
ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT); ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL);
elm_scroller_bounce_set(tb->grid, EINA_FALSE, EINA_TRUE); elm_scroller_bounce_set(tb->grid, EINA_FALSE, EINA_TRUE);
evas_object_size_hint_align_set(tb->grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(tb->grid, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_smart_callback_add(tb->grid, "activated", evas_object_smart_callback_add(tb->grid, "activated",
_ephoto_thumb_activated, tb); _ephoto_thumb_activated, tb);
evas_object_event_callback_add(tb->grid, EVAS_CALLBACK_MOUSE_UP, evas_object_event_callback_add(tb->grid, EVAS_CALLBACK_MOUSE_UP,