[Xfce4-commits] [apps/xfce4-notifyd] 01/01: panel-plugin: Add hidden option log-icon-size

noreply at xfce.org noreply at xfce.org
Mon Oct 23 00:18:05 CEST 2017


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-notifyd.

commit 92dec3fe91cdb1d76241b4fef05f3ce72bc67a56
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Mon Oct 23 00:16:37 2017 +0200

    panel-plugin: Add hidden option log-icon-size
    
    TODO: Add a combobox in the plugin preferences to make this option
    more accessible.
---
 panel-plugin/notification-plugin-log.c | 10 ++++++++--
 panel-plugin/notification-plugin.h     |  2 ++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/notification-plugin-log.c b/panel-plugin/notification-plugin-log.c
index caa3aaa..14996a9 100644
--- a/panel-plugin/notification-plugin-log.c
+++ b/panel-plugin/notification-plugin-log.c
@@ -120,6 +120,7 @@ notification_plugin_menu_populate (NotificationPlugin *notification_plugin)
     gchar **groups;
     int log_length;
     int log_display_limit;
+    int log_icon_size;
     gboolean log_only_today;
 
     groups = g_key_file_get_groups (notify_log, &num_groups);
@@ -127,7 +128,11 @@ notification_plugin_menu_populate (NotificationPlugin *notification_plugin)
                                                 SETTING_LOG_DISPLAY_LIMIT, -1);
     log_only_today = xfconf_channel_get_bool (notification_plugin->channel,
                                               SETTING_LOG_ONLY_TODAY, FALSE);
+    log_icon_size = xfconf_channel_get_int (notification_plugin->channel,
+                                            SETTING_LOG_ICON_SIZE, -1);
 
+    if (log_icon_size == -1)
+      log_icon_size = DEFAULT_LOG_ICON_SIZE;
     if (log_display_limit == -1)
       log_display_limit = DEFAULT_LOG_DISPLAY_LIMIT;
     log_length = GPOINTER_TO_UINT(num_groups) - log_display_limit;
@@ -198,13 +203,14 @@ G_GNUC_END_IGNORE_DEPRECATIONS
       if (g_file_test (notify_log_icon_path, G_FILE_TEST_EXISTS))
       {
           pixbuf = gdk_pixbuf_new_from_file_at_scale (notify_log_icon_path,
-                                                      16, 16, FALSE, NULL);
+                                                      log_icon_size, log_icon_size,
+                                                      FALSE, NULL);
           app_icon = gtk_image_new_from_pixbuf (pixbuf);
       }
       else
       {
           app_icon = gtk_image_new_from_icon_name (tmp, GTK_ICON_SIZE_LARGE_TOOLBAR);
-          gtk_image_set_pixel_size (GTK_IMAGE (app_icon), 16);
+          gtk_image_set_pixel_size (GTK_IMAGE (app_icon), log_icon_size);
       }
       g_free (tmp);
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
diff --git a/panel-plugin/notification-plugin.h b/panel-plugin/notification-plugin.h
index 438f8a1..9cb01e4 100644
--- a/panel-plugin/notification-plugin.h
+++ b/panel-plugin/notification-plugin.h
@@ -30,6 +30,8 @@ G_BEGIN_DECLS
 #define SETTING_LOG_DISPLAY_LIMIT "/plugin/log-display-limit"
 #define DEFAULT_LOG_DISPLAY_LIMIT 10
 #define SETTING_LOG_ONLY_TODAY    "/plugin/log-only-today"
+#define DEFAULT_LOG_ICON_SIZE     16
+#define SETTING_LOG_ICON_SIZE     "/plugin/log-icon-size"
 
 /* plugin structure */
 typedef struct

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list