ui.gadgets.icons: draw icon on top of selected background.

master
John Benediktsson 2020-05-18 20:56:25 -07:00
parent c37e9551ad
commit cf5bc20b1b
1 changed files with 6 additions and 4 deletions

View 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> ;