Add infinite scroll behaviour

This commit is contained in:
BusyVar 2023-08-30 00:53:46 +02:00
parent b66376bd6c
commit a7da2a7531
2 changed files with 13 additions and 0 deletions

View File

@ -54,6 +54,11 @@ impl SimpleComponent for CommunityPage {
view! {
gtk::ScrolledWindow {
set_vexpand: false,
connect_edge_reached[sender] => move |_,pos| {
if pos == gtk::PositionType::Bottom {
sender.input(CommunityInput::FetchPosts)
}
},
gtk::Box {
set_orientation: gtk::Orientation::Vertical,

View File

@ -36,6 +36,14 @@ impl SimpleComponent for PostsPage {
view! {
gtk::ScrolledWindow {
set_hexpand: true,
connect_edge_reached[sender] => move |_,pos| {
if pos == gtk::PositionType::Bottom {
sender.input(
PostsPageInput::FetchPosts(
model.posts_type,
model.posts_order, false))
}
},
gtk::Box {
set_orientation: gtk::Orientation::Vertical,