#define remove_submenu(w) gtk_menu_item_remove_submenu ((w))
#endif
+#if GTK_MAJOR_VERSION < 3 || \
+ (GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 2)
+#define gtk_font_chooser_dialog_new(x, y) \
+ gtk_font_selection_dialog_new (x)
+#undef GTK_FONT_CHOOSER
+#define GTK_FONT_CHOOSER(x) GTK_FONT_SELECTION_DIALOG (x)
+#define gtk_font_chooser_set_font(x, y) \
+ gtk_font_selection_dialog_set_font_name (x, y)
+#define gtk_font_chooser_get_font(x) \
+ gtk_font_selection_dialog_get_font_name (x)
+#endif
+
#ifndef HAVE_GTK3
#ifdef USE_GTK_TOOLTIP
#define gdk_window_get_screen(w) gdk_drawable_get_screen (w)
&bytes_written, &err))
&& err->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE)
{
- strncpy (up, (char *)p, bytes_written);
+ memcpy (up, p, bytes_written);
sprintf (up + bytes_written, "\\%03o", p[bytes_written]);
up += bytes_written+4;
p += bytes_written+1;
gtk_widget_set_name (wfixed, SSDATA (Vx_resource_name));
/* If this frame has a title or name, set it in the title bar. */
- if (! NILP (f->title)) title = SSDATA (ENCODE_UTF_8 (f->title));
- else if (! NILP (f->name)) title = SSDATA (ENCODE_UTF_8 (f->name));
+ if (! NILP (f->title))
+ title = SSDATA (ENCODE_UTF_8 (f->title));
+ else if (! NILP (f->name))
+ title = SSDATA (ENCODE_UTF_8 (f->name));
if (title) gtk_window_set_title (GTK_WINDOW (wtop), title);
sigblock (sigmask (__SIGRTMIN));
#endif /* HAVE_PTHREAD */
- w = gtk_font_selection_dialog_new ("Pick a font");
+ w = gtk_font_chooser_dialog_new
+ ("Pick a font", GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)));
+
if (!default_name)
default_name = "Monospace 10";
- gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG (w),
- default_name);
+ gtk_font_chooser_set_font (GTK_FONT_CHOOSER (w), default_name);
gtk_widget_set_name (w, "emacs-fontdialog");
done = xg_dialog_run (f, w);
#endif
if (done == GTK_RESPONSE_OK)
- fontname = gtk_font_selection_dialog_get_font_name
- (GTK_FONT_SELECTION_DIALOG (w));
+ fontname = gtk_font_chooser_get_font (GTK_FONT_CHOOSER (w));
gtk_widget_destroy (w);
return fontname;
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;
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
}
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);