Add infinite scroll behaviour
This commit is contained in:
parent
b66376bd6c
commit
a7da2a7531
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue