]> gitweb.factorcode.org Git - factor.git/blob - basis/ui/gadgets/icons/icons.factor
Switch to https urls
[factor.git] / basis / ui / gadgets / icons / icons.factor
1 ! Copyright (C) 2009 Slava Pestov.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: accessors kernel ui.gadgets ui.gadgets.labels ui.images
4 ui.pens ui.pens.image ui.render ;
5 IN: ui.gadgets.icons
6
7 TUPLE: icon < gadget image ;
8
9 : <icon> ( image-name -- icon )
10     icon new swap <image-pen> t >>fill? >>image ;
11
12 M: icon draw-gadget* dup image>> [ draw-interior ] [ drop ] if* ;
13
14 M: icon pref-dim* dup image>> pen-pref-dim ;
15
16 M: image-name >label <icon> ;