Replace custom widget macros with Relm4 view macro based ones

Also move margin styling to the CSS file.
This commit is contained in:
Reinout Meliesie 2026-01-02 13:41:27 +01:00
commit 6446d43d76
Signed by: zedfrigg
GPG key ID: 3AFCC06481308BC6
9 changed files with 299 additions and 435 deletions

View file

@ -1,7 +1,7 @@
mod collated_grid ;
mod collation_menu ;
use gtk4 :: Box ;
use gtk4 :: { Box , ScrolledWindow } ;
use gtk4 :: Orientation :: * ;
use gtk4 :: prelude :: * ;
use std :: cmp :: * ;
@ -73,14 +73,18 @@ impl < A : MediaAdapter > CollatableMediaContainer <A> {
|sorting| collated_grid . set_sorting (sorting) ,
) ;
let widget = g_box ! (
@ orientation : Vertical ;
collation_menu . get_widget () ,
& scrolled_window ! (
@ propagate_natural_height : true ;
& vertically_filling ! ( collated_grid . get_widget () ) ,
) ,
) ;
let widget = view_expr ! {
gtk4 :: Box {
set_orientation : Vertical ,
append : collation_menu . get_widget () ,
append : & view_expr ! {
ScrolledWindow {
set_propagate_natural_height : true ,
set_child : Some ( & vertical_filler ( collated_grid . get_widget () ) ) ,
}
} ,
}
} ;
Self { collated_grid, widget }
}