[gnome-control-center/wip/feborges/new-users-panel: 16/17] user-accounts: Always select the first item in a page on the Carousel



commit 1b96a90e1e15c8b4f27cc6eee3f8131ac25ad782
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue Jul 12 17:24:02 2016 +0200

    user-accounts: Always select the first item in a page on the Carousel
    
    https://bugzilla.gnome.org/show_bug.cgi?id=767065

 panels/user-accounts/um-carousel.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/panels/user-accounts/um-carousel.c b/panels/user-accounts/um-carousel.c
index 0f44f8d..27b98ca 100644
--- a/panels/user-accounts/um-carousel.c
+++ b/panels/user-accounts/um-carousel.c
@@ -289,6 +289,7 @@ um_carousel_go_back_button_clicked (GtkButton *button,
                                     gpointer   user_data)
 {
         UmCarouselPrivate *priv;
+        GtkWidget *item;
         gchar *page_name;
 
         priv = UM_CAROUSEL (user_data)->priv;
@@ -299,6 +300,9 @@ um_carousel_go_back_button_clicked (GtkButton *button,
 
         page_name = g_strdup_printf ("%d", priv->current_page);
         gtk_stack_set_visible_child_name (priv->stack, page_name);
+
+        item = get_item_at_index (user_data, ITEMS_PER_PAGE * priv->current_page);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), TRUE);
 }
 
 static void
@@ -306,6 +310,7 @@ um_carousel_go_next_button_clicked (GtkButton *button,
                                     gpointer   user_data)
 {
         UmCarouselPrivate *priv;
+        GtkWidget *item;
         gchar *page_name;
 
         priv = UM_CAROUSEL (user_data)->priv;
@@ -316,6 +321,9 @@ um_carousel_go_next_button_clicked (GtkButton *button,
 
         page_name = g_strdup_printf ("%d", priv->current_page);
         gtk_stack_set_visible_child_name (priv->stack, page_name);
+
+        item = get_item_at_index (user_data, ITEMS_PER_PAGE * priv->current_page);
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), TRUE);
 }
 
 UmCarousel *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]