Ephoto: Add an exit icon to the control bar. Update slideshow icons. Use efreet for XDG.
This commit is contained in:
parent
bb7bbe4184
commit
d5d546dad6
|
@ -621,15 +621,9 @@ static int
|
|||
_ephoto_config_load(Ephoto *ephoto)
|
||||
{
|
||||
Eet_File *ef;
|
||||
char buf[4096], buf2[4096], xdg[4096];
|
||||
char buf[4096], buf2[4096];
|
||||
|
||||
if (getenv("XDG_CONFIG_HOME"))
|
||||
{
|
||||
snprintf(xdg, PATH_MAX, "%s", getenv("XDG_CONFIG_HOME"));
|
||||
snprintf(buf2, sizeof(buf2), "%s/ephoto", xdg);
|
||||
}
|
||||
else
|
||||
snprintf(buf2, sizeof(buf2), "%s/.config/ephoto", getenv("HOME"));
|
||||
snprintf(buf2, sizeof(buf2), "%s/ephoto", efreet_config_home_get());
|
||||
ecore_file_mkpath(buf2);
|
||||
snprintf(buf, sizeof(buf), "%s/ephoto.cfg", buf2);
|
||||
|
||||
|
@ -666,15 +660,9 @@ _ephoto_on_config_save(void *data)
|
|||
{
|
||||
Ephoto *ephoto = data;
|
||||
Eet_File *ef;
|
||||
char buf[4096], buf2[4096], xdg[4096];
|
||||
char buf[4096], buf2[4096];
|
||||
|
||||
if (getenv("XDG_CONFIG_HOME"))
|
||||
{
|
||||
snprintf(xdg, PATH_MAX, "%s", getenv("XDG_CONFIG_HOME"));
|
||||
snprintf(buf, sizeof(buf), "%s/ephoto/ephoto.cfg", xdg);
|
||||
}
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "%s/.config/ephoto/ephoto.cfg", getenv("HOME"));
|
||||
snprintf(buf, sizeof(buf), "%s/ephoto/ephoto.cfg", efreet_config_home_get());
|
||||
snprintf(buf2, sizeof(buf2), "%s.tmp", buf);
|
||||
|
||||
ef = eet_open(buf2, EET_FILE_MODE_WRITE);
|
||||
|
|
|
@ -382,6 +382,15 @@ _settings_icon_clicked(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
ephoto_config_main(ephoto);
|
||||
}
|
||||
|
||||
static void
|
||||
_exit_icon_clicked(void *data, Evas_Object *obj EINA_UNUSED,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
Ephoto *ephoto = data;
|
||||
|
||||
evas_object_del(ephoto->win);
|
||||
}
|
||||
|
||||
/*Toggle determines whether to toggle folder visibility, or just force visible*/
|
||||
void
|
||||
ephoto_show_folders(Ephoto *ephoto, Eina_Bool toggle)
|
||||
|
@ -624,6 +633,23 @@ ephoto_window_add(const char *path)
|
|||
elm_box_pack_end(ephoto->statusbar, but);
|
||||
evas_object_show(but);
|
||||
|
||||
ic = elm_icon_add(ephoto->statusbar);
|
||||
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
|
||||
20*elm_config_scale_get());
|
||||
ret = elm_icon_standard_set(ic, "application-exit");
|
||||
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
|
||||
|
||||
but = elm_button_add(ephoto->statusbar);
|
||||
elm_object_part_content_set(but, "icon", ic);
|
||||
if (!ret)
|
||||
elm_object_text_set(but, _("Exit"));
|
||||
evas_object_smart_callback_add(but, "clicked",
|
||||
_exit_icon_clicked, ephoto);
|
||||
elm_object_tooltip_text_set(but, _("Exit"));
|
||||
elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_TOP);
|
||||
elm_box_pack_end(ephoto->statusbar, but);
|
||||
evas_object_show(but);
|
||||
|
||||
if ((!path) || (!ecore_file_exists(path)))
|
||||
{
|
||||
if (ephoto->config->open)
|
||||
|
|
|
@ -1862,6 +1862,10 @@ _add_edit_menu_items(Ephoto_Single_Browser *sb, Evas_Object *menu)
|
|||
elm_menu_item_add(menu, NULL, "document-send", _("Upload"), _upload_image,
|
||||
sb);
|
||||
elm_menu_item_separator_add(menu, NULL);
|
||||
elm_menu_item_add(menu, NULL, "zoom-fit", _("Zoom Fit"), _zoom_fit_cb,
|
||||
sb);
|
||||
elm_menu_item_add(menu, NULL, "zoom-original", _("Zoom 1:1"), _zoom_1_cb,
|
||||
sb);
|
||||
elm_menu_item_add(menu, NULL, "object-rotate-left", _("Rotate Left"), _go_rotate_counterclock,
|
||||
sb);
|
||||
elm_menu_item_add(menu, NULL, "object-rotate-right", _("Rotate Right"), _go_rotate_clock,
|
||||
|
@ -2366,67 +2370,35 @@ ephoto_single_browser_show_controls(Ephoto *ephoto)
|
|||
evas_object_show(but);
|
||||
|
||||
ic = elm_icon_add(ephoto->controls_left);
|
||||
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
|
||||
20*elm_config_scale_get());
|
||||
ret = elm_icon_standard_set(ic, "zoom-fit");
|
||||
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
|
||||
|
||||
but = elm_button_add(ephoto->controls_left);
|
||||
if (!ret)
|
||||
elm_object_text_set(but, _("Zoom Fit"));
|
||||
elm_object_part_content_set(but, "icon", ic);
|
||||
elm_object_tooltip_text_set(but, _("Zoom Fit"));
|
||||
elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_TOP);
|
||||
evas_object_smart_callback_add(but, "clicked", _zoom_fit_cb, sb);
|
||||
elm_box_pack_end(ephoto->controls_left, but);
|
||||
evas_object_show(but);
|
||||
|
||||
ic = elm_icon_add(ephoto->controls_left);
|
||||
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
|
||||
20*elm_config_scale_get());
|
||||
elm_icon_standard_set(ic, "zoom-original");
|
||||
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
|
||||
|
||||
but = elm_button_add(ephoto->controls_left);
|
||||
if (!ret)
|
||||
elm_object_text_set(but, _("Zoom 1:1"));
|
||||
elm_object_part_content_set(but, "icon", ic);
|
||||
elm_object_tooltip_text_set(but, _("Zoom 1:1"));
|
||||
elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_TOP);
|
||||
evas_object_smart_callback_add(but, "clicked", _zoom_1_cb, sb);
|
||||
elm_box_pack_end(ephoto->controls_left, but);
|
||||
evas_object_show(but);
|
||||
|
||||
ic = elm_icon_add(ephoto->controls_right);
|
||||
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
|
||||
20*elm_config_scale_get());
|
||||
ret = elm_icon_standard_set(ic, "go-previous");
|
||||
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
|
||||
|
||||
but = elm_button_add(ephoto->controls_right);
|
||||
but = elm_button_add(ephoto->controls_left);
|
||||
if (!ret)
|
||||
elm_object_text_set(but, _("Previous"));
|
||||
elm_object_part_content_set(but, "icon", ic);
|
||||
elm_object_tooltip_text_set(but, _("Previous"));
|
||||
elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_TOP);
|
||||
evas_object_smart_callback_add(but, "clicked", _go_prev, sb);
|
||||
elm_box_pack_end(ephoto->controls_right, but);
|
||||
elm_box_pack_end(ephoto->controls_left, but);
|
||||
evas_object_show(but);
|
||||
|
||||
ic = elm_icon_add(ephoto->controls_right);
|
||||
ic = elm_icon_add(ephoto->controls_left);
|
||||
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
|
||||
20*elm_config_scale_get());
|
||||
ret = elm_icon_standard_set(ic, "go-next");
|
||||
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
|
||||
|
||||
but = elm_button_add(ephoto->controls_right);
|
||||
but = elm_button_add(ephoto->controls_left);
|
||||
if (!ret)
|
||||
elm_object_text_set(but, _("Next"));
|
||||
elm_object_part_content_set(but, "icon", ic);
|
||||
elm_object_tooltip_text_set(but, _("Next"));
|
||||
elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_TOP);
|
||||
evas_object_smart_callback_add(but, "clicked", _go_next, sb);
|
||||
elm_box_pack_end(ephoto->controls_right, but);
|
||||
elm_box_pack_end(ephoto->controls_left, but);
|
||||
evas_object_show(but);
|
||||
|
||||
ic = elm_icon_add(ephoto->controls_right);
|
||||
|
|
|
@ -779,7 +779,10 @@ ephoto_slideshow_show_controls(Ephoto *ephoto)
|
|||
evas_object_size_hint_weight_set(ss->notify, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_fill_set(ss->notify, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
|
||||
but = _add_icon(ss->notify, "window-close", _("Back"), NULL);
|
||||
if (ephoto->prev_state == EPHOTO_STATE_SINGLE)
|
||||
but = _add_icon(ss->notify, "view-list-icons", _("Back"), NULL);
|
||||
else
|
||||
but = _add_icon(ss->notify, "view-list-details", _("Back"), NULL);
|
||||
evas_object_smart_callback_add(but, "clicked", _back, ss);
|
||||
but = _add_icon(ss->notify, "go-first", _("First"), NULL);
|
||||
evas_object_smart_callback_add(but, "clicked", _first, ss);
|
||||
|
@ -800,6 +803,7 @@ ephoto_slideshow_show_controls(Ephoto *ephoto)
|
|||
ss->fullscreen_after =
|
||||
_add_icon(ss->notify, "preferences-other", _("Settings"), NULL);
|
||||
evas_object_smart_callback_add(ss->fullscreen_after, "clicked", _settings, ss);
|
||||
|
||||
|
||||
elm_layout_content_set(ephoto->layout, "ephoto.swallow.controls", ss->notify);
|
||||
}
|
||||
|
|
|
@ -88,10 +88,7 @@ main(int argc,
|
|||
ecore_file_init();
|
||||
ecore_ipc_init();
|
||||
|
||||
if (getenv("XDG_CACHE_HOME"))
|
||||
snprintf(_thumbdir, PATH_MAX, "%s/ephoto/thumbnails", getenv("XDG_CACHE_HOME"));
|
||||
else
|
||||
snprintf(_thumbdir, PATH_MAX, "%s/.cache/ephoto/thumbnails", getenv("HOME"));
|
||||
snprintf(_thumbdir, PATH_MAX, "%s/ephoto/thumbnails", efreet_cache_home_get());
|
||||
ecore_file_mkpath(_thumbdir);
|
||||
|
||||
if (_e_ipc_init()) ecore_main_loop_begin();
|
||||
|
|
Loading…
Reference in New Issue