[fractal] room_history: re-enable kinetic scrolling after loading more
- From: Julian Sparber <jsparber src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal] room_history: re-enable kinetic scrolling after loading more
- Date: Thu, 14 Mar 2019 14:12:19 +0000 (UTC)
commit 908a837b780db3344aa6355e15b933e1113d6f07
Author: Christopher Davis <brainblasted disroot org>
Date: Sun Mar 10 00:53:16 2019 -0500
room_history: re-enable kinetic scrolling after loading more
Previously kinetic scrolling was disabled while loading more
messages and was never re-enabled. This could lead to rooms
not scrolling with touch gestures.
Now after we add widgets to the top, we re-enable kinetic
scrolling for our ScrolledWindow.
Fixes https://gitlab.gnome.org/GNOME/fractal/issues/458
fractal-gtk/src/widgets/room_history.rs | 1 +
fractal-gtk/src/widgets/scroll_widget.rs | 5 +++++
2 files changed, 6 insertions(+)
---
diff --git a/fractal-gtk/src/widgets/room_history.rs b/fractal-gtk/src/widgets/room_history.rs
index 9ab8a6c9..6e4223a4 100644
--- a/fractal-gtk/src/widgets/room_history.rs
+++ b/fractal-gtk/src/widgets/room_history.rs
@@ -52,6 +52,7 @@ impl List {
}
}
self.list.push_back(element);
+ self.view.set_kinetic_scrolling(true);
/* TODO: update the previous message:
* we need to update the previous row because it could be that we have to remove the header */
None
diff --git a/fractal-gtk/src/widgets/scroll_widget.rs b/fractal-gtk/src/widgets/scroll_widget.rs
index 8fd53639..870db9f1 100644
--- a/fractal-gtk/src/widgets/scroll_widget.rs
+++ b/fractal-gtk/src/widgets/scroll_widget.rs
@@ -255,6 +255,11 @@ impl ScrollWidget {
self.widgets.view.set_kinetic_scrolling(false);
self.balance.set(Some(Position::Top));
}
+
+ pub fn set_kinetic_scrolling(&self, enabled: bool) {
+ self.widgets.view.set_kinetic_scrolling(enabled);
+ }
+
pub fn get_listbox(&self) -> gtk::ListBox {
self.widgets.listbox.clone()
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]