Commit 22c36695 authored by Victor Ananjevsky's avatar Victor Ananjevsky

add --icon-size option to notification dialog

parent 61bb29ad
......@@ -734,6 +734,9 @@ Disable exit on middle click.
.TP
.B \-\-hidden
Doesn't show icon at startup.
.TP
.B \-\-icon-size=\fISIZE\fP
Set notification icon size to \fISIZE\fP. This option doesn't works for themed icons.
.PP
See \fBNOTIFICATION\fP section for more about separators.
......
......@@ -40,7 +40,6 @@ static gchar *action = NULL;
static GSList *menu_data = NULL;
static gint exit_code;
static gint icon_size = 16;
static void
free_menu_data (gpointer data, gpointer udata)
......@@ -112,7 +111,8 @@ set_icon (void)
if (g_file_test (icon, G_FILE_TEST_EXISTS))
{
pixbuf = gdk_pixbuf_new_from_file_at_scale (icon, icon_size, icon_size, TRUE, &err);
pixbuf = gdk_pixbuf_new_from_file_at_scale (icon, options.notification_data.icon_size,
options.notification_data.icon_size, TRUE, &err);
if (err)
{
g_printerr (_("Could not load notification icon '%s': %s\n"), icon, err->message);
......
......@@ -497,6 +497,8 @@ static GOptionEntry notification_options[] = {
N_("Disable exit on middle click"), NULL },
{ "hidden", 0, 0, G_OPTION_ARG_NONE, &options.notification_data.hidden,
N_("Doesn't show icon at startup"), NULL },
{ "icon-size", 0, 0, G_OPTION_ARG_INT, &options.notification_data.icon_size,
N_("Set icon size for fully specified icons (default - 16)"), N_("SIZE") },
{ NULL }
};
......@@ -1580,6 +1582,7 @@ yad_options_init (void)
options.notification_data.middle = TRUE;
options.notification_data.hidden = FALSE;
options.notification_data.menu = NULL;
options.notification_data.icon_size = 16;
/* Initialize paned data */
options.paned_data.orient = GTK_ORIENTATION_VERTICAL;
......
......@@ -368,6 +368,7 @@ typedef struct {
gboolean middle;
gboolean hidden;
gchar *menu;
guint icon_size;
} YadNotificationData;
typedef struct {
......
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