[gnome-tour/wip/exalm/ui-cleanups: 3/4] paginator: Switch page in the middle of the transition and not at the end
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-tour/wip/exalm/ui-cleanups: 3/4] paginator: Switch page in the middle of the transition and not at the end
- Date: Mon, 13 Jul 2020 21:24:23 +0000 (UTC)
commit 780454e31bcd88d64e5fa5e46fa9ed350f4dc2e0
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Tue Jul 14 01:59:35 2020 +0500
paginator: Switch page in the middle of the transition and not at the end
Take the position and round it, make the transition a bit more responsive.
src/widgets/paginator.rs | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/widgets/paginator.rs b/src/widgets/paginator.rs
index dbdaff5..29b19d8 100644
--- a/src/widgets/paginator.rs
+++ b/src/widgets/paginator.rs
@@ -73,13 +73,12 @@ impl PaginatorWidget {
p.close_btn.set_opacity(opacity);
p.close_btn.set_visible(opacity > 0_f64);
- }));
- self.carousel.connect_page_changed(clone!(@weak p => move |_carousel, page_nr| {
+ let page_nr = position.round() as u32;
let pages = &p.pages.borrow();
let page = pages.get(page_nr as usize).unwrap();
- p.headerbar.set_title(Some(&page.get_title()));
+ p.headerbar.set_title(Some(&page.get_title()));
p.current_page.replace(page_nr);
}));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]