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:
parent
7d598bb1d0
commit
bd12b09cbc
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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(())
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user