Bring series collation up to speed

This commit is contained in:
Reinout Meliesie 2025-01-31 17:09:22 +01:00
commit 01bfa16481
Signed by: zedfrigg
GPG key ID: 3AFCC06481308BC6
5 changed files with 94 additions and 106 deletions

View file

@ -79,14 +79,17 @@ impl CollatableSeriesContainer {
pub fn new ( series : Vec <Series> ) -> Self {
let collated_grid = leak (
CollatedSeriesGrid :: new ( series , SeriesSorting :: default () ) ) ;
let series_collation_menu = SeriesCollationMenu :: new ( |sorted_by| {
collated_grid . set_sorting (sorted_by) ;
let series_collation_menu = SeriesCollationMenu :: new ( |sorting| {
collated_grid . set_sorting (sorting) ;
} ) ;
let widget = g_box ! (
@ orientation : Vertical ,
* series_collation_menu . get_widget () ,
create_collection_scrolled_window ( collated_grid . get_widget () ) ,
scrolled_window ! (
@ propagate_natural_height : true ,
vertically_filling ! ( * collated_grid . get_widget () ) ,
) ,
) ;
Self { collated_grid , widget }
@ -103,10 +106,3 @@ impl Component <Box> for CollatableFilmsContainer {
impl Component <Box> for CollatableSeriesContainer {
fn get_widget ( & self ) -> & Box { & self . widget }
}
fn create_collection_scrolled_window ( child : & FlowBox ) -> ScrolledWindow {
ScrolledWindow :: builder ()
. child ( & vertically_filling ! ( * child ) )
. propagate_natural_height (true)
. build ()
}