Switch to using ToolbarView

This commit is contained in:
Reinout Meliesie 2025-02-11 15:01:25 +01:00
parent 7127dd57c6
commit 85b0fc2f21
Signed by: zedfrigg
GPG key ID: 3AFCC06481308BC6
2 changed files with 13 additions and 3 deletions

View file

@ -35,9 +35,8 @@ impl UI {
let window = application_window ! (
@ application : application ;
@ title : "Zoödex" ;
& g_box ! (
@ orientation : Vertical ;
& header_bar ,
& toolbar_view ! (
@ top_bar : & header_bar ;
& switcher ,
) ,
) ;

View file

@ -197,6 +197,16 @@ macro_rules ! application_window { (
window
} } }
macro_rules ! toolbar_view { (
$ ( @ top_bar : $ top_bar : expr ; ) ?
$ ( $ content : expr ) ? $ (,) ?
) => { {
let widget = libadwaita :: ToolbarView :: new () ;
$ ( widget . add_top_bar ( $ top_bar ) ; ) ?
$ ( widget . set_content ( Some ( $ content ) ) ; ) ?
widget
} } }
macro_rules ! vertically_filling { ( $ child : expr ) => {
g_box ! (
@ orientation : gtk4 :: Orientation :: Vertical ;
@ -236,6 +246,7 @@ pub (crate) use {
header_bar ,
bin ,
application_window ,
toolbar_view ,
vertically_filling ,
pango_attributes ,
} ;