Okay. Ephoto back to normal. Move along.

SVN revision: 57560
This commit is contained in:
titan 2011-03-07 22:31:11 +00:00 committed by titan
parent 169813a679
commit ae03e70576
6 changed files with 70 additions and 26 deletions

View File

@ -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;
};

View File

@ -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:

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);