From 3812d7b246509d2443748eedb71e5bfb99bc04f6 Mon Sep 17 00:00:00 2001 From: Stephen Houston Date: Tue, 24 Nov 2015 17:17:55 -0600 Subject: [PATCH] Ephoto: Use multi select with control in grid. Fix zoom fit so it fits. --- src/bin/ephoto_single_browser.c | 4 ++-- src/bin/ephoto_thumb_browser.c | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/bin/ephoto_single_browser.c b/src/bin/ephoto_single_browser.c index 7c5f9f0..371db45 100644 --- a/src/bin/ephoto_single_browser.c +++ b/src/bin/ephoto_single_browser.c @@ -223,8 +223,8 @@ _viewer_zoom_fit_apply(Ephoto_Viewer *v) EINA_SAFETY_ON_TRUE_RETURN(iw <= 0); EINA_SAFETY_ON_TRUE_RETURN(ih <= 0); - zx = (double) cw / (double) iw; - zy = (double) ch / (double) ih; + zx = (double) (cw-10) / (double) iw; + zy = (double) (ch-10) / (double) ih; zoom = (zx < zy) ? zx : zy; _viewer_zoom_apply(v, zoom); diff --git a/src/bin/ephoto_thumb_browser.c b/src/bin/ephoto_thumb_browser.c index 7f9ab6b..1f039a2 100644 --- a/src/bin/ephoto_thumb_browser.c +++ b/src/bin/ephoto_thumb_browser.c @@ -162,13 +162,16 @@ _ephoto_dir_item_icon_get(void *data EINA_UNUSED, Evas_Object *obj, static Evas_Object * _ephoto_thumb_file_icon_get(void *data, Evas_Object *obj, - const char *part EINA_UNUSED) + const char *part) { Ephoto_Entry *e = data; Evas_Object *thumb = NULL; + if (strcmp(part, "elm.swallow.icon")) + return NULL; + if (e) - thumb = ephoto_thumb_add(e->ephoto, obj, e->path); + thumb = ephoto_thumb_add(e->ephoto, obj, e->path); 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_HINT_EXPAND); 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_multi_select_set(tb->grid, EINA_TRUE); 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); - 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", _ephoto_thumb_activated, tb); evas_object_event_callback_add(tb->grid, EVAS_CALLBACK_MOUSE_UP,