diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-03-29 10:51:00 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-03-29 10:54:45 -0400 |
commit | 53a28f7672741588898ebbe3be1069b8ab49a1d1 (patch) | |
tree | 35bbda3015e12b385b418d5e669363bfb7769ae9 /tests/testrevealer.c | |
parent | 5261bc65859ecffee01b1b8033678e7623ae43cb (diff) | |
download | gtk+-53a28f7672741588898ebbe3be1069b8ab49a1d1.tar.gz |
testrevealer: Cover the new transitions
Add tests for all the swing transitions.
Diffstat (limited to 'tests/testrevealer.c')
-rw-r--r-- | tests/testrevealer.c | 78 |
1 files changed, 67 insertions, 11 deletions
diff --git a/tests/testrevealer.c b/tests/testrevealer.c index c5aa82e4c0..cb2cf9b952 100644 --- a/tests/testrevealer.c +++ b/tests/testrevealer.c @@ -26,7 +26,7 @@ main (gint argc, gtk_widget_set_margin_bottom (widget, 10); gtk_widget_set_margin_start (widget, 10); gtk_widget_set_margin_end (widget, 10); - gtk_grid_attach (GTK_GRID (box), widget, 3, 3, 1, 1); + gtk_grid_attach (GTK_GRID (box), widget, 4, 4, 1, 1); widget = gtk_toggle_button_new_with_label ("None"); gtk_grid_attach (GTK_GRID (box), widget, 0, 0, 1, 1); @@ -42,7 +42,7 @@ main (gint argc, gtk_grid_attach (GTK_GRID (box), revealer, 1, 0, 1, 1); widget = gtk_toggle_button_new_with_label ("Fade"); - gtk_grid_attach (GTK_GRID (box), widget, 4, 4, 1, 1); + gtk_grid_attach (GTK_GRID (box), widget, 5, 5, 1, 1); revealer = gtk_revealer_new (); gtk_widget_set_halign (revealer, GTK_ALIGN_END); gtk_widget_set_valign (revealer, GTK_ALIGN_END); @@ -52,9 +52,9 @@ main (gint argc, g_object_bind_property (widget, "active", revealer, "reveal-child", 0); gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_CROSSFADE); gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000); - gtk_grid_attach (GTK_GRID (box), revealer, 3, 4, 1, 1); + gtk_grid_attach (GTK_GRID (box), revealer, 4, 5, 1, 1); - widget = gtk_toggle_button_new_with_label ("Right"); + widget = gtk_toggle_button_new_with_label ("Slide"); gtk_grid_attach (GTK_GRID (box), widget, 0, 2, 1, 1); revealer = gtk_revealer_new (); gtk_widget_set_hexpand (revealer, TRUE); @@ -67,7 +67,22 @@ main (gint argc, gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000); gtk_grid_attach (GTK_GRID (box), revealer, 1, 2, 1, 1); - widget = gtk_toggle_button_new_with_label ("Down"); + widget = gtk_toggle_button_new_with_label ("Swing"); + gtk_widget_set_valign (widget, GTK_ALIGN_START); + gtk_grid_attach (GTK_GRID (box), widget, 0, 3, 1, 1); + revealer = gtk_revealer_new (); + gtk_widget_set_hexpand (revealer, TRUE); + gtk_widget_set_halign (revealer, GTK_ALIGN_START); + gtk_widget_set_valign (revealer, GTK_ALIGN_START); + entry = gtk_entry_new (); + gtk_editable_set_text (GTK_EDITABLE (entry), "12345"); + gtk_container_add (GTK_CONTAINER (revealer), entry); + g_object_bind_property (widget, "active", revealer, "reveal-child", 0); + gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT); + gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000); + gtk_grid_attach (GTK_GRID (box), revealer, 1, 3, 1, 1); + + widget = gtk_toggle_button_new_with_label ("Slide"); gtk_grid_attach (GTK_GRID (box), widget, 2, 0, 1, 1); revealer = gtk_revealer_new (); gtk_widget_set_vexpand (revealer, TRUE); @@ -80,8 +95,21 @@ main (gint argc, gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000); gtk_grid_attach (GTK_GRID (box), revealer, 2, 1, 1, 1); - widget = gtk_toggle_button_new_with_label ("Left"); - gtk_grid_attach (GTK_GRID (box), widget, 4, 2, 1, 1); + widget = gtk_toggle_button_new_with_label ("Swing"); + gtk_grid_attach (GTK_GRID (box), widget, 3, 0, 1, 1); + revealer = gtk_revealer_new (); + gtk_widget_set_vexpand (revealer, TRUE); + gtk_widget_set_valign (revealer, GTK_ALIGN_START); + entry = gtk_entry_new (); + gtk_editable_set_text (GTK_EDITABLE (entry), "23456"); + gtk_container_add (GTK_CONTAINER (revealer), entry); + g_object_bind_property (widget, "active", revealer, "reveal-child", 0); + gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN); + gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000); + gtk_grid_attach (GTK_GRID (box), revealer, 3, 1, 1, 1); + + widget = gtk_toggle_button_new_with_label ("Slide"); + gtk_grid_attach (GTK_GRID (box), widget, 5, 2, 1, 1); revealer = gtk_revealer_new (); gtk_widget_set_hexpand (revealer, TRUE); gtk_widget_set_halign (revealer, GTK_ALIGN_END); @@ -91,10 +119,25 @@ main (gint argc, g_object_bind_property (widget, "active", revealer, "reveal-child", 0); gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT); gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000); - gtk_grid_attach (GTK_GRID (box), revealer, 3, 2, 1, 1); + gtk_grid_attach (GTK_GRID (box), revealer, 4, 2, 1, 1); + + widget = gtk_toggle_button_new_with_label ("Swing"); + gtk_widget_set_valign (widget, GTK_ALIGN_START); + gtk_grid_attach (GTK_GRID (box), widget, 5, 3, 1, 1); + revealer = gtk_revealer_new (); + gtk_widget_set_hexpand (revealer, TRUE); + gtk_widget_set_halign (revealer, GTK_ALIGN_END); + gtk_widget_set_valign (revealer, GTK_ALIGN_START); + entry = gtk_entry_new (); + gtk_editable_set_text (GTK_EDITABLE (entry), "34567"); + gtk_container_add (GTK_CONTAINER (revealer), entry); + g_object_bind_property (widget, "active", revealer, "reveal-child", 0); + gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT); + gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000); + gtk_grid_attach (GTK_GRID (box), revealer, 4, 3, 1, 1); - widget = gtk_toggle_button_new_with_label ("Up"); - gtk_grid_attach (GTK_GRID (box), widget, 2, 4, 1, 1); + widget = gtk_toggle_button_new_with_label ("Slide"); + gtk_grid_attach (GTK_GRID (box), widget, 2, 5, 1, 1); revealer = gtk_revealer_new (); gtk_widget_set_vexpand (revealer, TRUE); gtk_widget_set_valign (revealer, GTK_ALIGN_END); @@ -104,7 +147,20 @@ main (gint argc, g_object_bind_property (widget, "active", revealer, "reveal-child", 0); gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP); gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000); - gtk_grid_attach (GTK_GRID (box), revealer, 2, 3, 1, 1); + gtk_grid_attach (GTK_GRID (box), revealer, 2, 4, 1, 1); + + widget = gtk_toggle_button_new_with_label ("Swing"); + gtk_grid_attach (GTK_GRID (box), widget, 3, 5, 1, 1); + revealer = gtk_revealer_new (); + gtk_widget_set_vexpand (revealer, TRUE); + gtk_widget_set_valign (revealer, GTK_ALIGN_END); + entry = gtk_entry_new (); + gtk_editable_set_text (GTK_EDITABLE (entry), "45678"); + gtk_container_add (GTK_CONTAINER (revealer), entry); + g_object_bind_property (widget, "active", revealer, "reveal-child", 0); + gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SWING_UP); + gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000); + gtk_grid_attach (GTK_GRID (box), revealer, 3, 4, 1, 1); gtk_widget_show (window); gtk_main (); |