From fcba75c2ba695a5e06c1185aee46e9d6b215c710 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 17 Apr 2014 12:18:01 -0700 Subject: example: Modernize the prefs dialog We should show the current best practice for this kind of dialog, and use a headerbar with a window close button. --- examples/application9/exampleappprefs.c | 10 +--------- examples/application9/prefs.ui | 13 ------------- 2 files changed, 1 insertion(+), 22 deletions(-) (limited to 'examples/application9') diff --git a/examples/application9/exampleappprefs.c b/examples/application9/exampleappprefs.c index 8cd5d5e3a3..6a033817bd 100644 --- a/examples/application9/exampleappprefs.c +++ b/examples/application9/exampleappprefs.c @@ -25,12 +25,6 @@ struct _ExampleAppPrefsPrivate G_DEFINE_TYPE_WITH_PRIVATE(ExampleAppPrefs, example_app_prefs, GTK_TYPE_DIALOG) -static void -preferences_closed (GtkWidget *button) -{ - gtk_widget_destroy (gtk_widget_get_toplevel (button)); -} - static void example_app_prefs_init (ExampleAppPrefs *prefs) { @@ -68,12 +62,10 @@ example_app_prefs_class_init (ExampleAppPrefsClass *class) "/org/gtk/exampleapp/prefs.ui"); gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), ExampleAppPrefs, font); gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (class), ExampleAppPrefs, transition); - - gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), preferences_closed); } ExampleAppPrefs * example_app_prefs_new (ExampleAppWindow *win) { - return g_object_new (EXAMPLE_APP_PREFS_TYPE, "transient-for", win, NULL); + return g_object_new (EXAMPLE_APP_PREFS_TYPE, "transient-for", win, "use-header-bar", TRUE, NULL); } diff --git a/examples/application9/prefs.ui b/examples/application9/prefs.ui index 49781d194c..95e1cb8069 100644 --- a/examples/application9/prefs.ui +++ b/examples/application9/prefs.ui @@ -64,19 +64,6 @@ - - - True - - - - True - _Close - True - - - - -- cgit v1.2.1