From ae03e705767beea1b12547a8b45d698316ba90bb Mon Sep 17 00:00:00 2001 From: titan Date: Mon, 7 Mar 2011 22:31:11 +0000 Subject: [PATCH] Okay. Ephoto back to normal. Move along. SVN revision: 57560 --- src/bin/ephoto.h | 4 +++- src/bin/ephoto_config.c | 3 ++- src/bin/ephoto_flow_browser.c | 28 +++++++++++++++++++++------- src/bin/ephoto_main.c | 2 +- src/bin/ephoto_single_browser.c | 31 ++++++++++++++++++++++--------- src/bin/ephoto_thumb_browser.c | 28 +++++++++++++++++++++------- 6 files changed, 70 insertions(+), 26 deletions(-) diff --git a/src/bin/ephoto.h b/src/bin/ephoto.h index 25e18dd..0747733 100644 --- a/src/bin/ephoto.h +++ b/src/bin/ephoto.h @@ -38,7 +38,7 @@ void ephoto_thumb_size_set(Ephoto *ephoto, int size); Evas_Object *ephoto_thumb_add(Ephoto *ephoto, Evas_Object *parent, const char *path); void ephoto_thumb_path_set(Evas_Object *o, const char *path); void ephoto_directory_set(Ephoto *ephoto, const char *path); -void auto_hide_toolbar(void *data __UNUSED__, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__); +void ephoto_auto_hide_toolbar(void *data __UNUSED__, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__); Ephoto_Orient ephoto_file_orient_get(const char *path); @@ -110,6 +110,8 @@ struct _Ephoto_Config /* these should be per-window */ int thumb_size; int thumb_gen_size; + int autohide_toolbar; + int best_fit_images; const char *directory; }; diff --git a/src/bin/ephoto_config.c b/src/bin/ephoto_config.c index 602e2f3..7a2764f 100644 --- a/src/bin/ephoto_config.c +++ b/src/bin/ephoto_config.c @@ -28,11 +28,12 @@ ephoto_config_init(Ephoto *ephoto) C_VAL(D, T, config_version, EET_T_INT); C_VAL(D, T, thumb_size, EET_T_INT); C_VAL(D, T, thumb_gen_size, EET_T_INT); + C_VAL(D, T, autohide_toolbar, EET_T_INT); + C_VAL(D, T, best_fit_images, EET_T_INT); C_VAL(D, T, directory, EET_T_STRING); C_VAL(D, T, slideshow_timeout, EET_T_DOUBLE); C_VAL(D, T, slideshow_transition, EET_T_STRING); C_VAL(D, T, editor, EET_T_STRING); - switch (_ephoto_config_load(ephoto)) { case 0: diff --git a/src/bin/ephoto_flow_browser.c b/src/bin/ephoto_flow_browser.c index c0066ee..d056e37 100644 --- a/src/bin/ephoto_flow_browser.c +++ b/src/bin/ephoto_flow_browser.c @@ -336,15 +336,29 @@ ephoto_flow_browser_add(Ephoto *e, Evas_Object *parent) evas_object_event_callback_add (efb->main_layout, EVAS_CALLBACK_KEY_DOWN, _key_down, efb); evas_object_data_set(efb->main_layout, "flow_browser", efb); - edje_object_signal_callback_add - (efb->edje, "mouse,clicked,1", "toolbar_event", auto_hide_toolbar, efb->ephoto); - if (!elm_layout_file_set - (efb->main_layout, PACKAGE_DATA_DIR "/themes/default/ephoto.edj", - "ephoto/layout/simple/autohide")) + if (efb->ephoto->config->autohide_toolbar) { - ERR("could not load style 'ephoto/layout/simple' from theme"); - goto error; + edje_object_signal_callback_add + (efb->edje, "mouse,clicked,1", "toolbar_event", + ephoto_auto_hide_toolbar, efb->ephoto); + if (!elm_layout_file_set + (efb->main_layout, PACKAGE_DATA_DIR "/themes/default/ephoto.edj", + "ephoto/layout/simple/autohide")) + { + ERR("could not load style 'ephoto/layout/simple/autohide' from theme"); + goto error; + } + } + else + { + if (!elm_layout_file_set + (efb->main_layout, PACKAGE_DATA_DIR "/themes/default/ephoto.edj", + "ephoto/layout/simple")) + { + ERR("could not load style 'ephoto/layout/simple' from theme"); + goto error; + } } efb->toolbar = elm_toolbar_add(efb->main_layout); diff --git a/src/bin/ephoto_main.c b/src/bin/ephoto_main.c index 1c42117..78f2bab 100644 --- a/src/bin/ephoto_main.c +++ b/src/bin/ephoto_main.c @@ -590,7 +590,7 @@ _toolbar_hide(void *data) } void -auto_hide_toolbar(void *data __UNUSED__, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__) +ephoto_auto_hide_toolbar(void *data __UNUSED__, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__) { Ecore_Timer *timer; diff --git a/src/bin/ephoto_single_browser.c b/src/bin/ephoto_single_browser.c index b221ff7..009aac0 100644 --- a/src/bin/ephoto_single_browser.c +++ b/src/bin/ephoto_single_browser.c @@ -9,7 +9,6 @@ * Rotating the scroller is not correct and was rejected by Raster and others. */ #define ROTATION 1 -#define HORIZONTAL 0 #define ZOOM_STEP 0.2 typedef struct _Ephoto_Single_Browser Ephoto_Single_Browser; @@ -789,17 +788,31 @@ ephoto_single_browser_add(Ephoto *ephoto, Evas_Object *parent) evas_object_event_callback_add (layout, EVAS_CALLBACK_KEY_DOWN, _key_down, sb); evas_object_data_set(layout, "single_browser", sb); - edje_object_signal_callback_add - (sb->edje, "mouse,clicked,1", "toolbar_event", auto_hide_toolbar, sb->ephoto); - if (!elm_layout_file_set - (layout, PACKAGE_DATA_DIR "/themes/default/ephoto.edj", - "ephoto/layout/simple/autohide")) + if (sb->ephoto->config->autohide_toolbar) { - ERR("could not load style 'ephoto/layout/simple/autohide' from theme"); - goto error; + edje_object_signal_callback_add + (sb->edje, "mouse,clicked,1", "toolbar_event", + ephoto_auto_hide_toolbar, sb->ephoto); + if (!elm_layout_file_set + (layout, PACKAGE_DATA_DIR "/themes/default/ephoto.edj", + "ephoto/layout/simple/autohide")) + { + ERR("could not load style 'ephoto/layout/simple/autohide' from theme"); + goto error; + } } - + else + { + if (!elm_layout_file_set + (layout, PACKAGE_DATA_DIR "/themes/default/ephoto.edj", + "ephoto/layout/simple")) + { + ERR("could not load style 'ephoto/layout/simple' from theme"); + goto error; + } + } + sb->toolbar = elm_toolbar_add(sb->layout); elm_toolbar_homogenous_set(sb->toolbar, EINA_FALSE); elm_toolbar_mode_shrink_set(sb->toolbar, ELM_TOOLBAR_SHRINK_MENU); diff --git a/src/bin/ephoto_thumb_browser.c b/src/bin/ephoto_thumb_browser.c index 076ffbd..995d638 100644 --- a/src/bin/ephoto_thumb_browser.c +++ b/src/bin/ephoto_thumb_browser.c @@ -445,15 +445,29 @@ ephoto_thumb_browser_add(Ephoto *ephoto, Evas_Object *parent) evas_object_event_callback_add (layout, EVAS_CALLBACK_KEY_DOWN, _key_down, tb); evas_object_data_set(layout, "thumb_browser", tb); - edje_object_signal_callback_add - (tb->edje, "mouse,clicked,1", "toolbar_event", auto_hide_toolbar, tb->ephoto); - if (!elm_layout_file_set - (layout, PACKAGE_DATA_DIR "/themes/default/ephoto.edj", - "ephoto/layout/simple/autohide")) + if (tb->ephoto->config->autohide_toolbar) { - ERR("could not load style 'ephoto/layout/simple' from theme"); - goto error; + edje_object_signal_callback_add + (tb->edje, "mouse,clicked,1", "toolbar_event", + ephoto_auto_hide_toolbar, tb->ephoto); + if (!elm_layout_file_set + (layout, PACKAGE_DATA_DIR "/themes/default/ephoto.edj", + "ephoto/layout/simple/autohide")) + { + ERR("could not load style 'ephoto/layout/simple/autohide' from theme"); + goto error; + } + } + else + { + if (!elm_layout_file_set + (layout, PACKAGE_DATA_DIR "/themes/default/ephoto.edj", + "ephoto/layout/simple")) + { + ERR("could not load style 'ephoto/layout/simple' from theme"); + goto error; + } } tb->toolbar = elm_toolbar_add(tb->layout);