diff --git a/gtk/gtkfontchooserdialog.c b/gtk/gtkfontchooserdialog.c
index 124fb10b1b..d54d30a1b1 100644
--- a/gtk/gtkfontchooserdialog.c
+++ b/gtk/gtkfontchooserdialog.c
@@ -34,6 +34,8 @@
#include "gtkbuildable.h"
#include "gtkprivate.h"
#include "gtkwidget.h"
+#include "gtksettings.h"
+#include "gtkdialogprivate.h"
struct _GtkFontChooserDialogPrivate
{
@@ -56,7 +58,7 @@ struct _GtkFontChooserDialogPrivate
*
GtkFontChooserDialog as GtkBuildable
* The GtkFontChooserDialog implementation of the GtkBuildable interface
* exposes the buttons with the names
- * "select_button" and "cancel_button.
+ * "select_button" and "cancel_button".
*
*
* Since: 3.2
@@ -137,8 +139,6 @@ gtk_font_chooser_dialog_class_init (GtkFontChooserDialogClass *klass)
"/org/gtk/libgtk/gtkfontchooserdialog.ui");
gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserDialog, fontchooser);
- gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserDialog, select_button);
- gtk_widget_class_bind_template_child_private (widget_class, GtkFontChooserDialog, cancel_button);
gtk_widget_class_bind_template_callback (widget_class, font_activated_cb);
}
@@ -151,6 +151,12 @@ gtk_font_chooser_dialog_init (GtkFontChooserDialog *fontchooserdiag)
priv = fontchooserdiag->priv;
gtk_widget_init_template (GTK_WIDGET (fontchooserdiag));
+ gtk_dialog_set_use_header_bar_from_setting (GTK_DIALOG (fontchooserdiag));
+ gtk_dialog_add_buttons (GTK_DIALOG (fontchooserdiag),
+ _("_Cancel"), GTK_RESPONSE_CANCEL,
+ _("_Select"), GTK_RESPONSE_OK,
+ NULL);
+ gtk_dialog_set_default_response (GTK_DIALOG (fontchooserdiag), GTK_RESPONSE_OK);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_dialog_set_alternative_button_order (GTK_DIALOG (fontchooserdiag),
GTK_RESPONSE_OK,
@@ -158,6 +164,9 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-1);
G_GNUC_END_IGNORE_DEPRECATIONS
+ priv->select_button = gtk_dialog_get_widget_for_response (GTK_DIALOG (fontchooserdiag), GTK_RESPONSE_OK);
+ priv->cancel_button = gtk_dialog_get_widget_for_response (GTK_DIALOG (fontchooserdiag), GTK_RESPONSE_CANCEL);
+
_gtk_font_chooser_set_delegate (GTK_FONT_CHOOSER (fontchooserdiag),
GTK_FONT_CHOOSER (priv->fontchooser));
}
diff --git a/gtk/gtkfontchooserdialog.ui b/gtk/gtkfontchooserdialog.ui
index 268c8f3318..a1dea23ca4 100644
--- a/gtk/gtkfontchooserdialog.ui
+++ b/gtk/gtkfontchooserdialog.ui
@@ -4,55 +4,13 @@
False
5
- Font Selection
+ Select Font
dialog
-
- cancel_button
- select_button
-
diff --git a/gtk/gtkfontchooserdialog.ui.h b/gtk/gtkfontchooserdialog.ui.h
index dc7de1e2fd..3078a6db10 100644
--- a/gtk/gtkfontchooserdialog.ui.h
+++ b/gtk/gtkfontchooserdialog.ui.h
@@ -1,3 +1 @@
-N_("Font Selection");
-N_("_Cancel");
-N_("_Select");
+N_("Select Font");