summaryrefslogtreecommitdiff
path: root/examples/application9
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-04-17 12:18:01 -0700
committerMatthias Clasen <mclasen@redhat.com>2014-04-17 22:55:39 -0400
commitfcba75c2ba695a5e06c1185aee46e9d6b215c710 (patch)
tree773d525d61bcfc0d6aecfe8d381231e2a7512ba7 /examples/application9
parentb718b95aabf5484f7ea5f1679706a50f67bd0271 (diff)
downloadgtk+-fcba75c2ba695a5e06c1185aee46e9d6b215c710.tar.gz
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.
Diffstat (limited to 'examples/application9')
-rw-r--r--examples/application9/exampleappprefs.c10
-rw-r--r--examples/application9/prefs.ui13
2 files changed, 1 insertions, 22 deletions
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
@@ -26,12 +26,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)
{
ExampleAppPrefsPrivate *priv;
@@ -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 @@
</child>
</object>
</child>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="action_area">
- <property name="visible">True</property>
- <child>
- <object class="GtkButton" id="close">
- <signal name="clicked" handler="preferences_closed"/>
- <property name="visible">True</property>
- <property name="label">_Close</property>
- <property name="use-underline">True</property>
- </object>
- </child>
- </object>
- </child>
</object>
</child>
</template>