From d6441581b88fc1fcd5da07bcb485ac6a246f3a28 Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Wed, 23 Feb 2011 00:49:33 +0100 Subject: 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 file changed, 13 insertions(+) (limited to 'applets/notification_area') diff --git a/applets/notification_area/main.c b/applets/notification_area/main.c index 853dad3f..01f7f066 100644 --- a/applets/notification_area/main.c +++ b/applets/notification_area/main.c @@ -122,6 +122,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); @@ -143,6 +144,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 @@ -212,6 +217,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)); } -- cgit v1.2.1