Commit 8fcfbc17 authored by Matthias Clasen's avatar Matthias Clasen

Test a few more titlebar things

Add tests for fullscreening and disposing with custom titlebar
to testheaderbar.
parent 7052d407
......@@ -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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment