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