rpms/gnome-panel/F-12 icon-padding.patch, NONE, 1.1 gnome-panel.spec, 1.375, 1.376 redhat-panel-default-setup.entries, 1.19, 1.20

Matthias Clasen mclasen at fedoraproject.org
Sun Oct 18 03:54:48 UTC 2009


Author: mclasen

Update of /cvs/pkgs/rpms/gnome-panel/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv18780

Modified Files:
	gnome-panel.spec redhat-panel-default-setup.entries 
Added Files:
	icon-padding.patch 
Log Message:
Add padding in status icons


icon-padding.patch:
 Makefile.am                         |   18 +++++++++++++++
 main.c                              |   40 ++++++++++++++++++++++++++++++++++-
 na-tray-manager.c                   |   41 ++++++++++++++++++++++++++++++++++++
 na-tray-manager.h                   |    3 ++
 na-tray.c                           |   12 ++++++++++
 na-tray.h                           |    2 +
 notification_area_applet.schemas.in |   17 ++++++++++++++
 7 files changed, 132 insertions(+), 1 deletion(-)

--- NEW FILE icon-padding.patch ---
diff -u -r gnome-panel-2.28.0/applets/notification_area/main.c hacked/applets/notification_area/main.c
--- gnome-panel-2.28.0/applets/notification_area/main.c	2009-07-01 09:06:23.000000000 -0400
+++ hacked/applets/notification_area/main.c	2009-10-17 23:06:01.001313433 -0400
@@ -25,6 +25,7 @@
 
 #include <panel-applet.h>
 #include <panel-applet-gconf.h>
+#include <gconf/gconf-client.h>
 
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
@@ -34,6 +35,7 @@
 #include "fixedtip.h"
 
 #define NOTIFICATION_AREA_ICON "gnome-panel-notification-area"
+#define SCHEMA_DIR "/schemas/apps/notification_area_applet/prefs"
 
 typedef struct
 {
@@ -231,6 +233,39 @@
   gtk_widget_set_name (widget, "na-tray");
 }
 
+static void
+padding_changed (GConfClient *client,
+                 guint        cnxn_id,
+                 GConfEntry  *entry,
+                 gpointer     user_data)
+{
+  AppletData *data = user_data;
+  gint value;
+
+  if (!entry->value || entry->value->type != GCONF_VALUE_INT)
+    return;
+
+  value = gconf_value_get_int (entry->value);
+
+  na_tray_set_padding (data->tray, value);
+}
+
+static void
+setup_gconf (AppletData *data)
+{
+  GConfClient *client;
+  char *key;
+  int value;
+
+  client = gconf_client_get_default ();
+  key = panel_applet_gconf_get_full_key (data->applet, "padding");
+  value = gconf_client_get_int (client, key, NULL);
+  na_tray_set_padding (data->tray, value);
+  gconf_client_notify_add (client, key, padding_changed, data, NULL, NULL);
+  g_free (key);
+  g_object_unref (client);
+}
+
 static gboolean
 applet_factory (PanelApplet *applet,
                 const gchar *iid,
@@ -260,9 +295,10 @@
   atko = gtk_widget_get_accessible (GTK_WIDGET (applet));
   atk_object_set_name (atko, _("Panel Notification Area"));
 
+  panel_applet_add_preferences (applet, SCHEMA_DIR, NULL);
   panel_applet_set_flags (applet,
                           PANEL_APPLET_HAS_HANDLE|PANEL_APPLET_EXPAND_MINOR);
-  
+
   g_signal_connect (applet, "change_orient",
                     G_CALLBACK (applet_change_orientation), data);
   g_signal_connect (applet, "change_background",
@@ -270,6 +306,8 @@
   g_signal_connect (applet, "destroy",
 		    G_CALLBACK (applet_destroy), data);
 
+  setup_gconf (data);
+
   panel_applet_set_background_widget (applet, GTK_WIDGET (applet));
 
   gtk_container_add (GTK_CONTAINER (applet), GTK_WIDGET (tray));
diff -u -r gnome-panel-2.28.0/applets/notification_area/Makefile.am hacked/applets/notification_area/Makefile.am
--- gnome-panel-2.28.0/applets/notification_area/Makefile.am	2009-07-21 13:25:43.000000000 -0400
+++ hacked/applets/notification_area/Makefile.am	2009-10-17 23:16:42.401072682 -0400
@@ -66,6 +66,24 @@
 
 @INTLTOOL_SERVER_RULE@
 
+schemasdir       = $(GCONF_SCHEMA_FILE_DIR)
+schemas_in_files = notification_area_applet.schemas.in
+schemas_DATA     = $(schemas_in_files:.schemas.in=.schemas)
+
+ at INTLTOOL_SCHEMAS_RULE@
+
+if GCONF_SCHEMAS_INSTALL
+# don't do this if we are building in eg. rpm
+install-data-local:
+	if test -z "$(DESTDIR)" ; then \
+		for p in $(schemas_DATA) ; do \
+			GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(top_builddir)/applets/clock/$$p ; \
+		done \
+	fi
+else
+install-data-local:
+endif
+
 uidir = $(datadir)/gnome-2.0/ui
 ui_DATA = GNOME_NotificationAreaApplet.xml
 
diff -u -r gnome-panel-2.28.0/applets/notification_area/na-tray.c hacked/applets/notification_area/na-tray.c
--- gnome-panel-2.28.0/applets/notification_area/na-tray.c	2009-10-17 23:22:01.095308064 -0400
+++ hacked/applets/notification_area/na-tray.c	2009-10-17 23:00:01.304062848 -0400
@@ -602,6 +602,8 @@
         {
           trays_screens [screen_number].tray_manager = tray_manager;
 
+          na_tray_manager_set_padding (tray_manager, 0);
+
           g_signal_connect (tray_manager, "tray_icon_added",
                             G_CALLBACK (tray_added),
                             &trays_screens [screen_number]);
@@ -804,6 +806,16 @@
 }
 
 void
+na_tray_set_padding (NaTray *tray,
+                     gint    padding)
+{
+  NaTrayPrivate *priv = tray->priv;
+
+  if (get_tray (priv->trays_screen) == tray)
+    na_tray_manager_set_padding (priv->trays_screen->tray_manager, padding);
+}
+
+void
 na_tray_force_redraw (NaTray *tray)
 {
   NaTrayPrivate *priv = tray->priv;
diff -u -r gnome-panel-2.28.0/applets/notification_area/na-tray.h hacked/applets/notification_area/na-tray.h
--- gnome-panel-2.28.0/applets/notification_area/na-tray.h	2009-04-19 13:45:09.000000000 -0400
+++ hacked/applets/notification_area/na-tray.h	2009-10-17 23:00:30.491375187 -0400
@@ -60,6 +60,8 @@
 void            na_tray_set_orientation	(NaTray        *tray,
 					 GtkOrientation orientation);
 GtkOrientation  na_tray_get_orientation (NaTray        *tray);
+void            na_tray_set_padding     (NaTray        *tray,
+                                         gint           padding);
 void		na_tray_force_redraw	(NaTray        *tray);
 
 G_END_DECLS
diff -u -r gnome-panel-2.28.0/applets/notification_area/na-tray-manager.c hacked/applets/notification_area/na-tray-manager.c
--- gnome-panel-2.28.0/applets/notification_area/na-tray-manager.c	2009-07-27 08:01:39.000000000 -0400
+++ hacked/applets/notification_area/na-tray-manager.c	2009-10-17 21:55:00.582062966 -0400
@@ -653,6 +653,32 @@
 #endif
 }
 
+static void
+na_tray_manager_set_padding_property (NaTrayManager *manager)
+{
+#ifdef GDK_WINDOWING_X11
+  GdkDisplay *display;
+  Atom        orientation_atom;
+  gulong      data[1];
+
+  if (!manager->invisible || !manager->invisible->window)
+    return;
+
+  display = gtk_widget_get_display (manager->invisible);
+  orientation_atom = gdk_x11_get_xatom_by_name_for_display (display,
+                                                            "_NET_SYSTEM_TRAY_PADDING");
+
+  data[0] = manager->padding;
+
+  XChangeProperty (GDK_DISPLAY_XDISPLAY (display),
+		   GDK_WINDOW_XWINDOW (manager->invisible->window),
+                   orientation_atom,
+		   XA_CARDINAL, 32,
+		   PropModeReplace,
+		   (guchar *) &data, 1);
+#endif
+}
+
 #ifdef GDK_WINDOWING_X11
 
 static gboolean
@@ -697,6 +723,7 @@
 
   na_tray_manager_set_orientation_property (manager);
   na_tray_manager_set_visual_property (manager);
+  na_tray_manager_set_padding_property (manager);
   
   timestamp = gdk_x11_get_server_time (invisible->window);
 
@@ -836,6 +863,20 @@
     }
 }
 
+void
+na_tray_manager_set_padding (NaTrayManager *manager,
+                             gint           padding)
+{
+  g_return_if_fail (NA_IS_TRAY_MANAGER (manager));
+
+  if (manager->padding != padding)
+    {
+      manager->padding = padding;
+
+      na_tray_manager_set_padding_property (manager);
+    }
+}
+
 GtkOrientation
 na_tray_manager_get_orientation (NaTrayManager *manager)
 {
diff -u -r gnome-panel-2.28.0/applets/notification_area/na-tray-manager.h hacked/applets/notification_area/na-tray-manager.h
--- gnome-panel-2.28.0/applets/notification_area/na-tray-manager.h	2009-04-19 13:45:09.000000000 -0400
+++ hacked/applets/notification_area/na-tray-manager.h	2009-10-17 21:55:42.646312700 -0400
@@ -55,6 +55,7 @@
   GtkWidget *invisible;
   GdkScreen *screen;
   GtkOrientation orientation;
+  gint padding;
 
   GList *messages;
   GHashTable *socket_table;
@@ -91,6 +92,8 @@
 void            na_tray_manager_set_orientation (NaTrayManager      *manager,
 						 GtkOrientation      orientation);
 GtkOrientation  na_tray_manager_get_orientation (NaTrayManager      *manager);
+void            na_tray_manager_set_padding      (NaTrayManager      *manager,
+						  gint                padding);
 
 G_END_DECLS
 
diff -u -r gnome-panel-2.28.0/applets/notification_area/notification_area_applet.schemas.in hacked/applets/notification_area/notification_area_applet.schemas.in
--- gnome-panel-2.28.0/applets/notification_area/notification_area_applet.schemas.in	2009-10-17 23:23:41.071058057 -0400
+++ hacked/applets/notification_area/notification_area_applet.schemas.in	2009-10-17 23:21:38.588316399 -0400
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<gconfschemafile>
+    <schemalist>
+      <schema>
+        <key>/schemas/apps/notification_area_applet/prefs/padding</key>
+        <owner>notification-area-applet</owner>
+        <type>int</type>
+        <default>0</default>
+        <locale name="C">
+          <short>Padding</short>
+          <long>
+            This key specifies padding to be put around status icons.
+          </long>
+        </locale>
+      </schema>
+    </schemalist>
+</gconfschemafile>


Index: gnome-panel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-panel/F-12/gnome-panel.spec,v
retrieving revision 1.375
retrieving revision 1.376
diff -u -p -r1.375 -r1.376
--- gnome-panel.spec	16 Oct 2009 05:49:18 -0000	1.375
+++ gnome-panel.spec	18 Oct 2009 03:54:45 -0000	1.376
@@ -22,7 +22,7 @@
 Summary: GNOME panel
 Name: gnome-panel
 Version: 2.28.0
-Release: 6%{?dist}
+Release: 7%{?dist}
 URL: http://www.gnome.org
 Source0: http://download.gnome.org/sources/gnome-panel/2.28/%{name}-%{version}.tar.bz2
 
@@ -123,6 +123,9 @@ Patch43: panel-padding.patch
 # https://bugzilla.gnome.org/show_bug.cgi?id=583115
 Patch44: icon-order.patch
 
+# https://bugzilla.gnome.org/show_bug.cgi?id=583273
+Patch45: icon-padding.patch
+
 Conflicts: gnome-power-manager < 2.15.3
 
 %description
@@ -173,6 +176,7 @@ Panel Applets using the libpanel-applet 
 %patch42 -p1 -b .randr-crashes
 %patch43 -p1 -b .panel-padding
 %patch44 -p1 -b .icon-order
+%patch45 -p1 -b .icon-padding
 
 . %{SOURCE6}
 
@@ -278,6 +282,7 @@ gconftool-2 --makefile-install-rule \
 	%{_sysconfdir}/gconf/schemas/tasklist.schemas \
 	%{_sysconfdir}/gconf/schemas/window-list.schemas \
 	%{_sysconfdir}/gconf/schemas/workspace-switcher.schemas \
+	%{_sysconfdir}/gconf/schemas/notification_area_applet.schemas \
   > /dev/null || :
 
 #
@@ -304,6 +309,10 @@ if [ "$1" -gt 1 ]; then
 	%{_sysconfdir}/gconf/schemas/window-list.schemas \
 	%{_sysconfdir}/gconf/schemas/workspace-switcher.schemas \
   > /dev/null || :
+  if [ -f %{_sysconfdir}/gconf/schemas/notification_area_applet.schemas ]; then
+    gconftool-2 --makefile-uninstall-rule \
+	%{_sysconfdir}/gconf/schemas/notification_area_applet.schemas > /dev/null || :
+  fi
 fi
 
 %preun
@@ -322,6 +331,10 @@ if [ "$1" -eq 0 ]; then
 	%{_sysconfdir}/gconf/schemas/window-list.schemas \
 	%{_sysconfdir}/gconf/schemas/workspace-switcher.schemas \
   > /dev/null || :
+  if [ -f %{_sysconfdir}/gconf/schemas/notification_area_applet.schemas ]; then
+    gconftool-2 --makefile-uninstall-rule \
+	%{_sysconfdir}/gconf/schemas/notification_area_applet.schemas > /dev/null || :
+  fi
 fi
 
 %postun
@@ -371,6 +384,9 @@ fi
 %{_datadir}/gtk-doc/html/*
 
 %changelog
+* Sat Oct 17 2009 Matthias Clasen <mclasen at redhat.com> 2.28.0-7
+- Add padding around status icons
+
 * Fri Oct 16 2009 Matthias Clasen <mclasen at redhat.com> 2.28.0-6
 - Put status icons in a predictable order
 


Index: redhat-panel-default-setup.entries
===================================================================
RCS file: /cvs/pkgs/rpms/gnome-panel/F-12/redhat-panel-default-setup.entries,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -p -r1.19 -r1.20
--- redhat-panel-default-setup.entries	15 Oct 2009 05:32:41 -0000	1.19
+++ redhat-panel-default-setup.entries	18 Oct 2009 03:54:46 -0000	1.20
@@ -551,6 +551,13 @@
         <string>OAFIID:GNOME_SystemTrayApplet</string>
       </value>
     </entry>
+    <entry>
+      <key>applets/systray/prefs/padding</key>
+      <schema_key>/schemas/apps/notification_area_applet/prefs/padding</schema_key>
+      <value>
+        <int>2</int>
+      </value>
+    </entry>
 
     <entry><key>applets/systray/attached_toplevel_id</key><schema_key>/schemas/apps/panel/objects/attached_toplevel_id</schema_key> </entry>
     <entry><key>applets/systray/tooltip</key><schema_key>/schemas/apps/panel/objects/tooltip</schema_key></entry>
@@ -661,7 +668,7 @@
     </entry>
     <entry>
       <key>applets/workspace_switcher/prefs/num_rows</key>
-      <schema_key>/schemas/apps/panel/objects/prefes/num_rows</schema_key>
+      <schema_key>/schemas/apps/workspace_switcher/prefs/num_rows</schema_key>
       <value>
         <int>1</int>
       </value>




More information about the scm-commits mailing list