diff --git a/src/gs-featured-carousel.c b/src/gs-featured-carousel.c index c0af489227148d37dd0fce70ef0751b962cb9cc1..4ce56871e74d67101a6a4fe245bfcf2a08d0265b 100644 --- a/src/gs-featured-carousel.c +++ b/src/gs-featured-carousel.c @@ -132,6 +132,14 @@ stop_rotation_timer (GsFeaturedCarousel *self) } } +static void +carousel_notify_position_cb (GsFeaturedCarousel *self) +{ + /* Reset the rotation timer in case it’s about to fire. */ + stop_rotation_timer (self); + start_rotation_timer (self); +} + static void next_button_clicked_cb (GtkButton *button, gpointer user_data) @@ -139,10 +147,6 @@ next_button_clicked_cb (GtkButton *button, GsFeaturedCarousel *self = GS_FEATURED_CAROUSEL (user_data); show_relative_page (self, +1); - - /* Reset the rotation timer in case it’s about to fire. */ - stop_rotation_timer (self); - start_rotation_timer (self); } static void @@ -152,10 +156,6 @@ previous_button_clicked_cb (GtkButton *button, GsFeaturedCarousel *self = GS_FEATURED_CAROUSEL (user_data); show_relative_page (self, -1); - - /* Reset the rotation timer in case it’s about to fire. */ - stop_rotation_timer (self); - start_rotation_timer (self); } static void @@ -303,6 +303,7 @@ gs_featured_carousel_class_init (GsFeaturedCarouselClass *klass) gtk_widget_class_bind_template_child (widget_class, GsFeaturedCarousel, carousel); gtk_widget_class_bind_template_child (widget_class, GsFeaturedCarousel, next_button); gtk_widget_class_bind_template_child (widget_class, GsFeaturedCarousel, previous_button); + gtk_widget_class_bind_template_callback (widget_class, carousel_notify_position_cb); gtk_widget_class_bind_template_callback (widget_class, next_button_clicked_cb); gtk_widget_class_bind_template_callback (widget_class, previous_button_clicked_cb); gtk_widget_class_bind_template_callback (widget_class, key_pressed_cb); diff --git a/src/gs-featured-carousel.ui b/src/gs-featured-carousel.ui index 6298534c34c959340ad68e9e45383c659efef172..3348686b8d817879b51f4e5ce06bd362065a829c 100644 --- a/src/gs-featured-carousel.ui +++ b/src/gs-featured-carousel.ui @@ -20,6 +20,7 @@ fill +