: nth-gadget ( n gadget -- child ) children>> nth ; inline
: <gadget> ( -- gadget )
- gadget new ;
+ gadget new ; inline
: control-value ( control -- value )
model>> value>> ;
[ drop ] [ dup invalidate layout-later ] if ;
: show-gadget ( gadget -- ) t >>visible? drop ;
-
+
: hide-gadget ( gadget -- ) f >>visible? drop ;
<PRIVATE
[ drop ] [ dupd pref-dim<< ] if
] ?if ;
-: pref-dims ( gadgets -- seq ) [ pref-dim ] map ;
+: pref-dims ( gadgets -- seq ) [ pref-dim ] map ; inline
M: gadget pref-dim* dim>> ;
label new-label ;
: >label< ( label -- font text )
- [ font>> ] [ text>> ] bi ;
+ [ font>> ] [ text>> ] bi ; inline
M: label pref-dim*
>label< text-dim ;
dup children>> pref-dims pack-pref-dim ;
: vertical-baseline ( pack -- y )
- children>> [ f ] [ first baseline ] if-empty ;
+ children>> [ f ] [ first baseline ] if-empty ; inline
: horizontal-baseline ( pack -- y )
- children>> dup pref-dims measure-metrics drop ;
+ children>> dup pref-dims measure-metrics drop ; inline
-: pack-cap-height ( pack -- n )
- children>> [ cap-height ] map ?supremum ;
+: pack-cap-height ( pack -- n/f )
+ children>> [ cap-height ] map ?supremum ; inline
PRIVATE>