Use label UI macro in collection item rendering
This commit is contained in:
parent
38adb5f4b9
commit
cd45d4303b
2 changed files with 30 additions and 28 deletions
|
|
@ -1,16 +1,24 @@
|
|||
macro_rules ! label { (
|
||||
$ ( @ hexpand : $ hexpand : expr ;) ?
|
||||
$ ( @ hexpand : $ hexpand : expr ; ) ?
|
||||
$ ( @ vexpand : $ vexpand : expr ; ) ?
|
||||
$ ( @ halign : $ halign : expr ; ) ?
|
||||
$ ( @ valign : $ valign : expr ; ) ?
|
||||
$ label : expr $ (,) ?
|
||||
$ ( @ justify : $ justify : expr ; ) ?
|
||||
$ ( @ wrap : $ wrap : expr ; ) ?
|
||||
$ ( @ max_width_chars : $ max_width_chars : expr ; ) ?
|
||||
$ ( @ attributes : $ attributes : expr ; ) ?
|
||||
$ ( $ label : expr ) ? $ (,) ?
|
||||
) => { {
|
||||
let label = gtk4 :: Label :: builder () . build () ;
|
||||
$ ( label . set_hexpand ( $ hexpand ) ; ) ?
|
||||
$ ( label . set_vexpand ( $ vexpand ) ; ) ?
|
||||
$ ( label . set_halign ( $ halign ) ; ) ?
|
||||
$ ( label . set_valign ( $ valign ) ; ) ?
|
||||
label . set_label ( $ label ) ;
|
||||
$ ( label . set_label ( $ label ) ; ) ?
|
||||
$ ( label . set_justify ( $ justify ) ; ) ?
|
||||
$ ( label . set_max_width_chars ( $ max_width_chars ) ; ) ?
|
||||
$ ( label . set_attributes ( Some ( $ attributes ) ) ; ) ?
|
||||
$ ( label . set_wrap ( $ wrap ) ; ) ?
|
||||
label
|
||||
} } }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue