Header & view stack are now components, introduced Component trait

This commit is contained in:
Reinout Meliesie 2024-11-27 15:22:55 +01:00
commit 4778d879f4
Signed by: zedfrigg
GPG key ID: 3AFCC06481308BC6
8 changed files with 184 additions and 100 deletions

View file

@ -6,10 +6,10 @@ use {
gdk :: Texture ,
prelude :: * ,
} ,
std :: { cell :: * , iter :: * , path :: * } ,
std :: { cell :: * , iter :: * , path :: Path } ,
} ;
use crate :: collection :: * ;
use crate :: { collection :: * , ui :: component :: * } ;
@ -66,8 +66,6 @@ impl CollatedFilmsGrid {
self . grid_widget . append (film_widget) ;
}
}
pub fn get_widget ( & self ) -> & FlowBox { & self . grid_widget }
}
impl CollatedSeriesGrid {
pub fn new ( series : Vec <Series> , sorting : SeriesSortedBy ) -> Self {
@ -110,8 +108,13 @@ impl CollatedSeriesGrid {
self . grid_widget . append (series_widget) ;
}
}
}
pub fn get_widget ( & self ) -> & FlowBox { & self . grid_widget }
impl Component <FlowBox> for CollatedFilmsGrid {
fn get_widget ( & self ) -> & FlowBox { & self . grid_widget }
}
impl Component <FlowBox> for CollatedSeriesGrid {
fn get_widget ( & self ) -> & FlowBox { & self . grid_widget }
}
fn sort_film_widget_pairs (