Commit 9a6b6543 authored by Victor Ananjevsky's avatar Victor Ananjevsky

add --keep-icon-size option

parent 6abb393a
......@@ -131,6 +131,9 @@ Set the dialog image which appears on the left side of dialog.
.B \-\-icon-theme=\fITHEME\fP
Use specified GTK icon theme instead of default.
.TP
.B \-\-keep-icon-size
Don't scale icons. This option affects icons outside icon theme.
.TP
.B \-\-expander=\fI[TEXT]\fP
Hide main widget with expander. \fITEXT\fP is an optional argument with expander's label.
.TP
......
......@@ -139,6 +139,8 @@ static GOptionEntry general_options[] = {
N_("Set default return code"), N_("NUMBER") },
{ "selectable-labels", 0, 0, G_OPTION_ARG_NONE, &options.data.selectable_labels,
N_("Dialog text can be selected"), NULL },
{ "keep-icon-size", 0, 0, G_OPTION_ARG_NONE, &options.data.keep_icon_size,
N_("Don't scale icons"), NULL },
/* window settings */
{ "sticky", 0, 0, G_OPTION_ARG_NONE, &options.data.sticky,
N_("Set window sticky"), NULL },
......@@ -1466,6 +1468,7 @@ yad_options_init (void)
options.data.escape_ok = FALSE;
options.data.always_print = FALSE;
options.data.selectable_labels = FALSE;
options.data.keep_icon_size = FALSE;
options.data.def_resp = YAD_RESPONSE_OK;
/* Initialize window options */
......
......@@ -77,7 +77,7 @@ stock_lookup (gchar *key, YadStock *it)
}
GdkPixbuf *
get_pixbuf (gchar * name, YadIconSize size, gboolean force)
get_pixbuf (gchar *name, YadIconSize size, gboolean force)
{
gint w, h;
GdkPixbuf *pb = NULL;
......@@ -109,7 +109,7 @@ get_pixbuf (gchar * name, YadIconSize size, gboolean force)
}
/* force scaling image to specific size */
if (force && pb)
if (!options.data.keep_icon_size && force && pb)
{
gint iw = gdk_pixbuf_get_width (pb);
gint ih = gdk_pixbuf_get_height (pb);
......
......@@ -220,6 +220,7 @@ typedef struct {
gboolean escape_ok;
gboolean always_print;
gboolean selectable_labels;
gboolean keep_icon_size;
GtkButtonBoxStyle buttons_layout;
gint def_resp;
/* window settings */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment