Ephoto: Make the settings panel nicer.

v-1.6.0
Stephen okra Houston 7 years ago
parent 11dc8050eb
commit 550c8064a6
  1. 12
      src/bin/ephoto.h
  2. 273
      src/bin/ephoto_config.c
  3. 104
      src/bin/ephoto_single_browser.c
  4. 103
      src/bin/ephoto_slideshow.c
  5. 113
      src/bin/ephoto_thumb_browser.c

@ -56,9 +56,7 @@ void ephoto_directory_set(Ephoto *ephoto, const char *path,
Eina_Bool ephoto_config_init(Ephoto *em);
void ephoto_config_save(Ephoto *em);
void ephoto_config_free(Ephoto *em);
void ephoto_config_general(Ephoto *em);
void ephoto_config_slideshow(Ephoto *em);
void ephoto_config_about(Ephoto *em);
void ephoto_config_main(Ephoto *em);
Evas_Object *ephoto_single_browser_add(Ephoto *ephoto, Evas_Object *parent);
void ephoto_single_browser_entries_set(Evas_Object *obj, Eina_List *entries);
@ -136,11 +134,11 @@ struct _Ephoto_Config
const char *slideshow_transition;
int window_width;
int window_height;
int fsel_hide;
int tool_hide;
Eina_Bool fsel_hide;
Eina_Bool tool_hide;
const char *open;
int prompts;
int drop;
Eina_Bool prompts;
Eina_Bool drop;
Evas_Object *slide_time;
Evas_Object *slide_trans;
Evas_Object *hide_toolbar;

@ -87,7 +87,7 @@ _close(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
}
static void
_save_general(void *data, Evas_Object *obj EINA_UNUSED,
_save(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Evas_Object *popup = data;
@ -110,7 +110,12 @@ _save_general(void *data, Evas_Object *obj EINA_UNUSED,
elm_check_state_get(ephoto->config->hide_toolbar);
ephoto->config->prompts = elm_check_state_get(ephoto->config->show_prompts);
ephoto->config->drop = elm_check_state_get(ephoto->config->move_drop);
evas_object_del(popup);
if (elm_spinner_value_get(ephoto->config->slide_time) > 0)
ephoto->config->slideshow_timeout =
elm_spinner_value_get(ephoto->config->slide_time);
if (elm_object_text_get(ephoto->config->slide_trans))
eina_stringshare_replace(&ephoto->config->slideshow_transition,
elm_object_text_get(ephoto->config->slide_trans));
}
static void
@ -126,21 +131,15 @@ _open_hv_select(void *data, Evas_Object *obj, void *event_info)
elm_object_disabled_set(ephoto->config->open_dir_custom, EINA_TRUE);
}
void
ephoto_config_general(Ephoto *ephoto)
static Evas_Object *
_ephoto_config_general(Ephoto *ephoto, Evas_Object *parent)
{
Evas_Object *popup, *box, *table, *check, *hoversel, *entry, *ic, *button;
popup = elm_popup_add(ephoto->win);
elm_popup_scrollable_set(popup, EINA_TRUE);
elm_object_part_text_set(popup, "title,text", _("General Settings"));
elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
Evas_Object *box, *table, *check, *hoversel, *entry;
box = elm_box_add(popup);
box = elm_box_add(parent);
elm_box_horizontal_set(box, EINA_FALSE);
evas_object_size_hint_weight_set(box, 0.0, 0.0);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(box);
table = elm_table_add(box);
evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@ -151,7 +150,7 @@ ephoto_config_general(Ephoto *ephoto)
elm_object_text_set(check, _("Hide Toolbar On Fullscreen"));
evas_object_size_hint_align_set(check, 0.0, EVAS_HINT_FILL);
elm_check_state_set(check, ephoto->config->tool_hide);
elm_table_pack(table, check, 0, 1, 1, 1);
elm_table_pack(table, check, 0, 0, 1, 1);
evas_object_show(check);
ephoto->config->hide_toolbar = check;
@ -159,7 +158,7 @@ ephoto_config_general(Ephoto *ephoto)
elm_object_text_set(check, _("Prompt Before Changing The Filesystem"));
evas_object_size_hint_align_set(check, 0.0, EVAS_HINT_FILL);
elm_check_state_set(check, ephoto->config->prompts);
elm_table_pack(table, check, 0, 2, 1, 1);
elm_table_pack(table, check, 0, 1, 1, 1);
evas_object_show(check);
ephoto->config->show_prompts = check;
@ -167,7 +166,7 @@ ephoto_config_general(Ephoto *ephoto)
elm_object_text_set(check, _("Move Files When Dropped"));
evas_object_size_hint_align_set(check, 0.0, EVAS_HINT_FILL);
elm_check_state_set(check, ephoto->config->drop);
elm_table_pack(table, check, 0, 3, 1, 1);
elm_table_pack(table, check, 0, 2, 1, 1);
evas_object_show(check);
ephoto->config->move_drop = check;
@ -184,9 +183,9 @@ ephoto_config_general(Ephoto *ephoto)
elm_object_text_set(hoversel, _("Directory To Open Ephoto In"));
evas_object_data_set(hoversel, "ephoto", ephoto);
evas_object_size_hint_weight_set(hoversel, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
EVAS_HINT_FILL);
evas_object_size_hint_align_set(hoversel, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_table_pack(table, hoversel, 0, 4, 1, 1);
elm_table_pack(table, hoversel, 0, 3, 1, 1);
evas_object_show(hoversel);
ephoto->config->open_dir = hoversel;
@ -199,54 +198,14 @@ ephoto_config_general(Ephoto *ephoto)
ELM_SCROLLER_POLICY_OFF);
evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_table_pack(table, entry, 0, 5, 1, 1);
elm_table_pack(table, entry, 0, 4, 1, 1);
evas_object_show(entry);
ephoto->config->open_dir_custom = entry;
elm_box_pack_end(box, table);
evas_object_show(box);
ic = elm_icon_add(popup);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "document-save");
button = elm_button_add(popup);
elm_object_text_set(button, _("Save"));
elm_object_part_content_set(button, "icon", ic);
evas_object_smart_callback_add(button, "clicked", _save_general, popup);
elm_object_part_content_set(popup, "button1", button);
evas_object_show(button);
ic = elm_icon_add(popup);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "window-close");
button = elm_button_add(popup);
elm_object_text_set(button, _("Cancel"));
elm_object_part_content_set(button, "icon", ic);
evas_object_smart_callback_add(button, "clicked", _close, popup);
elm_object_part_content_set(popup, "button2", button);
evas_object_show(button);
evas_object_data_set(popup, "ephoto", ephoto);
elm_object_part_content_set(popup, "default", box);
evas_object_show(popup);
}
static void
_save(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Evas_Object *popup = data;
Ephoto *ephoto = evas_object_data_get(popup, "ephoto");
if (elm_spinner_value_get(ephoto->config->slide_time) > 0)
ephoto->config->slideshow_timeout =
elm_spinner_value_get(ephoto->config->slide_time);
if (elm_object_text_get(ephoto->config->slide_trans))
eina_stringshare_replace(&ephoto->config->slideshow_transition,
elm_object_text_get(ephoto->config->slide_trans));
evas_object_del(popup);
return box;
}
static void
@ -267,24 +226,18 @@ _spinner_changed(void *data EINA_UNUSED, Evas_Object *obj,
elm_spinner_label_format_set(obj, buf);
}
void
ephoto_config_slideshow(Ephoto *ephoto)
static Evas_Object *
_ephoto_config_slideshow(Ephoto *ephoto, Evas_Object *parent)
{
Evas_Object *popup, *box, *table, *label, *spinner, *hoversel, *ic, *button;
Evas_Object *box, *table, *label, *spinner, *hoversel;
const Eina_List *l;
const char *transition;
char buf[PATH_MAX];
popup = elm_popup_add(ephoto->win);
elm_popup_scrollable_set(popup, EINA_TRUE);
elm_object_part_text_set(popup, "title,text", _("Slideshow Settings"));
elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
box = elm_box_add(popup);
box = elm_box_add(parent);
elm_box_horizontal_set(box, EINA_FALSE);
evas_object_size_hint_weight_set(box, 0.0, 0.0);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(box);
table = elm_table_add(box);
evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@ -296,7 +249,7 @@ ephoto_config_slideshow(Ephoto *ephoto)
snprintf(buf, PATH_MAX, "%s:", _("Show Each Slide For"));
elm_object_text_set(label, buf);
evas_object_size_hint_align_set(label, 0.0, EVAS_HINT_FILL);
elm_table_pack(table, label, 0, 1, 1, 1);
elm_table_pack(table, label, 0, 0, 1, 1);
evas_object_show(label);
spinner = elm_spinner_add(table);
@ -308,7 +261,7 @@ ephoto_config_slideshow(Ephoto *ephoto)
elm_spinner_step_set(spinner, 1);
elm_spinner_value_set(spinner, ephoto->config->slideshow_timeout);
elm_spinner_min_max_set(spinner, 1, 60);
elm_table_pack(table, spinner, 1, 1, 1, 1);
elm_table_pack(table, spinner, 1, 0, 1, 1);
evas_object_show(spinner);
ephoto->config->slide_time = spinner;
@ -317,7 +270,7 @@ ephoto_config_slideshow(Ephoto *ephoto)
snprintf(buf, PATH_MAX, "%s:", _("Slide Transition"));
elm_object_text_set(label, buf);
evas_object_size_hint_align_set(label, 0.0, EVAS_HINT_FILL);
elm_table_pack(table, label, 0, 2, 1, 1);
elm_table_pack(table, label, 0, 1, 1, 1);
evas_object_show(label);
hoversel = elm_hoversel_add(table);
@ -330,39 +283,14 @@ ephoto_config_slideshow(Ephoto *ephoto)
evas_object_size_hint_weight_set(hoversel, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(hoversel, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_table_pack(table, hoversel, 1, 2, 1, 1);
elm_table_pack(table, hoversel, 1, 1, 1, 1);
evas_object_show(hoversel);
ephoto->config->slide_trans = hoversel;
elm_box_pack_end(box, table);
evas_object_show(box);
ic = elm_icon_add(popup);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "document-save");
button = elm_button_add(popup);
elm_object_text_set(button, _("Save"));
elm_object_part_content_set(button, "icon", ic);
evas_object_smart_callback_add(button, "clicked", _save, popup);
elm_object_part_content_set(popup, "button1", button);
evas_object_show(button);
ic = elm_icon_add(popup);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "window-close");
button = elm_button_add(popup);
elm_object_text_set(button, _("Cancel"));
elm_object_part_content_set(button, "icon", ic);
evas_object_smart_callback_add(button, "clicked", _close, popup);
elm_object_part_content_set(popup, "button2", button);
evas_object_show(button);
evas_object_data_set(popup, "ephoto", ephoto);
elm_object_part_content_set(popup, "default", box);
evas_object_show(popup);
return box;
}
static void
@ -416,33 +344,22 @@ _link_anchor(void *data, Evas_Object *obj, void *event_info)
evas_object_show(button);
}
void
ephoto_config_about(Ephoto *ephoto)
static Evas_Object *
_ephoto_config_about(Evas_Object *parent)
{
Evas_Object *popup, *box, *bb, *entry, *ic, *button;
Evas_Object *box, *entry;
Eina_Strbuf *sbuf = eina_strbuf_new();
FILE *f;
popup = elm_popup_add(ephoto->win);
elm_popup_scrollable_set(popup, EINA_TRUE);
elm_object_part_text_set(popup, "title,text", _("About Ephoto"));
elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
box = elm_box_add(popup);
box = elm_box_add(parent);
elm_box_horizontal_set(box, EINA_FALSE);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(box);
bb = elm_bubble_add(box);
evas_object_size_hint_weight_set(bb, 0.0, 0.0);
evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(box, bb);
evas_object_show(bb);
entry = elm_entry_add(bb);
entry = elm_entry_add(box);
elm_entry_anchor_hover_style_set(entry, "popout");
elm_entry_anchor_hover_parent_set(entry, popup);
elm_entry_anchor_hover_parent_set(entry, parent);
elm_entry_editable_set(entry, EINA_FALSE);
elm_entry_context_menu_disabled_set(entry, EINA_TRUE);
elm_entry_line_wrap_set(entry, ELM_WRAP_NONE);
@ -506,23 +423,129 @@ ephoto_config_about(Ephoto *ephoto)
elm_object_text_set(entry, eina_strbuf_string_get(sbuf));
evas_object_smart_callback_add(entry, "anchor,hover,opened",
_link_anchor, entry);
elm_object_content_set(bb, entry);
elm_box_pack_end(box, entry);
evas_object_show(entry);
ic = elm_icon_add(box);
evas_object_show(box);
return box;
}
static void
_segment_changed(void *data EINA_UNUSED, Evas_Object *o, void *event)
{
Elm_Object_Item *it = event;
Evas_Object *page = elm_object_item_data_get(it);
Evas_Object *gen = evas_object_data_get(o, "gen");
Evas_Object *slide = evas_object_data_get(o, "slide");
Evas_Object *about = evas_object_data_get(o, "about");
evas_object_hide(gen);
evas_object_hide(slide);
evas_object_hide(about);
evas_object_show(page);
}
void
ephoto_config_main(Ephoto *ephoto)
{
Evas_Object *popup, *table, *segment, *button, *ic;
Evas_Object *gen, *slide, *about, *sep;
Elm_Object_Item *geni, *slidei, *abouti;
popup = elm_popup_add(ephoto->win);
elm_popup_scrollable_set(popup, EINA_TRUE);
elm_object_part_text_set(popup, "title,text", _("Settings Panel"));
elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
table = elm_table_add(popup);
elm_table_homogeneous_set(table, EINA_FALSE);
evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
gen = _ephoto_config_general(ephoto, table);
elm_table_pack(table, gen, 0, 2, 1, 1);
slide = _ephoto_config_slideshow(ephoto, table);
elm_table_pack(table, slide, 0, 2, 1, 1);
about = _ephoto_config_about(table);
elm_table_pack(table, about, 0, 2, 1, 1);
segment = elm_segment_control_add(table);
evas_object_size_hint_weight_set(segment, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
evas_object_size_hint_align_set(segment, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_smart_callback_add(segment, "changed", _segment_changed, table);
elm_table_pack(table, segment, 0, 0, 1, 1);
evas_object_show(segment);
evas_object_data_set(segment, "gen", gen);
evas_object_data_set(segment, "slide", slide);
evas_object_data_set(segment, "about", about);
ic = elm_icon_add(segment);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "preferences-system");
evas_object_show(ic);
geni = elm_segment_control_item_add(segment, ic, _("General"));
ic = elm_icon_add(segment);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "media-playback-start");
evas_object_show(ic);
slidei = elm_segment_control_item_add(segment, ic, _("Slideshow"));
ic = elm_icon_add(segment);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "help-about");
evas_object_show(ic);
abouti = elm_segment_control_item_add(segment, ic, _("About"));
sep = elm_separator_add(table);
elm_separator_horizontal_set(sep, EINA_TRUE);
elm_table_pack(table, sep, 0, 1, 1, 1);
evas_object_show(sep);
sep = elm_separator_add(table);
elm_separator_horizontal_set(sep, EINA_TRUE);
elm_table_pack(table, sep, 0, 3, 1, 1);
evas_object_show(sep);
elm_object_item_data_set(geni, gen);
elm_object_item_data_set(slidei, slide);
elm_object_item_data_set(abouti, about);
evas_object_hide(slide);
evas_object_hide(about);
elm_segment_control_item_selected_set(geni, EINA_TRUE);
ic = elm_icon_add(popup);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "document-save");
button = elm_button_add(popup);
elm_object_text_set(button, _("Save"));
elm_object_part_content_set(button, "icon", ic);
evas_object_smart_callback_add(button, "clicked", _save, popup);
elm_object_part_content_set(popup, "button1", button);
evas_object_show(button);
ic = elm_icon_add(popup);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "window-close");
button = elm_button_add(box);
button = elm_button_add(popup);
elm_object_text_set(button, _("Close"));
elm_object_part_content_set(button, "icon", ic);
evas_object_smart_callback_add(button, "clicked", _close, popup);
elm_object_part_content_set(popup, "button1", button);
elm_object_part_content_set(popup, "button2", button);
evas_object_show(button);
evas_object_show(table);
elm_object_content_set(popup, table);
evas_object_data_set(popup, "ephoto", ephoto);
elm_object_part_content_set(popup, "default", box);
evas_object_show(popup);
}

@ -1729,7 +1729,7 @@ _delete_apply(void *data, Evas_Object *obj EINA_UNUSED,
if (ecore_file_exists(sb->entry->path) && ecore_file_is_dir(destination))
{
char dest[PATH_MAX], fp[PATH_MAX], extra[PATH_MAX];
snprintf(fp, PATH_MAX, "%s", sb->entry->path);
snprintf(dest, PATH_MAX, "%s/%s", destination, basename(fp));
if (ecore_file_exists(dest))
@ -2204,113 +2204,13 @@ _back(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
evas_object_smart_callback_call(sb->main, "back", sb->entry);
}
static void
_general_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Evas_Object *popup = data;
Ephoto_Single_Browser *sb = evas_object_data_get(popup, "single_browser");
ephoto_config_general(sb->ephoto);
}
static void
_slideshow_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Evas_Object *popup = data;
Ephoto_Single_Browser *sb = evas_object_data_get(popup, "single_browser");
ephoto_config_slideshow(sb->ephoto);
}
static void
_about_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Evas_Object *popup = data;
Ephoto_Single_Browser *sb = evas_object_data_get(popup, "single_browser");
ephoto_config_about(sb->ephoto);
}
static void
_close_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Evas_Object *popup = data;
Ephoto_Single_Browser *sb = evas_object_data_get(popup, "single_browser");
evas_object_del(popup);
if (sb->event)
{
elm_object_focus_set(sb->event, EINA_TRUE);
evas_object_freeze_events_set(sb->event, EINA_FALSE);
}
}
static void
_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Ephoto_Single_Browser *sb = data;
Evas_Object *popup, *list, *button, *ic;
if (sb->event)
evas_object_freeze_events_set(sb->event, EINA_TRUE);
popup = elm_popup_add(sb->ephoto->win);
elm_popup_scrollable_set(popup, EINA_TRUE);
elm_object_part_text_set(popup, "title,text", _("Settings Panel"));
elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
list = elm_list_add(popup);
evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_list_mode_set(list, ELM_LIST_EXPAND);
ic = elm_icon_add(list);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "preferences-system");
evas_object_show(ic);
elm_list_item_append(list, _("General Settings"), ic, NULL,
_general_settings, popup);
ic = elm_icon_add(list);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "media-playback-start");
evas_object_show(ic);
elm_list_item_append(list, _("Slideshow Settings"), ic, NULL,
_slideshow_settings, popup);
ic = elm_icon_add(list);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "help-about");
evas_object_show(ic);
elm_list_item_append(list, _("About Ephoto"), ic, NULL, _about_settings,
popup);
ic = elm_icon_add(popup);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "window-close");
button = elm_button_add(popup);
elm_object_text_set(button, _("Close"));
elm_object_part_content_set(button, "icon", ic);
evas_object_smart_callback_add(button, "clicked", _close_settings, popup);
elm_object_part_content_set(popup, "button1", button);
evas_object_show(button);
elm_list_go(list);
evas_object_show(list);
evas_object_data_set(popup, "single_browser", sb);
elm_object_content_set(popup, list);
evas_object_show(popup);
ephoto_config_main(sb->ephoto);
}
static void

@ -15,7 +15,7 @@ struct _Ephoto_Slideshow
Elm_Object_Item *fullscreen;
Elm_Object_Item *fullscreen_after;
Ephoto_Entry *entry;
int playing;
Eina_Bool playing;
};
static void
@ -170,112 +170,13 @@ _fullscreen(void *data, Evas_Object *obj EINA_UNUSED,
}
}
static void
_general_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Evas_Object *popup = data;
Ephoto_Slideshow *ss = evas_object_data_get(popup, "slideshow");
ephoto_config_general(ss->ephoto);
}
static void
_slideshow_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Evas_Object *popup = data;
Ephoto_Slideshow *ss = evas_object_data_get(popup, "slideshow");
ephoto_config_slideshow(ss->ephoto);
}
static void
_about_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Evas_Object *popup = data;
Ephoto_Slideshow *ss = evas_object_data_get(popup, "slideshow");
ephoto_config_about(ss->ephoto);
}
static void
_close_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Evas_Object *popup = data;
Ephoto_Slideshow *ss = evas_object_data_get(popup, "slideshow");
evas_object_del(popup);
if (ss->event)
{
evas_object_freeze_events_set(ss->event, EINA_FALSE);
elm_object_focus_set(ss->event, EINA_TRUE);
}
}
static void
_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Ephoto_Slideshow *ss = data;
Evas_Object *popup, *list, *button, *ic;
if (ss->event)
evas_object_freeze_events_set(ss->event, EINA_TRUE);
popup = elm_popup_add(ss->ephoto->win);
elm_popup_scrollable_set(popup, EINA_TRUE);
elm_object_part_text_set(popup, "title,text", _("Settings Panel"));
elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
list = elm_list_add(popup);
evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_list_mode_set(list, ELM_LIST_EXPAND);
ic = elm_icon_add(list);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "preferences-system");
evas_object_show(ic);
elm_list_item_append(list, _("General Settings"), ic, NULL,
_general_settings, popup);
ic = elm_icon_add(list);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "media-playback-start");
evas_object_show(ic);
elm_list_item_append(list, _("Slideshow Settings"), ic, NULL,
_slideshow_settings, popup);
ic = elm_icon_add(list);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "help-about");
evas_object_show(ic);
elm_list_item_append(list, _("About Ephoto"), ic, NULL, _about_settings,
popup);
ic = elm_icon_add(popup);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "window-close");
button = elm_button_add(popup);
elm_object_text_set(button, _("Close"));
elm_object_part_content_set(button, "icon", ic);
evas_object_smart_callback_add(button, "clicked", _close_settings, popup);
elm_object_part_content_set(popup, "button1", button);
evas_object_show(button);
elm_list_go(list);
evas_object_show(list);
evas_object_data_set(popup, "slideshow", ss);
elm_object_content_set(popup, list);
evas_object_show(popup);
ephoto_config_main(ss->ephoto);
}
static void

@ -49,13 +49,13 @@ struct _Ephoto_Thumb_Browser
Ecore_Idler *idler;
Ecore_Job *change_dir_job;
Ecore_Timer *click_timer;
int thumbs_only;
int dirs_only;
Eina_Bool thumbs_only;
Eina_Bool dirs_only;
int totimages;
int file_errors;
int dragging;
int searching;
int processing;
Eina_Bool dragging;
Eina_Bool searching;
Eina_Bool processing;
double totsize;
struct
{
@ -945,7 +945,10 @@ _search(void *data, Evas_Object *obj EINA_UNUSED,
if (!tb->searching)
tb->searching = 1;
else
return;
{
_ephoto_search_cancel(tb->search, NULL, NULL);
return;
}
hbox = elm_box_add(tb->gridbox);
elm_box_horizontal_set(hbox, EINA_TRUE);
evas_object_size_hint_weight_set(hbox, EVAS_HINT_EXPAND, 0.0);
@ -1048,109 +1051,13 @@ _slideshow(void *data, Evas_Object *obj EINA_UNUSED,
eina_list_free(selected);
}
static void
_general_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Evas_Object *popup = data;
Ephoto_Thumb_Browser *tb = evas_object_data_get(popup, "thumb_browser");
ephoto_config_general(tb->ephoto);
}
static void
_slideshow_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Evas_Object *popup = data;
Ephoto_Thumb_Browser *tb = evas_object_data_get(popup, "thumb_browser");
ephoto_config_slideshow(tb->ephoto);
}
static void
_about_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Evas_Object *popup = data;
Ephoto_Thumb_Browser *tb = evas_object_data_get(popup, "thumb_browser");
ephoto_config_about(tb->ephoto);
}
static void
_close_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Evas_Object *popup = data;
Ephoto_Thumb_Browser *tb = evas_object_data_get(popup, "thumb_browser");
evas_object_del(popup);
evas_object_freeze_events_set(tb->main, EINA_FALSE);
elm_object_focus_set(tb->main, EINA_TRUE);
}
static void
_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Ephoto_Thumb_Browser *tb = data;
Evas_Object *popup, *list, *button, *ic;
evas_object_freeze_events_set(tb->main, EINA_TRUE);
popup = elm_popup_add(tb->ephoto->win);
elm_popup_scrollable_set(popup, EINA_TRUE);
elm_object_part_text_set(popup, "title,text", _("Settings Panel"));
elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
list = elm_list_add(popup);
evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_list_mode_set(list, ELM_LIST_EXPAND);
ic = elm_icon_add(list);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "preferences-system");
evas_object_show(ic);
elm_list_item_append(list, _("General Settings"), ic, NULL,
_general_settings, popup);
ic = elm_icon_add(list);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "media-playback-start");
evas_object_show(ic);
elm_list_item_append(list, _("Slideshow Settings"), ic, NULL,
_slideshow_settings, popup);
ic = elm_icon_add(list);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "help-about");
evas_object_show(ic);
elm_list_item_append(list, _("About Ephoto"), ic, NULL, _about_settings,
popup);
ic = elm_icon_add(popup);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "window-close");
button = elm_button_add(popup);
elm_object_text_set(button, _("Close"));
elm_object_part_content_set(button, "icon", ic);
evas_object_smart_callback_add(button, "clicked", _close_settings, popup);
elm_object_part_content_set(popup, "button1", button);
evas_object_show(button);
elm_list_go(list);
evas_object_show(list);
evas_object_data_set(popup, "thumb_browser", tb);
elm_object_content_set(popup, list);
evas_object_show(popup);
ephoto_config_main(tb->ephoto);
}
static void

Loading…
Cancel
Save