diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 2a1a0fe..df77430 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -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 , ) , ) ; diff --git a/src/ui/utility.rs b/src/ui/utility.rs index df0f42f..a696aec 100644 --- a/src/ui/utility.rs +++ b/src/ui/utility.rs @@ -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 , } ;