summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2013-05-12 21:00:06 -0400
committerMatthias Clasen <mclasen@redhat.com>2013-05-12 21:01:59 -0400
commit8fcfbc179c5741104a725dc2161d9a6c5bdd5350 (patch)
tree95a5be72a6a1ae7cbfccdfe837f3bdded8fb3fdc
parent7052d4071cff1bbbebb58b867e364a231e4dc841 (diff)
downloadgtk+-8fcfbc179c5741104a725dc2161d9a6c5bdd5350.tar.gz
Test a few more titlebar things
Add tests for fullscreening and disposing with custom titlebar to testheaderbar.
-rw-r--r--tests/testheaderbar.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/testheaderbar.c b/tests/testheaderbar.c
index cfee8d43f3..18b2b42a46 100644
--- a/tests/testheaderbar.c
+++ b/tests/testheaderbar.c
@@ -51,6 +51,24 @@ change_subtitle (GtkButton *button, gpointer data)
}
}
+static void
+toggle_fullscreen (GtkButton *button, gpointer data)
+{
+ GtkWidget *window = GTK_WIDGET (data);
+ static gboolean fullscreen = FALSE;
+
+ if (fullscreen)
+ {
+ gtk_window_unfullscreen (GTK_WINDOW (window));
+ fullscreen = FALSE;
+ }
+ else
+ {
+ gtk_window_fullscreen (GTK_WINDOW (window));
+ fullscreen = TRUE;
+ }
+}
+
int
main (int argc, char *argv[])
{
@@ -102,7 +120,9 @@ main (int argc, char *argv[])
button = gtk_button_new_with_label ("End 1");
g_signal_connect (button, "clicked", G_CALLBACK (change_subtitle), header);
gtk_header_bar_pack_end (GTK_HEADER_BAR (footer), button);
- gtk_header_bar_pack_end (GTK_HEADER_BAR (footer), gtk_button_new_with_label ("End 2"));
+ button = gtk_button_new_with_label ("End 2");
+ gtk_header_bar_pack_end (GTK_HEADER_BAR (footer), button);
+ g_signal_connect (button, "clicked", G_CALLBACK (toggle_fullscreen), window);
gtk_box_pack_end (GTK_BOX (box), footer, FALSE, FALSE, 0);
content = gtk_image_new_from_icon_name ("start-here-symbolic", GTK_ICON_SIZE_DIALOG);
@@ -114,5 +134,7 @@ main (int argc, char *argv[])
gtk_main ();
+ gtk_widget_destroy (window);
+
return 0;
}