diff --git a/data/yad.1 b/data/yad.1 index 74b7fe861f2503fdf6a2b9aba95cf9e189f3ed22..0f44cd346e9d39d0a6afaf4c4c6dab769a280680 100644 --- a/data/yad.1 +++ b/data/yad.1 @@ -137,6 +137,9 @@ Set type of dialog text justification. \fITYPE\fP may be \fIleft\fP, \fIright\fP Set the dialog image which appears on the left side of dialog`s text. \fIIMAGE\fP might be file name or icon name from current icon theme. .TP +.B \-\-image-on-top +Show image above main widget instead of left. This option is always on for print dialog. +.TP .B \-\-icon-theme=\fITHEME\fP Use specified GTK icon theme instead of default. .TP diff --git a/src/main.c b/src/main.c index 4e6fdb87f5d1840bfefa0add46612cdcdc81d531..84392b2966faf1e35aa7aa625470c7ffea841b2f 100644 --- a/src/main.c +++ b/src/main.c @@ -324,8 +324,10 @@ create_layout (GtkWidget *dlg) imw = mw; /* create layout */ - layout = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); - box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); + if (options.data.image_on_top) + { + layout = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); + box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); if (image) gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 2); @@ -340,6 +342,21 @@ create_layout (GtkWidget *dlg) else gtk_box_pack_start (GTK_BOX (layout), imw, TRUE, TRUE, 0); } + } + else + { + layout = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); + box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); + + if (text) + gtk_box_pack_start (GTK_BOX (box), text, FALSE, FALSE, 0); + if (imw) + gtk_box_pack_start (GTK_BOX (box), imw, TRUE, TRUE, 0); + + if (image) + gtk_box_pack_start (GTK_BOX (layout), image, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (layout), box, TRUE, TRUE, 0); + } if (options.mode == YAD_MODE_DND) dnd_init (layout); diff --git a/src/option.c b/src/option.c index 322e2b136e8d4baa7856f5ddde98be42dc9d56c0..a902990185896f9d58f92fedaf22644c34397b5e 100644 --- a/src/option.c +++ b/src/option.c @@ -115,6 +115,8 @@ static GOptionEntry general_options[] = { N_("Set the dialog text alignment (left, center, right, fill)"), N_("TYPE") }, { "image", 0, G_OPTION_FLAG_NOALIAS, G_OPTION_ARG_FILENAME, &options.data.dialog_image, N_("Set the dialog image"), N_("IMAGE") }, + { "image-on-top", 0, G_OPTION_FLAG_NOALIAS, G_OPTION_ARG_NONE, &options.data.image_on_top, + N_("Show image above main widget"), NULL }, { "icon-theme", 0, G_OPTION_FLAG_NOALIAS, G_OPTION_ARG_STRING, &options.data.icon_theme, N_("Use specified icon theme instead of default"), N_("THEME") }, { "expander", 0, G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, set_expander, @@ -1603,6 +1605,7 @@ yad_options_init (void) options.data.text_width = 0; options.data.text_align = GTK_JUSTIFY_LEFT; options.data.dialog_image = NULL; + options.data.image_on_top = FALSE; options.data.icon_theme = NULL; options.data.expander = NULL; options.data.timeout = 0; diff --git a/src/yad.h b/src/yad.h index 2ed7be95a643c6864684b7a666b204aaca8b0830..9f46c35f598dbc1d29835444da17181ff9e6285b 100644 --- a/src/yad.h +++ b/src/yad.h @@ -238,6 +238,7 @@ typedef struct { guint text_width; GtkJustification text_align; gchar *dialog_image; + gboolean image_on_top; gchar *icon_theme; gchar *expander; gint borders;