Formatting in collation_menu
This commit is contained in:
parent
e29c555412
commit
70e8121a2a
1 changed files with 4 additions and 9 deletions
|
@ -16,8 +16,7 @@ pub struct FilmCollationMenu { widget : Box }
|
|||
pub struct SeriesCollationMenu { widget : Box }
|
||||
|
||||
impl FilmCollationMenu {
|
||||
pub fn new <F> ( on_sort : F ) -> Self
|
||||
where F : Fn (FilmsSortedBy) + 'static {
|
||||
pub fn new < F : Fn (FilmsSortedBy) + 'static > ( on_sort : F ) -> Self {
|
||||
let widget = Box :: builder ()
|
||||
. orientation (Horizontal)
|
||||
. halign (Center)
|
||||
|
@ -62,8 +61,7 @@ fn create_sort_button ( sort_menu : & Popover ) -> SplitButton {
|
|||
. build ()
|
||||
}
|
||||
|
||||
fn create_films_sort_menu <F> ( on_sort : F ) -> Popover
|
||||
where F : Fn (FilmsSortedBy) + 'static {
|
||||
fn create_films_sort_menu < F : Fn (FilmsSortedBy) + 'static > ( on_sort : F ) -> Popover {
|
||||
let container = ListBox :: new () ;
|
||||
|
||||
container . append ( & create_sort_menu_entry ( "Name" , false , true ) ) ;
|
||||
|
@ -84,8 +82,7 @@ where F : Fn (FilmsSortedBy) + 'static {
|
|||
. css_classes ( ["menu"] )
|
||||
. build ()
|
||||
}
|
||||
fn create_series_sort_menu <F> ( on_sort : F ) -> Popover
|
||||
where F : Fn (SeriesSortedBy) + 'static {
|
||||
fn create_series_sort_menu < F : Fn (SeriesSortedBy) + 'static > ( on_sort : F ) -> Popover {
|
||||
let container = ListBox :: new () ;
|
||||
|
||||
container . append ( & create_sort_menu_entry ( "Name" , false , true ) ) ;
|
||||
|
@ -105,9 +102,7 @@ where F : Fn (SeriesSortedBy) + 'static {
|
|||
. build ()
|
||||
}
|
||||
|
||||
fn create_sort_menu_entry (
|
||||
label : & str , reverse : bool , selected : bool ,
|
||||
) -> ListBoxRow {
|
||||
fn create_sort_menu_entry ( label : & str , reverse : bool , selected : bool ) -> ListBoxRow {
|
||||
let icon = match reverse {
|
||||
false => Image :: from_icon_name ("view-sort-ascending-symbolic") ,
|
||||
true => Image :: from_icon_name ("view-sort-descending-symbolic") ,
|
||||
|
|
Loading…
Add table
Reference in a new issue