Small cleanup for ui.gadgets.labels

db4
Slava Pestov 2009-01-11 19:40:17 -06:00
parent 908c06080a
commit 1c1e36621a
1 changed files with 2 additions and 6 deletions

View File

@ -1,4 +1,4 @@
! Copyright (C) 2005, 2008 Slava Pestov.
! Copyright (C) 2005, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays hashtables io kernel math namespaces
make opengl sequences strings splitting ui.gadgets
@ -12,11 +12,7 @@ TUPLE: label < gadget text font color ;
text>> dup string? [ "\n" join ] unless ; inline
: set-label-string ( string label -- )
CHAR: \n pick memq? [
[ string-lines ] dip (>>text)
] [
(>>text)
] if ; inline
[ CHAR: \n over memq? [ string-lines ] when ] dip (>>text) ; inline
: label-theme ( gadget -- gadget )
sans-serif-font >>font