[gnome-panel] na: Add icon-padding style property to NaTrayApplet to set padding



commit ae637906f49f467e4ad8d7cf5f83d63f9cfbe6b7
Author: Vincent Untz <vuntz gnome org>
Date:   Wed Feb 23 00:49:33 2011 +0100

    na: Add icon-padding style property to NaTrayApplet to set padding
    
    It can be used this way:
    
    NaTrayApplet {
        -NaTrayApplet-icon-padding: 6;
    }
    
    https://bugzilla.gnome.org/show_bug.cgi?id=583273

 applets/notification_area/main.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/applets/notification_area/main.c b/applets/notification_area/main.c
index 0b5050a..b87d426 100644
--- a/applets/notification_area/main.c
+++ b/applets/notification_area/main.c
@@ -121,6 +121,7 @@ na_tray_applet_style_updated (GtkWidget *widget)
   GdkColor         error;
   GdkColor         warning;
   GdkColor         success;
+  gint             padding;
 
   GTK_WIDGET_CLASS (na_tray_applet_parent_class)->style_updated (widget);
 
@@ -142,6 +143,10 @@ na_tray_applet_style_updated (GtkWidget *widget)
     success = fg;
 
   na_tray_set_colors (applet->priv->tray, &fg, &error, &warning, &success);
+
+  gtk_widget_style_get (widget, "icon-padding", &padding, NULL);
+
+  na_tray_set_padding (applet->priv->tray, padding);
 }
 
 static void
@@ -199,6 +204,14 @@ na_tray_applet_class_init (NaTrayAppletClass *class)
   applet_class->change_background = na_tray_applet_change_background;
   applet_class->change_orient = na_tray_applet_change_orient;
 
+  gtk_widget_class_install_style_property (
+          widget_class,
+          g_param_spec_int ("icon-padding",
+                            "Padding around icons",
+                            "Padding that should be put around icons, in pixels",
+                            0, G_MAXINT, 0,
+                            G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
   g_type_class_add_private (class, sizeof (NaTrayAppletPrivate));
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]