aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Facchini2012-07-15 22:22:09 +0800
committerChong Yidong2012-07-15 22:22:09 +0800
commitc9adfeaa04c1b70bbf1b22b8b77b3bb9b804fe6e (patch)
tree2f06d7b9a65284e176a6b35388086204a389dc2f
parentfff62aa9aea4f6c2aadcef4cdc203cdf60ba224c (diff)
downloademacs-c9adfeaa04c1b70bbf1b22b8b77b3bb9b804fe6e.tar.gz
emacs-c9adfeaa04c1b70bbf1b22b8b77b3bb9b804fe6e.zip
* src/gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
the toolbar. (xg_make_tool_item): Give the widget event box a transparent background. Fixes: debbugs:9451
-rw-r--r--src/ChangeLog7
-rw-r--r--src/gtkutil.c23
2 files changed, 30 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f094e5d6f75..5c946e62373 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
2
3 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
4 the toolbar (Bug#9451).
5 (xg_make_tool_item): Give the widget event box a transparent
6 background.
7
12012-07-15 Dmitry Antipov <dmantipov@yandex.ru> 82012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2 9
3 Cleanup basic allocation variables and functions. 10 Cleanup basic allocation variables and functions.
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 290ecef9216..d81f63a6808 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -4203,6 +4203,9 @@ static void
4203xg_create_tool_bar (FRAME_PTR f) 4203xg_create_tool_bar (FRAME_PTR f)
4204{ 4204{
4205 struct x_output *x = f->output_data.x; 4205 struct x_output *x = f->output_data.x;
4206#if GTK_CHECK_VERSION (3, 3, 6)
4207 GtkStyleContext *gsty;
4208#endif
4206 4209
4207 x->toolbar_widget = gtk_toolbar_new (); 4210 x->toolbar_widget = gtk_toolbar_new ();
4208 x->toolbar_detached = 0; 4211 x->toolbar_detached = 0;
@@ -4211,6 +4214,10 @@ xg_create_tool_bar (FRAME_PTR f)
4211 4214
4212 gtk_toolbar_set_style (GTK_TOOLBAR (x->toolbar_widget), GTK_TOOLBAR_ICONS); 4215 gtk_toolbar_set_style (GTK_TOOLBAR (x->toolbar_widget), GTK_TOOLBAR_ICONS);
4213 toolbar_set_orientation (x->toolbar_widget, GTK_ORIENTATION_HORIZONTAL); 4216 toolbar_set_orientation (x->toolbar_widget, GTK_ORIENTATION_HORIZONTAL);
4217#if GTK_CHECK_VERSION (3, 3, 6)
4218 gsty = gtk_widget_get_style_context (x->toolbar_widget);
4219 gtk_style_context_add_class (gsty, "primary-toolbar");
4220#endif
4214} 4221}
4215 4222
4216 4223
@@ -4262,6 +4269,22 @@ xg_make_tool_item (FRAME_PTR f,
4262 GtkWidget *wb = gtk_button_new (); 4269 GtkWidget *wb = gtk_button_new ();
4263 /* The eventbox is here so we can have tooltips on disabled items. */ 4270 /* The eventbox is here so we can have tooltips on disabled items. */
4264 GtkWidget *weventbox = gtk_event_box_new (); 4271 GtkWidget *weventbox = gtk_event_box_new ();
4272#if GTK_CHECK_VERSION (3, 3, 6)
4273 GtkCssProvider *css_prov = gtk_css_provider_new ();
4274 GtkStyleContext *gsty;
4275
4276 gtk_css_provider_load_from_data (css_prov,
4277 "GtkEventBox {"
4278 " background-color: transparent;"
4279 "}",
4280 -1, NULL);
4281
4282 gsty = gtk_widget_get_style_context (weventbox);
4283 gtk_style_context_add_provider (gsty,
4284 GTK_STYLE_PROVIDER (css_prov),
4285 GTK_STYLE_PROVIDER_PRIORITY_USER);
4286 g_object_unref (css_prov);
4287#endif
4265 4288
4266 gtk_box_set_homogeneous (GTK_BOX (vb), FALSE); 4289 gtk_box_set_homogeneous (GTK_BOX (vb), FALSE);
4267 4290