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 ! (
|
let window = application_window ! (
|
||||||
@ application : application ;
|
@ application : application ;
|
||||||
@ title : "Zoödex" ;
|
@ title : "Zoödex" ;
|
||||||
& g_box ! (
|
& toolbar_view ! (
|
||||||
@ orientation : Vertical ;
|
@ top_bar : & header_bar ;
|
||||||
& header_bar ,
|
|
||||||
& switcher ,
|
& switcher ,
|
||||||
) ,
|
) ,
|
||||||
) ;
|
) ;
|
||||||
|
|
|
@ -197,6 +197,16 @@ macro_rules ! application_window { (
|
||||||
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 ) => {
|
macro_rules ! vertically_filling { ( $ child : expr ) => {
|
||||||
g_box ! (
|
g_box ! (
|
||||||
@ orientation : gtk4 :: Orientation :: Vertical ;
|
@ orientation : gtk4 :: Orientation :: Vertical ;
|
||||||
|
@ -236,6 +246,7 @@ pub (crate) use {
|
||||||
header_bar ,
|
header_bar ,
|
||||||
bin ,
|
bin ,
|
||||||
application_window ,
|
application_window ,
|
||||||
|
toolbar_view ,
|
||||||
vertically_filling ,
|
vertically_filling ,
|
||||||
pango_attributes ,
|
pango_attributes ,
|
||||||
} ;
|
} ;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue