[Xfce4-commits] <xfce4-panel:nick/gtk3> Added panel class for theming.

Peter de Ridder noreply at xfce.org
Sun Apr 21 15:12:01 CEST 2013


Updating branch refs/heads/nick/gtk3
         to 2820b5bc195adfc49490d9001f8f4e8677140203 (commit)
       from 8b0b96ddd9d4debe3823675b53eb1425256a37ec (commit)

commit 2820b5bc195adfc49490d9001f8f4e8677140203
Author: Peter de Ridder <peter at xfce.org>
Date:   Sun Apr 21 14:13:16 2013 +0200

    Added panel class for theming.

 panel/panel-base-window.c |    6 ++++++
 wrapper/wrapper-plug.c    |   11 +++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/panel/panel-base-window.c b/panel/panel-base-window.c
index e4039eb..f39a1c2 100644
--- a/panel/panel-base-window.c
+++ b/panel/panel-base-window.c
@@ -196,6 +196,8 @@ panel_base_window_class_init (PanelBaseWindowClass *klass)
 static void
 panel_base_window_init (PanelBaseWindow *window)
 {
+  GtkStyleContext *context;
+
   window->priv = G_TYPE_INSTANCE_GET_PRIVATE (window, PANEL_TYPE_BASE_WINDOW, PanelBaseWindowPrivate);
 
   window->is_composited = FALSE;
@@ -216,6 +218,10 @@ panel_base_window_init (PanelBaseWindow *window)
 
   /* set colormap */
   panel_base_window_screen_changed (GTK_WIDGET (window), NULL);
+
+  /* set the panel class */
+  context = gtk_widget_get_style_context (GTK_WIDGET (window));
+  gtk_style_context_add_class (context, "panel");
 }
 
 
diff --git a/wrapper/wrapper-plug.c b/wrapper/wrapper-plug.c
index d00784e..de08e8c 100644
--- a/wrapper/wrapper-plug.c
+++ b/wrapper/wrapper-plug.c
@@ -91,8 +91,9 @@ static void
 wrapper_plug_init (WrapperPlug *plug)
 {
 #if GTK_CHECK_VERSION (3, 0, 0)
-  GdkVisual *visual = NULL;
-  GdkScreen *screen;
+  GdkVisual       *visual = NULL;
+  GdkScreen       *screen;
+  GtkStyleContext *context;
 #else
   GdkColormap *colormap = NULL;
   GdkScreen   *screen;
@@ -119,6 +120,12 @@ wrapper_plug_init (WrapperPlug *plug)
   if (colormap != NULL)
     gtk_widget_set_colormap (GTK_WIDGET (plug), colormap);
 #endif
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+  /* set the panel class */
+  context = gtk_widget_get_style_context (GTK_WIDGET (plug));
+  gtk_style_context_add_class (context, "panel");
+#endif
 }
 
 


More information about the Xfce4-commits mailing list