ShowsView: Fix a bug where the last show would not be shown.

utils::lazy_load() now calls widget.show() for each widget it adds
to the parent container.
This commit is contained in:
Jordan Petridis 2018-05-16 19:44:58 +03:00
parent 7d598bb1d0
commit bd12b09cbc
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6
2 changed files with 8 additions and 8 deletions

View File

@ -68,10 +68,14 @@ where
T::Item: 'static,
C: ContainerExt + 'static,
F: FnMut(T::Item) -> W + 'static,
W: IsA<Widget>,
W: IsA<Widget> + WidgetExt,
U: Fn() + 'static,
{
let func = move |x| container.add(&contructor(x));
let func = move |x| {
let widget = contructor(x);
container.add(&widget);
widget.show();
};
lazy_load_full(data, func, callback);
}

View File

@ -93,18 +93,14 @@ fn populate_flowbox(shows: &Rc<ShowsView>) -> Result<(), Error> {
let ignore = get_ignored_shows()?;
let podcasts = dbqueries::get_podcasts_filter(&ignore)?;
let flowbox = shows.flowbox.clone();
let constructor = clone!(flowbox => move |parent| {
flowbox.show_all();
ShowsChild::new(&parent).child
});
let constructor = move |parent| ShowsChild::new(&parent).child;
let callback = clone!(shows => move || {
shows.set_vadjustment()
.map_err(|err| error!("Failed to set ShowsView Alignment: {}", err))
.ok();
});
let flowbox = shows.flowbox.clone();
lazy_load(podcasts, flowbox, constructor, callback);
Ok(())
}