diff --git a/data/themes/ephoto/main.edc b/data/themes/ephoto/main.edc index 98a54de..1bb2fab 100644 --- a/data/themes/ephoto/main.edc +++ b/data/themes/ephoto/main.edc @@ -62,6 +62,11 @@ data item: "/text/font" "ewl/default"; item: "/text/font_size" 10; item: "/text/style" "none"; + item: "/tooltip/delay" ".2"; + item: "/tooltip/group" "/ephoto/window"; + item: "/tooltip/hoffset" "5"; + item: "/tooltip/voffset" "5"; + item: "/tree2/vbox/scrollpane/overlay/vbox/node/row/cell/hbox/group" "/ephoto/select"; item: "/vscrollbar/decrement/group" "/ephoto/vscrollbar/decrement"; item: "/vscrollbar/increment/group" "/ephoto/vscrollbar/increment"; item: "/vseeker/group" "/ephoto/vrunner"; diff --git a/src/bin/ephoto.h b/src/bin/ephoto.h index e24efce..ff17d1b 100644 --- a/src/bin/ephoto.h +++ b/src/bin/ephoto.h @@ -88,7 +88,7 @@ struct _Ephoto_Main Ewl_Widget *atree; Ewl_Widget *currenta; Ewl_Widget *currentf; - Ewl_Widget *currenti; + Ewl_Widget *currentl; Ewl_Widget *edit_tools; Ewl_Widget *edit_vbox; Ewl_Widget *eimage; diff --git a/src/bin/ephoto_edit_view.c b/src/bin/ephoto_edit_view.c index f7f787b..a2f30d6 100644 --- a/src/bin/ephoto_edit_view.c +++ b/src/bin/ephoto_edit_view.c @@ -29,11 +29,10 @@ void show_edit_view(Ewl_Widget *w, void *event, void *data) { ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->view_box), em->edit_vbox); ecore_dlist_goto_first(em->images); - ewl_widget_show(em->edit_tools); + ewl_widget_enable(em->edit_tools); ewl_widget_hide(em->atree); ewl_widget_hide(em->tbar); ewl_widget_hide(em->ilabel); - ewl_widget_reparent(em->eimage); } /*Add edit tools to container c*/ @@ -43,15 +42,19 @@ void add_edit_tools(Ewl_Widget *c) image = add_image(c, PACKAGE_DATA_DIR "/images/undo.png", 0, rotate_image_left, NULL); ewl_image_constrain_set(EWL_IMAGE(image), 30); + ewl_attach_tooltip_text_set(image, "Rotate Image Left"); image = add_image(c, PACKAGE_DATA_DIR "/images/redo.png", 0, rotate_image_right, NULL); ewl_image_constrain_set(EWL_IMAGE(image), 30); + ewl_attach_tooltip_text_set(image, "Rotate Image Right"); image = add_image(c, PACKAGE_DATA_DIR "/images/go-next.png", 0, flip_image_horizontal, NULL); ewl_image_constrain_set(EWL_IMAGE(image), 30); + ewl_attach_tooltip_text_set(image, "Flip Image Horizontally"); image = add_image(c, PACKAGE_DATA_DIR "/images/go-down.png", 0, flip_image_vertical, NULL); ewl_image_constrain_set(EWL_IMAGE(image), 30); + ewl_attach_tooltip_text_set(image, "Flip Image Vertically"); sep = ewl_vseparator_new(); ewl_container_child_append(EWL_CONTAINER(c), sep); @@ -60,10 +63,12 @@ void add_edit_tools(Ewl_Widget *c) image = add_image(c, PACKAGE_DATA_DIR "/images/media-seek-backward.png", 0, previous_image, NULL); ewl_image_constrain_set(EWL_IMAGE(image), 30); ewl_object_alignment_set(EWL_OBJECT(image), EWL_FLAG_ALIGN_RIGHT); + ewl_attach_tooltip_text_set(image, "Previous Image"); image = add_image(c, PACKAGE_DATA_DIR "/images/media-seek-forward.png", 0, next_image, NULL); ewl_image_constrain_set(EWL_IMAGE(image), 30); ewl_object_alignment_set(EWL_OBJECT(image), EWL_FLAG_ALIGN_RIGHT); + ewl_attach_tooltip_text_set(image, "Next Image"); return; } diff --git a/src/bin/ephoto_exif.c b/src/bin/ephoto_exif.c index 38cc64a..02680ed 100644 --- a/src/bin/ephoto_exif.c +++ b/src/bin/ephoto_exif.c @@ -58,19 +58,22 @@ static char *get_image(void) { const char *img; - if (VISIBLE(em->fbox_vbox)) + if (VISIBLE(em->fbox_vbox) && em->currentf) { img = ewl_widget_name_get(em->currentf); } - else if (VISIBLE(em->list_vbox)) + else if (VISIBLE(em->list_vbox) && em->currentl) { - img = ewl_widget_name_get(em->currenti); + img = ewl_widget_name_get(em->currentl); } else if (VISIBLE(em->edit_vbox)) { img = ewl_image_file_path_get(EWL_IMAGE(em->eimage)); } - + else + { + return NULL; + } return strdup(img); } @@ -138,6 +141,10 @@ void display_exif_dialog(Ewl_Widget *w, void *event, void *data) Ewl_View *view; img = get_image(); + if(!img) + { + return; + } win = ewl_window_new(); ewl_window_title_set(EWL_WINDOW(win), "Ephoto Exif Info"); diff --git a/src/bin/ephoto_list_view.c b/src/bin/ephoto_list_view.c index 8c7af23..b60df89 100644 --- a/src/bin/ephoto_list_view.c +++ b/src/bin/ephoto_list_view.c @@ -5,6 +5,7 @@ static void list_view_assign(Ewl_Widget *w, void *data); static Ewl_Widget *list_header_fetch(void *data, int column); static void *list_data_fetch(void *data, unsigned int row, unsigned int column); static int list_data_count(void *data); +static void set_active_list_view(Ewl_Widget *w, void *event, void *data); /*Add the list view*/ Ewl_Widget *add_list_view(Ewl_Widget *c) @@ -25,10 +26,22 @@ void show_list_view(Ewl_Widget *w, void *event, void *data) { ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->view_box), em->list_vbox); ewl_mvc_dirty_set(EWL_MVC(em->ltree), 1); - ewl_widget_hide(em->edit_tools); - ewl_widget_hide(em->ilabel); + ewl_widget_disable(em->edit_tools); ewl_widget_show(em->atree); ewl_widget_show(em->tbar); + ewl_widget_hide(em->ilabel); +} + +static void set_active_list_view(Ewl_Widget *w, void *event, void *data) +{ + if (em->currentl) + { + ewl_widget_state_set(em->currentl, "unselected", EWL_STATE_PERSISTENT); + } + em->currentl = w; + ewl_widget_state_set(em->currentl, "selected", EWL_STATE_PERSISTENT); + + return; } /*Create and Add a Tree to the Container c*/ @@ -68,6 +81,7 @@ static Ewl_Widget *list_view_new(void) hbox = ewl_hbox_new(); ewl_box_spacing_set(EWL_BOX(hbox), 10); ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_HFILL); + ewl_callback_append(hbox, EWL_CALLBACK_CLICKED, set_active_list_view, NULL); ewl_widget_show(hbox); return hbox; diff --git a/src/bin/ephoto_main.c b/src/bin/ephoto_main.c index 825ebe9..ea3ed84 100644 --- a/src/bin/ephoto_main.c +++ b/src/bin/ephoto_main.c @@ -137,13 +137,15 @@ void create_main_gui(void) image = add_image(em->toolbar, PACKAGE_DATA_DIR "/images/normal_view.png", 0, show_normal_view, NULL); ewl_image_constrain_set(EWL_IMAGE(image), 30); + ewl_attach_tooltip_text_set(image, "Normal View"); vsep = ewl_vseparator_new(); ewl_container_child_append(EWL_CONTAINER(em->toolbar), vsep); ewl_widget_show(vsep); image = add_image(em->toolbar, PACKAGE_DATA_DIR "/images/list_view.png", 0, show_list_view, NULL); - ewl_image_constrain_set(EWL_IMAGE(image), 30); + ewl_image_constrain_set(EWL_IMAGE(image), 30); + ewl_attach_tooltip_text_set(image, "List View"); vsep = ewl_vseparator_new(); ewl_container_child_append(EWL_CONTAINER(em->toolbar), vsep); @@ -151,6 +153,7 @@ void create_main_gui(void) image = add_image(em->toolbar, PACKAGE_DATA_DIR "/images/edit_view.png", 0, show_edit_view, NULL); ewl_image_constrain_set(EWL_IMAGE(image), 30); + ewl_attach_tooltip_text_set(image, "Edit View"); vsep = ewl_vseparator_new(); ewl_container_child_append(EWL_CONTAINER(em->toolbar), vsep); @@ -158,6 +161,7 @@ void create_main_gui(void) image = add_image(em->toolbar, PACKAGE_DATA_DIR "/images/get_exif.png", 0, display_exif_dialog, NULL); ewl_image_constrain_set(EWL_IMAGE(image), 30); + ewl_attach_tooltip_text_set(image, "View Exif"); vsep = ewl_vseparator_new(); ewl_container_child_append(EWL_CONTAINER(em->toolbar), vsep); @@ -165,6 +169,7 @@ void create_main_gui(void) image = add_image(em->toolbar, PACKAGE_DATA_DIR "/images/stock_fullscreen.png", 0, window_fullscreen, NULL); ewl_image_constrain_set(EWL_IMAGE(image), 30); + ewl_attach_tooltip_text_set(image, "Fullscreen"); vsep = ewl_vseparator_new(); ewl_container_child_append(EWL_CONTAINER(em->toolbar), vsep); @@ -172,6 +177,7 @@ void create_main_gui(void) image = add_image(em->toolbar, PACKAGE_DATA_DIR "/images/x-office-presentation.png", 0, NULL, NULL); ewl_image_constrain_set(EWL_IMAGE(image), 30); + ewl_attach_tooltip_text_set(image, "Slideshow"); vsep = ewl_vseparator_new(); ewl_container_child_append(EWL_CONTAINER(em->toolbar), vsep); @@ -183,8 +189,8 @@ void create_main_gui(void) ewl_widget_show(em->edit_tools); add_edit_tools(em->edit_tools); - ewl_widget_hide(em->edit_tools); - + ewl_widget_disable(em->edit_tools); + em->albums = ecore_list_new(); em->db = ephoto_db_init(); em->albums = ephoto_db_list_albums(em->db); diff --git a/src/bin/ephoto_normal_view.c b/src/bin/ephoto_normal_view.c index 4967523..9d56cc4 100644 --- a/src/bin/ephoto_normal_view.c +++ b/src/bin/ephoto_normal_view.c @@ -30,11 +30,10 @@ Ewl_Widget *add_normal_view(Ewl_Widget *c) void show_normal_view(Ewl_Widget *w, void *event, void *data) { ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->view_box), em->fbox_vbox); + ewl_widget_disable(em->edit_tools); ewl_widget_show(em->atree); ewl_widget_show(em->tbar); ewl_widget_show(em->ilabel); - ewl_widget_hide(em->edit_tools); - ewl_widget_configure(em->fbox); } /*Set the info that is in the info label on normal view*/