diff options
author | Matthias Clasen <mclasen@redhat.com> | 2013-04-21 20:17:40 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2013-04-21 21:51:26 -0400 |
commit | c37b30f3175d96f8bfeec7983ee0dba3f9333b7f (patch) | |
tree | 453d75194fdc0f64c0f735856f9ff58b8afd9758 /tests/teststack.c | |
parent | 88cd26575d483221f5323c5cf23f1e8e26bd9cef (diff) | |
download | gtk+-c37b30f3175d96f8bfeec7983ee0dba3f9333b7f.tar.gz |
GtkStack: add vertical slide transitions
We allow transitions that slide up or down.
Diffstat (limited to 'tests/teststack.c')
-rw-r--r-- | tests/teststack.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/tests/teststack.c b/tests/teststack.c index 5a6a8cf531..0befd8d86f 100644 --- a/tests/teststack.c +++ b/tests/teststack.c @@ -50,7 +50,7 @@ on_back_button_clicked (GtkButton *button, GtkStack *stack) for (i = 1; i < G_N_ELEMENTS (seq); i++) { - if (g_str_equal (vis, seq[i])) + if (g_strcmp0 (vis, seq[i]) == 0) { gtk_stack_set_visible_child_full (stack, seq[i - 1], GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT); break; @@ -69,7 +69,7 @@ on_forward_button_clicked (GtkButton *button, GtkStack *stack) for (i = 0; i < G_N_ELEMENTS (seq) - 1; i++) { - if (g_str_equal (vis, seq[i])) + if (g_strcmp0 (vis, seq[i]) == 0) { gtk_stack_set_visible_child_full (stack, seq[i + 1], GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT); break; @@ -83,7 +83,7 @@ update_back_button_sensitivity (GtkStack *stack, GParamSpec *pspec, GtkWidget *b const gchar *vis; vis = gtk_stack_get_visible_child_name (stack); - gtk_widget_set_sensitive (button, ! g_str_equal (vis, "1")); + gtk_widget_set_sensitive (button, g_strcmp0 (vis, "1") != 0); } static void @@ -92,7 +92,7 @@ update_forward_button_sensitivity (GtkStack *stack, GParamSpec *pspec, GtkWidget const gchar *vis; vis = gtk_stack_get_visible_child_name (stack); - gtk_widget_set_sensitive (button, ! g_str_equal (vis, "3")); + gtk_widget_set_sensitive (button, g_strcmp0 (vis, "3") != 0); } gint @@ -209,14 +209,12 @@ main (gint argc, gtk_container_add (GTK_CONTAINER (hbox), button); combo = gtk_combo_box_text_new (); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), - "NONE"); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), - "CROSSFADE"); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), - "SLIDE_RIGHT"); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), - "SLIDE_LEFT"); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "NONE"); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "CROSSFADE"); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "SLIDE_RIGHT"); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "SLIDE_LEFT"); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "SLIDE_UP"); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "SLIDE_DOWN"); gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); gtk_container_add (GTK_CONTAINER (hbox), combo); |