Add a simple About Dialog.

v-1.6.0
Stephen Houston 8 years ago
parent 28a4d401bf
commit b7f6221f34
  1. 1
      src/bin/ephoto.h
  2. 51
      src/bin/ephoto_config.c
  3. 22
      src/bin/ephoto_single_browser.c
  4. 14
      src/bin/ephoto_thumb_browser.c

@ -43,6 +43,7 @@ Eina_Bool ephoto_config_init(Ephoto *em);
void ephoto_config_save(Ephoto *em);
void ephoto_config_free(Ephoto *em);
void ephoto_config_window(Ephoto *em);
void ephoto_about_window(Ephoto *em);
Evas_Object *ephoto_single_browser_add(Ephoto *ephoto, Evas_Object *parent);
void ephoto_single_browser_entry_set(Evas_Object *obj, Ephoto_Entry *entry);

@ -112,6 +112,57 @@ ephoto_config_window(Ephoto *ephoto)
evas_object_show(box);
}
void
ephoto_about_window(Ephoto *ephoto)
{
Evas_Object *win, *scroller, *box, *button, *label;
win = elm_win_inwin_add(ephoto->win);
evas_object_show(win);
box = elm_box_add(win);
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);
elm_win_resize_object_add(win, box);
scroller = elm_scroller_add(win);
evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(scroller, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_win_resize_object_add(win, scroller);
elm_box_pack_end(box, scroller);
evas_object_show(scroller);
label = elm_label_add(box);
evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_text_set(label,
"<b>About Ephoto</b><br/>"
"Ephoto is a comprehensive image viewer based on the EFL.<br/>"
"For more information, please visit the ephoto project page on the Enlightenment wiki:<br/>"
"https://phab.enlightenment.org/w/projects/ephoto<br/>"
"Ephoto's source can be found through Enlightenment's git:<br/>"
"http://git.enlightenment.org/apps/ephoto.git<br/>"
"<br/>"
"Authors:<br/>"
"Stephen \"okra\" Houston - Project Manager/Lead Developer<br/>"
"Gustavo Sverzut Barbieri<br/>"
"Otavio Pontes<br/>"
"Daniel Juyung Seo<br/>"
"And others.<br/>");
elm_object_content_set(scroller, label);
evas_object_show(label);
button = elm_button_add(box);
elm_object_text_set(button, "Close");
evas_object_smart_callback_add(button, "clicked", _close, win);
elm_box_pack_end(box, button);
evas_object_show(button);
elm_win_inwin_content_set(win, box);
evas_object_show(box);
}
static int
_ephoto_config_load(Ephoto *ephoto)
{

@ -696,6 +696,15 @@ _settings(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
ephoto_config_window(sb->ephoto);
}
static void
_about(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
{
Ephoto_Single_Browser *sb = data;
if (sb->ephoto)
ephoto_about_window(sb->ephoto);
}
static void
_key_down(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event_info)
{
@ -851,10 +860,10 @@ ephoto_single_browser_add(Ephoto *ephoto, Evas_Object *parent)
evas_object_size_hint_weight_set(sb->bar, 0.0, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(sb->bar, EVAS_HINT_FILL, EVAS_HINT_FILL);
icon = elm_toolbar_item_append(sb->bar, "go-home", "Back", _back, sb);
icon = elm_toolbar_item_append(sb->bar, "stock_home", "Back", _back, sb);
elm_toolbar_item_priority_set(icon, 150);
icon = elm_toolbar_item_append(sb->bar, "media-playback-start", "Slideshow", _slideshow, sb);
icon = elm_toolbar_item_append(sb->bar, "stock_media-play", "Slideshow", _slideshow, sb);
elm_toolbar_item_priority_set(icon, 150);
elm_toolbar_item_separator_set(elm_toolbar_item_append(sb->bar, NULL, NULL, NULL, NULL), EINA_TRUE);
@ -876,18 +885,23 @@ ephoto_single_browser_add(Ephoto *ephoto, Evas_Object *parent)
icon = elm_toolbar_item_append(sb->bar, "go-first", "First", _go_first, sb);
elm_toolbar_item_priority_set(icon, 60);
icon = elm_toolbar_item_append(sb->bar, "go-previous", "Previous", _go_prev, sb);
icon = elm_toolbar_item_append(sb->bar, "go-next", "Previous", _go_prev, sb);
elm_toolbar_item_priority_set(icon, 70);
icon = elm_toolbar_item_append(sb->bar, "go-next", "Next", _go_next, sb);
icon = elm_toolbar_item_append(sb->bar, "go-previous", "Next", _go_next, sb);
elm_toolbar_item_priority_set(icon, 70);
icon = elm_toolbar_item_append(sb->bar, "go-last", "Last", _go_last, sb);
elm_toolbar_item_priority_set(icon, 60);
elm_toolbar_item_separator_set(elm_toolbar_item_append(sb->bar, NULL, NULL, NULL, NULL), EINA_TRUE);
icon = elm_toolbar_item_append(sb->bar, "emblem-system", "Settings", _settings, sb);
elm_toolbar_item_priority_set(icon, 50);
icon = elm_toolbar_item_append(sb->bar, "stock_about", "About", _about, sb);
elm_toolbar_item_priority_set(icon, 40);
elm_object_content_set(sb->panel, sb->bar);
evas_object_show(sb->bar);

@ -254,6 +254,15 @@ _settings(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
ephoto_config_window(tb->ephoto);
}
static void
_about(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
{
Ephoto_Thumb_Browser *tb = data;
if (tb->ephoto)
ephoto_about_window(tb->ephoto);
}
static void
_key_down(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event_info)
{
@ -471,14 +480,17 @@ ephoto_thumb_browser_add(Ephoto *ephoto, Evas_Object *parent)
evas_object_size_hint_align_set(tb->bar, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_toolbar_item_append(tb->bar, "image", "View Single", _view_single, tb);
elm_toolbar_item_append(tb->bar, "media-playback-start", "Slideshow", _slideshow, tb);
elm_toolbar_item_append(tb->bar, "stock_media-play", "Slideshow", _slideshow, tb);
elm_toolbar_item_separator_set(elm_toolbar_item_append(tb->bar, NULL, NULL, NULL, NULL), EINA_TRUE);
icon = elm_toolbar_item_append(tb->bar, "zoom-in", "Zoom In", _zoom_in, tb);
max = elm_object_item_widget_get(icon);
icon = elm_toolbar_item_append(tb->bar, "zoom-out", "Zoom Out", _zoom_out, tb);
min = elm_object_item_widget_get(icon);
evas_object_data_set(max, "min", min);
evas_object_data_set(min, "max", max);
elm_toolbar_item_separator_set(elm_toolbar_item_append(tb->bar, NULL, NULL, NULL, NULL), EINA_TRUE);
elm_toolbar_item_append(tb->bar, "emblem-system", "Settings", _settings, tb);
elm_toolbar_item_append(tb->bar, "stock_about", "About", _about, tb);
elm_object_content_set(tb->panel, tb->bar);
evas_object_show(tb->bar);

Loading…
Cancel
Save