Small cleanup for ui.gadgets.labels
parent
908c06080a
commit
1c1e36621a
|
@ -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.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors arrays hashtables io kernel math namespaces
|
USING: accessors arrays hashtables io kernel math namespaces
|
||||||
make opengl sequences strings splitting ui.gadgets
|
make opengl sequences strings splitting ui.gadgets
|
||||||
|
@ -12,11 +12,7 @@ TUPLE: label < gadget text font color ;
|
||||||
text>> dup string? [ "\n" join ] unless ; inline
|
text>> dup string? [ "\n" join ] unless ; inline
|
||||||
|
|
||||||
: set-label-string ( string label -- )
|
: set-label-string ( string label -- )
|
||||||
CHAR: \n pick memq? [
|
[ CHAR: \n over memq? [ string-lines ] when ] dip (>>text) ; inline
|
||||||
[ string-lines ] dip (>>text)
|
|
||||||
] [
|
|
||||||
(>>text)
|
|
||||||
] if ; inline
|
|
||||||
|
|
||||||
: label-theme ( gadget -- gadget )
|
: label-theme ( gadget -- gadget )
|
||||||
sans-serif-font >>font
|
sans-serif-font >>font
|
||||||
|
|
Loading…
Reference in New Issue