Introduce application_window UI macro

This commit is contained in:
Reinout Meliesie 2025-01-31 18:11:06 +01:00
commit 0ae516e898
Signed by: zedfrigg
GPG key ID: 3AFCC06481308BC6
2 changed files with 23 additions and 20 deletions

View file

@ -124,6 +124,19 @@ macro_rules ! bin { ( $ ( @ vexpand : $ vexpand : expr ) ? $ (,) ? ) => { {
widget
} } }
macro_rules ! application_window { (
@ application : $ application : expr ,
@ title : $ title : expr ,
$ content : expr $ (,) ?
) => { {
use libadwaita :: prelude :: * ;
let window = libadwaita :: ApplicationWindow :: new ( $ application ) ;
window . set_title ( Some ( $ title ) ) ;
window . set_content ( Some ( & $ content ) ) ;
window
} } }
macro_rules ! vertically_filling { ( $ child : expr ) => {
g_box ! (
@ orientation : gtk4 :: Orientation :: Vertical ,
@ -147,5 +160,6 @@ pub (crate) use {
view_switcher ,
header_bar ,
bin ,
application_window ,
vertically_filling ,
} ;