UI macro syntax now differentiates at-properties from arguments

This commit is contained in:
Reinout Meliesie 2025-02-04 15:02:58 +01:00
commit ce70725b60
Signed by: zedfrigg
GPG key ID: 3AFCC06481308BC6
8 changed files with 80 additions and 80 deletions

View file

@ -25,9 +25,9 @@ pub struct CollatedSeriesGrid {
impl CollatedFilmsGrid {
pub fn new ( films : Vec <Film> , sorting : FilmsSorting ) -> Self {
let grid_widget = flow_box ! (
@ orientation : Horizontal ,
@ homogeneous : true ,
@ selection_mode : SelectionMode :: None ,
@ orientation : Horizontal ;
@ homogeneous : true ;
@ selection_mode : SelectionMode :: None ;
) ;
let film_widget_pairs = RefCell :: new ( vec ! () ) ;
@ -78,9 +78,9 @@ impl CollatedFilmsGrid {
impl CollatedSeriesGrid {
pub fn new ( series : Vec <Series> , sorting : SeriesSorting ) -> Self {
let grid_widget = flow_box ! (
@ orientation : Horizontal ,
@ homogeneous : true ,
@ selection_mode : SelectionMode :: None ,
@ orientation : Horizontal ;
@ homogeneous : true ;
@ selection_mode : SelectionMode :: None ;
) ;
let series_widget_pairs = RefCell :: new ( vec ! () ) ;
@ -178,7 +178,7 @@ fn create_collection_item (
container . append (
& Label :: builder ()
. label (name)
. attributes ( & pango_attributes ! ( @ scale : SCALE_LARGE , @ weight : Bold , ) )
. attributes ( & pango_attributes ! ( @ scale : SCALE_LARGE ; @ weight : Bold ; ) )
. justify ( Justification :: Center )
. wrap (true)
. max_width_chars (1) // Not the actual limit, used instead to wrap more aggressively
@ -203,18 +203,18 @@ fn create_collection_item (
fn create_film_details ( film : & Film ) -> Box {
g_box ! (
@ orientation : Horizontal ,
@ halign : Center ,
@ spacing : 20 ,
@ orientation : Horizontal ;
@ halign : Center ;
@ spacing : 20 ;
label ! ( film . release_date . as_str () ) ,
label ! ( format ! ( "{}m" , film . runtime_minutes ) . as_str () ) ,
)
}
fn create_series_details ( series : & Series ) -> Box {
g_box ! (
@ orientation : Horizontal ,
@ halign : Center ,
@ spacing : 20 ,
@ orientation : Horizontal ;
@ halign : Center ;
@ spacing : 20 ;
// TODO
label ! ("????") ,
)

View file

@ -20,11 +20,11 @@ impl FilmCollationMenu {
let film_sort_button = FilmSortButton :: new (on_sort) ;
let widget = g_box ! (
@ orientation : Horizontal ,
@ halign : Center ,
@ spacing : 20 ,
@ widget_name : "film-collation-menu" ,
@ css_classes : [ "toolbar" ] ,
@ orientation : Horizontal ;
@ halign : Center ;
@ spacing : 20 ;
@ widget_name : "film-collation-menu" ;
@ css_classes : [ "toolbar" ] ;
* film_sort_button . get_widget () ,
) ;
@ -36,11 +36,11 @@ impl SeriesCollationMenu {
let series_sort_button = SeriesSortButton :: new (on_sort) ;
let widget = g_box ! (
@ orientation : Horizontal ,
@ halign : Center ,
@ spacing : 20 ,
@ widget_name : "series-collation-menu" ,
@ css_classes : [ "toolbar" ] ,
@ orientation : Horizontal ;
@ halign : Center ;
@ spacing : 20 ;
@ widget_name : "series-collation-menu" ;
@ css_classes : [ "toolbar" ] ;
* series_sort_button . get_widget () ,
) ;

View file

@ -32,28 +32,28 @@ impl FilmSortButton {
let widget = split_button ! (
@ popover : popover ! (
@ css_classes : [ "menu" ] ,
@ css_classes : [ "menu" ] ;
list_box ! (
@ connect_row_activated : move | _ , row | {
on_film_sort_activated ( row , previous_sorting , & on_sort , sort_icons ) ;
} ,
} ;
g_box ! (
@ orientation : Horizontal , @ spacing : 20 ,
label ! ( @ hexpand : true , @ halign : Start , "Name" ) ,
@ orientation : Horizontal ; @ spacing : 20 ;
label ! ( @ hexpand : true ; @ halign : Start ; "Name" ) ,
sort_icons [0] ,
) ,
g_box ! (
@ orientation : Horizontal , @ spacing : 20 ,
label ! ( @ hexpand : true , @ halign : Start , "Release date" ) ,
@ orientation : Horizontal ; @ spacing : 20 ;
label ! ( @ hexpand : true ; @ halign : Start ; "Release date" ) ,
sort_icons [1] ,
) ,
g_box ! (
@ orientation : Horizontal , @ spacing : 20 ,
label ! ( @ hexpand : true , @ halign : Start , "Runtime" ) ,
@ orientation : Horizontal ; @ spacing : 20 ;
label ! ( @ hexpand : true ; @ halign : Start ; "Runtime" ) ,
sort_icons [2] ,
) ,
) ,
) ,
) ;
label ! ("Sort") ,
) ;
@ -71,23 +71,23 @@ impl SeriesSortButton {
let widget = split_button ! (
@ popover : popover ! (
@ css_classes : [ "menu" ] ,
@ css_classes : [ "menu" ] ;
list_box ! (
@ connect_row_activated : move | _ , row | {
on_series_sort_activated ( row , previous_sorting , & on_sort , sort_icons ) ;
} ,
} ;
g_box ! (
@ orientation : Horizontal , @ spacing : 20 ,
label ! ( @ hexpand : true , @ halign : Start , "Name" ) ,
@ orientation : Horizontal ; @ spacing : 20 ;
label ! ( @ hexpand : true ; @ halign : Start ; "Name" ) ,
sort_icons [0] ,
) ,
g_box ! (
@ orientation : Horizontal , @ spacing : 20 ,
label ! ( @ hexpand : true , @ halign : Start , "First release date" ) ,
@ orientation : Horizontal ; @ spacing : 20 ;
label ! ( @ hexpand : true ; @ halign : Start ; "First release date" ) ,
sort_icons [1] ,
) ,
) ,
) ,
) ;
label ! ("Sort") ,
) ;

View file

@ -70,10 +70,10 @@ impl CollatableFilmsContainer {
collated_grid . set_sorting (sorting) ) ;
let widget = g_box ! (
@ orientation : Vertical ,
@ orientation : Vertical ;
* film_collation_menu . get_widget () ,
scrolled_window ! (
@ propagate_natural_height : true ,
@ propagate_natural_height : true ;
vertically_filling ! ( * collated_grid . get_widget () ) ,
) ,
) ;
@ -94,10 +94,10 @@ impl CollatableSeriesContainer {
} ) ;
let widget = g_box ! (
@ orientation : Vertical ,
@ orientation : Vertical ;
* series_collation_menu . get_widget () ,
scrolled_window ! (
@ propagate_natural_height : true ,
@ propagate_natural_height : true ;
vertically_filling ! ( * collated_grid . get_widget () ) ,
) ,
) ;