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); 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_thumb_path_set(Evas_Object *o, const char *path);
void ephoto_directory_set(Ephoto *ephoto, 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); Ephoto_Orient ephoto_file_orient_get(const char *path);
@ -110,6 +110,8 @@ struct _Ephoto_Config
/* these should be per-window */ /* these should be per-window */
int thumb_size; int thumb_size;
int thumb_gen_size; int thumb_gen_size;
int autohide_toolbar;
int best_fit_images;
const char *directory; 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, config_version, EET_T_INT);
C_VAL(D, T, thumb_size, 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, 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, directory, EET_T_STRING);
C_VAL(D, T, slideshow_timeout, EET_T_DOUBLE); C_VAL(D, T, slideshow_timeout, EET_T_DOUBLE);
C_VAL(D, T, slideshow_transition, EET_T_STRING); C_VAL(D, T, slideshow_transition, EET_T_STRING);
C_VAL(D, T, editor, EET_T_STRING); C_VAL(D, T, editor, EET_T_STRING);
switch (_ephoto_config_load(ephoto)) switch (_ephoto_config_load(ephoto))
{ {
case 0: case 0:

View File

@ -336,15 +336,29 @@ ephoto_flow_browser_add(Ephoto *e, Evas_Object *parent)
evas_object_event_callback_add evas_object_event_callback_add
(efb->main_layout, EVAS_CALLBACK_KEY_DOWN, _key_down, efb); (efb->main_layout, EVAS_CALLBACK_KEY_DOWN, _key_down, efb);
evas_object_data_set(efb->main_layout, "flow_browser", 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 if (efb->ephoto->config->autohide_toolbar)
(efb->main_layout, PACKAGE_DATA_DIR "/themes/default/ephoto.edj",
"ephoto/layout/simple/autohide"))
{ {
ERR("could not load style 'ephoto/layout/simple' from theme"); edje_object_signal_callback_add
goto error; (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); efb->toolbar = elm_toolbar_add(efb->main_layout);

View File

@ -590,7 +590,7 @@ _toolbar_hide(void *data)
} }
void 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; Ecore_Timer *timer;

View File

@ -9,7 +9,6 @@
* Rotating the scroller is not correct and was rejected by Raster and others. * Rotating the scroller is not correct and was rejected by Raster and others.
*/ */
#define ROTATION 1 #define ROTATION 1
#define HORIZONTAL 0
#define ZOOM_STEP 0.2 #define ZOOM_STEP 0.2
typedef struct _Ephoto_Single_Browser Ephoto_Single_Browser; typedef struct _Ephoto_Single_Browser Ephoto_Single_Browser;
@ -789,15 +788,29 @@ ephoto_single_browser_add(Ephoto *ephoto, Evas_Object *parent)
evas_object_event_callback_add evas_object_event_callback_add
(layout, EVAS_CALLBACK_KEY_DOWN, _key_down, sb); (layout, EVAS_CALLBACK_KEY_DOWN, _key_down, sb);
evas_object_data_set(layout, "single_browser", 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 if (sb->ephoto->config->autohide_toolbar)
(layout, PACKAGE_DATA_DIR "/themes/default/ephoto.edj",
"ephoto/layout/simple/autohide"))
{ {
ERR("could not load style 'ephoto/layout/simple/autohide' from theme"); edje_object_signal_callback_add
goto error; (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); sb->toolbar = elm_toolbar_add(sb->layout);

View File

@ -445,15 +445,29 @@ ephoto_thumb_browser_add(Ephoto *ephoto, Evas_Object *parent)
evas_object_event_callback_add evas_object_event_callback_add
(layout, EVAS_CALLBACK_KEY_DOWN, _key_down, tb); (layout, EVAS_CALLBACK_KEY_DOWN, _key_down, tb);
evas_object_data_set(layout, "thumb_browser", 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 if (tb->ephoto->config->autohide_toolbar)
(layout, PACKAGE_DATA_DIR "/themes/default/ephoto.edj",
"ephoto/layout/simple/autohide"))
{ {
ERR("could not load style 'ephoto/layout/simple' from theme"); edje_object_signal_callback_add
goto error; (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); tb->toolbar = elm_toolbar_add(tb->layout);