[gnome-software/wip/exalm/libadwaita-beta: 2/5] Update adw_carousel_scroll_to() uses
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/exalm/libadwaita-beta: 2/5] Update adw_carousel_scroll_to() uses
- Date: Wed, 8 Dec 2021 11:15:14 +0000 (UTC)
commit 85ae0794c4f6913c5e746329d119149a20cf17cc
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Wed Dec 8 02:17:41 2021 +0500
Update adw_carousel_scroll_to() uses
Libadwaita has cleaned it up in a last-minute API change before beta,
since carousel transitions use spring animations and don't have a fixed
duration anymore.
src/gs-featured-carousel.c | 6 +++---
src/gs-screenshot-carousel.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/gs-featured-carousel.c b/src/gs-featured-carousel.c
index 73b5938b8..7b7ca489c 100644
--- a/src/gs-featured-carousel.c
+++ b/src/gs-featured-carousel.c
@@ -83,7 +83,7 @@ show_relative_page (GsFeaturedCarousel *self,
guint n_pages = adw_carousel_get_n_pages (self->carousel);
gdouble new_page;
GtkWidget *new_page_widget;
- gint64 animation_duration_ms = adw_carousel_get_animation_duration (self->carousel);
+ gboolean animate = TRUE;
if (n_pages == 0)
return;
@@ -99,9 +99,9 @@ show_relative_page (GsFeaturedCarousel *self,
* or from the first page to the last going backwards as it means rapidly
* spooling through all the pages, which looks confusing. */
if ((new_page == 0.0 && delta > 0) || (new_page == n_pages - 1 && delta < 0))
- animation_duration_ms = 0;
+ animate = FALSE;
- adw_carousel_scroll_to_full (self->carousel, new_page_widget, animation_duration_ms);
+ adw_carousel_scroll_to (self->carousel, new_page_widget, animate);
}
static gboolean
diff --git a/src/gs-screenshot-carousel.c b/src/gs-screenshot-carousel.c
index f9051892d..848e72c96 100644
--- a/src/gs-screenshot-carousel.c
+++ b/src/gs-screenshot-carousel.c
@@ -201,7 +201,7 @@ _carousel_navigate (AdwCarousel *carousel, AdwNavigationDirection direction)
child = g_list_nth_data (children, position);
if (child)
- adw_carousel_scroll_to (carousel, child);
+ adw_carousel_scroll_to (carousel, child, TRUE);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]