Some cleanup and preparation for additions of dialogs, and text styles.
SVN revision: 28471
This commit is contained in:
parent
78d88227c1
commit
e069912a1c
|
@ -47,7 +47,7 @@ group
|
|||
{
|
||||
text: "text";
|
||||
font: "ewl/default";
|
||||
size: 10;
|
||||
size: 11;
|
||||
min: 1 1;
|
||||
align: 0.5 0.5;
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -110,12 +110,9 @@ 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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue