summaryrefslogtreecommitdiff
path: root/tests/testtitlebar.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2013-08-04 01:25:26 +0200
committerMatthias Clasen <mclasen@redhat.com>2013-08-05 01:37:58 +0200
commitb38a096aee2e7486ced567adbad3177d276a8e5a (patch)
tree4a6d472ec6fed9cdc980b40792bc3e8681d853b2 /tests/testtitlebar.c
parentf960cb1971ed1f69aa9ce2611ae5e1eb0d5a0fed (diff)
downloadgtk+-b38a096aee2e7486ced567adbad3177d276a8e5a.tar.gz
GtkHeaderBar: optionally add a close button
Add a boolean property that controls whether a window close button will be shown in the header bar or not. Doing this in the toolkit will ensure consistency of the visual apperance. https://bugzilla.gnome.org/show_bug.cgi?id=702971
Diffstat (limited to 'tests/testtitlebar.c')
-rw-r--r--tests/testtitlebar.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/tests/testtitlebar.c b/tests/testtitlebar.c
index e20c3940dd..107f705a5d 100644
--- a/tests/testtitlebar.c
+++ b/tests/testtitlebar.c
@@ -17,7 +17,9 @@ main (int argc, char *argv[])
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
header = gtk_header_bar_new ();
+ gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (header), TRUE);
gtk_style_context_add_class (gtk_widget_get_style_context (header), "titlebar");
+
title = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (title), "<b>Welcome to Facebook - Log in, sign up or learn more</b>");
gtk_label_set_ellipsize (GTK_LABEL (title), PANGO_ELLIPSIZE_END);
@@ -32,18 +34,6 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (button), image);
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
- gtk_header_bar_pack_end (GTK_HEADER_BAR (header), gtk_separator_new (GTK_ORIENTATION_VERTICAL));
-
- button = gtk_button_new ();
- icon = g_themed_icon_new ("window-close-symbolic");
- image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_BUTTON);
- g_object_unref (icon);
- gtk_container_add (GTK_CONTAINER (button), image);
- gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
- g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_window_close), window);
-
- gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
-
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_style_context_add_class (gtk_widget_get_style_context (box), "linked");
button = gtk_button_new ();