Add edit tools back. I really need a better design.
SVN revision: 29235
This commit is contained in:
parent
9c788c1691
commit
bb4d112681
|
@ -266,9 +266,9 @@ int main(int argc, char **argv)
|
|||
bind_textdomain_codeset(PACKAGE, "UTF-8");
|
||||
textdomain(PACKAGE);
|
||||
#endif
|
||||
/*Use our own custom theme*/
|
||||
/*Use our own theme*/
|
||||
ewl_theme_theme_set(PACKAGE_DATA_DIR "/themes/ephoto.edj");
|
||||
|
||||
|
||||
/*Start the GUI*/
|
||||
create_main_gui();
|
||||
|
||||
|
|
|
@ -72,6 +72,7 @@ Ewl_Widget *add_image(Ewl_Widget *c, const char *img, int thumbnail, void *cb, v
|
|||
Ewl_Widget *add_label(Ewl_Widget *c, const char *lbl);
|
||||
Ewl_Widget *add_menubar(Ewl_Widget *c);
|
||||
Ewl_Widget *add_menu(Ewl_Widget *c, const char *lbl);
|
||||
Ewl_Widget *add_menu_item(Ewl_Widget *c, const char *lbl, const char *img, void *cb, void *data);
|
||||
Ewl_Widget *add_text(Ewl_Widget *c, const char *text);
|
||||
Ewl_Widget *add_shadow(Ewl_Widget *c);
|
||||
Ewl_Widget *add_window(const char *name, int width, int height, void *cb, void *data);
|
||||
|
|
|
@ -19,21 +19,21 @@ Ewl_Widget *add_edit_view(Ewl_Widget *c)
|
|||
ewl_object_alignment_set(EWL_OBJECT(em->eimage), EWL_FLAG_ALIGN_CENTER);
|
||||
ewl_object_fill_policy_set(EWL_OBJECT(em->eimage), EWL_FLAG_FILL_SHRINK);
|
||||
|
||||
em->edit_tools = add_box(em->edit_vbox, EWL_ORIENTATION_HORIZONTAL, 3);
|
||||
ewl_object_alignment_set(EWL_OBJECT(em->edit_tools), EWL_FLAG_ALIGN_CENTER);
|
||||
ewl_object_fill_policy_set(EWL_OBJECT(em->edit_tools), EWL_FLAG_FILL_SHRINK);
|
||||
add_edit_tools(em->edit_tools);
|
||||
|
||||
return em->edit_vbox;
|
||||
}
|
||||
|
||||
/*Show the edit view*/
|
||||
void show_edit_view(Ewl_Widget *w, void *event, void *data)
|
||||
{
|
||||
char *path = data;
|
||||
|
||||
ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->view_box), em->edit_vbox);
|
||||
if (path)
|
||||
{
|
||||
ewl_image_file_path_set(EWL_IMAGE(em->eimage), path);
|
||||
free(path);
|
||||
}
|
||||
else ewl_image_file_path_set(EWL_IMAGE(em->eimage), ecore_dlist_current(em->images));
|
||||
ecore_dlist_goto_first(em->images);
|
||||
ewl_image_file_path_set(EWL_IMAGE(em->eimage), ecore_dlist_current(em->images));
|
||||
return;
|
||||
}
|
||||
|
||||
/*Add edit tools to container c*/
|
||||
|
@ -71,14 +71,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;
|
||||
}
|
||||
|
||||
|
@ -119,8 +117,6 @@ static void next_image(Ewl_Widget *w, void *event, void *data)
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*Flip the image 180 degrees horizontally*/
|
||||
static void flip_image_horizontal(Ewl_Widget *w, void *event, void *data)
|
||||
{
|
||||
|
|
|
@ -115,13 +115,31 @@ Ewl_Widget *add_menu(Ewl_Widget *c, const char *lbl)
|
|||
Ewl_Widget *menu;
|
||||
|
||||
menu = ewl_menu_new();
|
||||
if(lbl) ewl_label_text_set(EWL_LABEL(menu), lbl);
|
||||
if(lbl) ewl_button_label_set(EWL_BUTTON(menu), lbl);
|
||||
ewl_object_fill_policy_set(EWL_OBJECT(menu), EWL_FLAG_FILL_NONE);
|
||||
if(c) ewl_container_child_append(EWL_CONTAINER(c), menu);
|
||||
ewl_widget_show(menu);
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
/*Create and Add a Menu Item to the Container c*/
|
||||
Ewl_Widget *add_menu_item(Ewl_Widget *c, const char *lbl, const char *img, void *cb, void *data)
|
||||
{
|
||||
Ewl_Widget *mi;
|
||||
|
||||
mi = ewl_menu_item_new();
|
||||
if(img) ewl_button_image_set(EWL_BUTTON(mi), img, NULL);
|
||||
if(lbl) ewl_button_label_set(EWL_BUTTON(mi), lbl);
|
||||
ewl_object_alignment_set(EWL_OBJECT(mi), EWL_FLAG_ALIGN_CENTER);
|
||||
ewl_object_fill_policy_set(EWL_OBJECT(mi), EWL_FLAG_FILL_ALL);
|
||||
if(c) ewl_container_child_append(EWL_CONTAINER(c), mi);
|
||||
if(cb) ewl_callback_append(mi, EWL_CALLBACK_CLICKED, cb, data);
|
||||
ewl_widget_show(mi);
|
||||
|
||||
return mi;
|
||||
}
|
||||
|
||||
/*Create and Add a Shadow to the Container c*/
|
||||
Ewl_Widget *add_shadow(Ewl_Widget *c)
|
||||
{
|
||||
|
|
|
@ -71,7 +71,7 @@ static Ewl_Widget *list_view_new(void *data, int row, int column)
|
|||
|
||||
hbox = add_box(NULL, EWL_ORIENTATION_HORIZONTAL, 10);
|
||||
ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_HFILL);
|
||||
ewl_callback_append(hbox, EWL_CALLBACK_CLICKED, show_edit_view, strdup(image));
|
||||
// ewl_callback_append(hbox, EWL_CALLBACK_CLICKED, show_edit_view, strdup(image));
|
||||
ewl_widget_name_set(hbox, image);
|
||||
|
||||
img = add_image(hbox, image, 1, NULL, NULL);
|
||||
|
|
|
@ -49,7 +49,7 @@ static void window_fullscreen(Ewl_Widget *w, void *event, void *data)
|
|||
void create_main_gui(void)
|
||||
{
|
||||
Ewl_Widget *vbox, *hbox, *hsep, *vsep, *button;
|
||||
Ewl_Widget *mb, *menu;
|
||||
Ewl_Widget *mb, *menu, *mi;
|
||||
|
||||
em = NULL;
|
||||
em = calloc(1, sizeof(Ephoto_Main));
|
||||
|
@ -63,6 +63,7 @@ void create_main_gui(void)
|
|||
|
||||
mb = add_menubar(vbox);
|
||||
menu = add_menu(mb, "File");
|
||||
mi = add_menu_item(menu, "Exit", PACKAGE_DATA_DIR "/images/exit.png", destroy, NULL);
|
||||
|
||||
hbox = add_box(vbox, EWL_ORIENTATION_HORIZONTAL, 2);
|
||||
ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_ALL);
|
||||
|
|
|
@ -28,13 +28,13 @@ void show_normal_view(Ewl_Widget *w, void *event, void *data)
|
|||
ewl_notebook_visible_page_set(EWL_NOTEBOOK(em->view_box), em->fbox_vbox);
|
||||
}
|
||||
|
||||
/*Set the info that is in the info label on normal view*/
|
||||
/*Action when an image is clicked*/
|
||||
void freebox_image_clicked(Ewl_Widget *w, void *event, void *data)
|
||||
{
|
||||
const char *path;
|
||||
|
||||
path = ewl_widget_name_get(w);
|
||||
show_edit_view(NULL, NULL, strdup(path));
|
||||
// show_edit_view(NULL, NULL, strdup(path));
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ void start_slideshow(Ewl_Widget *w, void *event, void *data)
|
|||
{
|
||||
Ewl_Widget *cell, *image;
|
||||
|
||||
win = add_window("Ephoto Slideshow!", 600, 400, destroy, NULL);
|
||||
win = add_window("Ephoto Slideshow!", 0, 0, destroy, NULL);
|
||||
ewl_window_fullscreen_set(EWL_WINDOW(win), 1);
|
||||
ewl_callback_append(win, EWL_CALLBACK_CLICKED, destroy, NULL);
|
||||
|
||||
|
|
Loading…
Reference in New Issue