diff --git a/data/themes/ephoto/bits/label.edc b/data/themes/ephoto/bits/label.edc index 7352aa1..8746fe8 100644 --- a/data/themes/ephoto/bits/label.edc +++ b/data/themes/ephoto/bits/label.edc @@ -47,7 +47,7 @@ group { text: "text"; font: "ewl/default"; - size: 10; + size: 11; min: 1 1; align: 0.5 0.5; } diff --git a/src/bin/ephoto.h b/src/bin/ephoto.h index e257b8a..fe0f868 100644 --- a/src/bin/ephoto.h +++ b/src/bin/ephoto.h @@ -62,7 +62,8 @@ void ephoto_db_close(sqlite3 *db); /* Ephoto Gui */ Ewl_Widget *add_button(Ewl_Widget *c, const char *txt, const char *img, void *cb, void *data); Ewl_Widget *add_image(Ewl_Widget *c, const char *img, int thumbnail, void *cb, void *data); -Ewl_Widget *add_label(Ewl_Widget *c, const char *lbl, int blue); +Ewl_Widget *add_label(Ewl_Widget *c, const char *lbl); +Ewl_Widget *add_text(Ewl_Widget *c, const char *text); Ewl_Widget *add_shadow(Ewl_Widget *c); /* Ephoto Imaging */ diff --git a/src/bin/ephoto_exif.c b/src/bin/ephoto_exif.c index 6e6a27c..e0a15cc 100644 --- a/src/bin/ephoto_exif.c +++ b/src/bin/ephoto_exif.c @@ -136,7 +136,7 @@ static void add_exif_to_container(Ewl_Widget *w, void *event, void *data) void display_exif_dialog(Ewl_Widget *w, void *event, void *data) { const char *img; - Ewl_Widget *win, *vbox, *image, *sp, *list, *label; + Ewl_Widget *win, *vbox, *image, *sp, *list, *text; Ewl_Model *model; Ewl_View *view; @@ -159,14 +159,14 @@ void display_exif_dialog(Ewl_Widget *w, void *event, void *data) ewl_container_child_append(EWL_CONTAINER(win), vbox); ewl_widget_show(vbox); - label = add_label(vbox, "Preview", 0); + text = add_text(vbox, "Preview"); image = add_image(vbox, img, 1, NULL, NULL); ewl_image_constrain_set(EWL_IMAGE(image), 120); ewl_object_alignment_set(EWL_OBJECT(image), EWL_FLAG_ALIGN_CENTER); ewl_object_fill_policy_set(EWL_OBJECT(image), EWL_FLAG_FILL_SHRINK); - label = add_label(vbox, "Image Information", 0); + text = add_text(vbox, "Image Information"); sp = ewl_scrollpane_new(); ewl_object_fill_policy_set(EWL_OBJECT(sp), EWL_FLAG_FILL_ALL); diff --git a/src/bin/ephoto_gui.c b/src/bin/ephoto_gui.c index 8729188..1b5cf3f 100644 --- a/src/bin/ephoto_gui.c +++ b/src/bin/ephoto_gui.c @@ -76,24 +76,35 @@ Ewl_Widget *add_image(Ewl_Widget *c, const char *img, int thumbnail, void *cb, v } /*Add a label to the container c, with the text lbl, and whether you want it blue*/ -Ewl_Widget *add_label(Ewl_Widget *c, const char *lbl, int blue) +Ewl_Widget *add_label(Ewl_Widget *c, const char *lbl) { Ewl_Widget *label; label = ewl_label_new(); ewl_label_text_set(EWL_LABEL(label), lbl); ewl_object_alignment_set(EWL_OBJECT(label), EWL_FLAG_ALIGN_CENTER); - ewl_object_fill_policy_set(EWL_OBJECT(label), EWL_FLAG_FILL_HFILL); + ewl_object_fill_policy_set(EWL_OBJECT(label), EWL_FLAG_FILL_SHRINK); ewl_container_child_append(EWL_CONTAINER(c), label); - if(blue) - { - ewl_widget_state_set(label, "blue", EWL_STATE_PERSISTENT); - } ewl_widget_show(label); return label; } +/*Add a text widget to the container c*/ +Ewl_Widget *add_text(Ewl_Widget *c, const char *txt) +{ + Ewl_Widget *text; + + text = ewl_text_new(); + ewl_text_text_set(EWL_TEXT(text), txt); + ewl_object_alignment_set(EWL_OBJECT(text), EWL_FLAG_ALIGN_CENTER); + ewl_object_fill_policy_set(EWL_OBJECT(text), EWL_FLAG_FILL_SHRINK); + ewl_container_child_append(EWL_CONTAINER(c), text); + ewl_widget_show(text); + + return text; +} + /*Add a shadow to the container c*/ Ewl_Widget *add_shadow(Ewl_Widget *c) { diff --git a/src/bin/ephoto_list_view.c b/src/bin/ephoto_list_view.c index 8835f60..bc86749 100644 --- a/src/bin/ephoto_list_view.c +++ b/src/bin/ephoto_list_view.c @@ -110,13 +110,10 @@ static void list_view_assign(Ewl_Widget *w, void *data) image_pixels_string_get(image), file_size_get(size)); - text = ewl_text_new(); - ewl_text_text_set(EWL_TEXT(text), info); - ewl_container_child_append(EWL_CONTAINER(w), text); + text = add_text(w, info); ewl_object_fill_policy_set(EWL_OBJECT(text), EWL_FLAG_FILL_SHRINK); ewl_object_alignment_set(EWL_OBJECT(text), EWL_FLAG_ALIGN_LEFT); - ewl_widget_show(text); - + return; } diff --git a/src/bin/ephoto_normal_view.c b/src/bin/ephoto_normal_view.c index 61c413d..63f0698 100644 --- a/src/bin/ephoto_normal_view.c +++ b/src/bin/ephoto_normal_view.c @@ -21,7 +21,7 @@ Ewl_Widget *add_normal_view(Ewl_Widget *c) ewl_container_child_append(EWL_CONTAINER(sp), em->fbox); ewl_widget_show(em->fbox); - em->ilabel = add_label(em->fbox_vbox, "Image Information", 1); + em->ilabel = add_label(em->fbox_vbox, "Image Information"); return em->fbox_vbox; }