ui.gadgets.icons: draw icon on top of selected background.
parent
c37e9551ad
commit
cf5bc20b1b
|
@ -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> ;
|
||||
|
|
Loading…
Reference in New Issue