[Xfce4-commits] <xfce4-panel:devel> Give each plugin a unique name for theming.

Nick Schermer noreply at xfce.org
Mon Feb 15 15:34:01 CET 2010


Updating branch refs/heads/devel
         to f91ba7116f4a631c3e256f61b4d8dce94ebd29ff (commit)
       from 84120bebbe6abc1a8aca848ef021aa973ecb55fd (commit)

commit f91ba7116f4a631c3e256f61b4d8dce94ebd29ff
Author: Nick Schermer <nick at xfce.org>
Date:   Mon Feb 15 12:47:19 2010 +0100

    Give each plugin a unique name for theming.

 libxfce4panel/xfce-panel-plugin.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/libxfce4panel/xfce-panel-plugin.c b/libxfce4panel/xfce-panel-plugin.c
index a9c509e..5b77d96 100644
--- a/libxfce4panel/xfce-panel-plugin.c
+++ b/libxfce4panel/xfce-panel-plugin.c
@@ -651,11 +651,24 @@ xfce_panel_plugin_set_property (GObject      *object,
                                 GParamSpec   *pspec)
 {
   XfcePanelPluginPrivate *private = XFCE_PANEL_PLUGIN (object)->priv;
+  gchar                  *name;
 
   switch (prop_id)
     {
     case PROP_NAME:
-      private->name = g_value_dup_string (value);
+    case PROP_UNIQUE_ID:
+      if (prop_id == PROP_NAME)
+        private->name = g_value_dup_string (value);
+      else
+        private->unique_id = g_value_get_int (value);
+
+      if (private->unique_id != -1 && private->name != NULL)
+        {
+          /* give the widget a unique name for theming */
+          name = g_strdup_printf ("%s-%d", private->name, private->unique_id);
+          gtk_widget_set_name (GTK_WIDGET (object), name);
+          g_free (name);
+        }
       break;
 
     case PROP_DISPLAY_NAME:
@@ -666,10 +679,6 @@ xfce_panel_plugin_set_property (GObject      *object,
       private->comment = g_value_dup_string (value);
       break;
 
-    case PROP_UNIQUE_ID:
-      private->unique_id = g_value_get_int (value);
-      break;
-
     case PROP_ARGUMENTS:
       private->arguments = g_value_dup_boxed (value);
       break;



More information about the Xfce4-commits mailing list