]> code.delx.au - gnu-emacs/commitdiff
* src/gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
authorStefano Facchini <stefano.facchini@gmail.com>
Sun, 15 Jul 2012 14:22:09 +0000 (22:22 +0800)
committerChong Yidong <cyd@gnu.org>
Sun, 15 Jul 2012 14:22:09 +0000 (22:22 +0800)
the toolbar.
(xg_make_tool_item): Give the widget event box a transparent background.

Fixes: debbugs:9451
src/ChangeLog
src/gtkutil.c

index f094e5d6f75dd1b343b9d8ad74bc2447e57a1ac6..5c946e6237323437a26830b8adf5be068fd8627d 100644 (file)
@@ -1,3 +1,10 @@
+2012-07-15  Stefano Facchini  <stefano.facchini@gmail.com>  (tiny change)
+
+       * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
+       the toolbar (Bug#9451).
+       (xg_make_tool_item): Give the widget event box a transparent
+       background.
+
 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
 
        Cleanup basic allocation variables and functions.
index 290ecef9216834d21bf2b083fea018f4941e945b..d81f63a6808d4518157da26eee4cd9ca81cb1eaf 100644 (file)
@@ -4203,6 +4203,9 @@ static void
 xg_create_tool_bar (FRAME_PTR f)
 {
   struct x_output *x = f->output_data.x;
+#if GTK_CHECK_VERSION (3, 3, 6)
+  GtkStyleContext *gsty;
+#endif
 
   x->toolbar_widget = gtk_toolbar_new ();
   x->toolbar_detached = 0;
@@ -4211,6 +4214,10 @@ xg_create_tool_bar (FRAME_PTR f)
 
   gtk_toolbar_set_style (GTK_TOOLBAR (x->toolbar_widget), GTK_TOOLBAR_ICONS);
   toolbar_set_orientation (x->toolbar_widget, GTK_ORIENTATION_HORIZONTAL);
+#if GTK_CHECK_VERSION (3, 3, 6)
+  gsty = gtk_widget_get_style_context (x->toolbar_widget);
+  gtk_style_context_add_class (gsty, "primary-toolbar");
+#endif
 }
 
 
@@ -4262,6 +4269,22 @@ xg_make_tool_item (FRAME_PTR f,
   GtkWidget *wb = gtk_button_new ();
   /* The eventbox is here so we can have tooltips on disabled items.  */
   GtkWidget *weventbox = gtk_event_box_new ();
+#if GTK_CHECK_VERSION (3, 3, 6)
+  GtkCssProvider *css_prov = gtk_css_provider_new ();
+  GtkStyleContext *gsty;
+
+  gtk_css_provider_load_from_data (css_prov,
+                                  "GtkEventBox {"
+                                  "    background-color: transparent;"
+                                  "}",
+                                  -1, NULL);
+
+  gsty = gtk_widget_get_style_context (weventbox);
+  gtk_style_context_add_provider (gsty,
+                                 GTK_STYLE_PROVIDER (css_prov),
+                                 GTK_STYLE_PROVIDER_PRIORITY_USER);
+  g_object_unref (css_prov);
+#endif
 
   gtk_box_set_homogeneous (GTK_BOX (vb), FALSE);