]> gitweb.factorcode.org Git - factor.git/commitdiff
ui.gadgets.icons: draw icon on top of selected background.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 19 May 2020 03:56:25 +0000 (20:56 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 19 May 2020 03:56:25 +0000 (20:56 -0700)
basis/ui/gadgets/icons/icons.factor

index a7875c042bdc2528ad77ee13cf23d504d032d0ec..5af31df55f571399694c13e526a674aadf458f53 100644 (file)
@@ -1,14 +1,16 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors kernel ui.gadgets ui.gadgets.labels ui.images
-ui.pens ui.pens.image ;
+ui.pens ui.pens.image ui.render ;
 IN: ui.gadgets.icons
 
-TUPLE: icon < gadget ;
+TUPLE: icon < gadget image ;
 
 : <icon> ( image-name -- icon )
-    icon new swap <image-pen> t >>fill? >>interior ;
+    icon new swap <image-pen> t >>fill? >>image ;
 
-M: icon pref-dim* dup interior>> pen-pref-dim ;
+M: icon draw-gadget* dup image>> [ draw-interior ] [ drop ] if* ;
+
+M: icon pref-dim* dup image>> pen-pref-dim ;
 
 M: image-name >label <icon> ;