Switch to using ToolbarView
This commit is contained in:
parent
7127dd57c6
commit
85b0fc2f21
2 changed files with 13 additions and 3 deletions
|
@ -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 ,
|
||||
) ,
|
||||
) ;
|
||||
|
|
|
@ -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 ,
|
||||
} ;
|
||||
|
|
Loading…
Add table
Reference in a new issue