Introduce application_window UI macro
This commit is contained in:
parent
eb10495670
commit
0ae516e898
2 changed files with 23 additions and 20 deletions
|
|
@ -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 ,
|
||||
} ;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue