factor/basis/ui/gadgets/status-bar/status-bar.factor

32 lines
1.0 KiB
Factor
Raw Permalink Normal View History

2008-02-21 21:57:41 -05:00
! Copyright (C) 2007, 2008 Slava Pestov.
2007-09-20 18:09:08 -04:00
! See http://factorcode.org/license.txt for BSD license.
2015-01-29 14:41:18 -05:00
USING: accessors calendar colors.constants fonts kernel models
models.arrow models.delay sequences summary ui
ui.gadgets.borders ui.gadgets.labels ui.gadgets.tracks
ui.gadgets.worlds ui.pens.solid ui.private ui.theme ;
2007-09-20 18:09:08 -04:00
IN: ui.gadgets.status-bar
: status-bar-font ( -- font )
sans-serif-font clone
status-bar-background >>background
status-bar-foreground >>foreground ;
: status-bar-theme ( label -- label )
status-bar-font >>font
status-bar-background <solid> >>interior ;
2007-09-20 18:09:08 -04:00
: <status-bar> ( model -- gadget )
2009-02-26 17:15:28 -05:00
1/10 seconds <delay> [ "" like ] <arrow> <label-control>
status-bar-theme
2008-06-18 23:30:54 -04:00
t >>root? ;
2007-09-20 18:09:08 -04:00
: open-status-window ( gadget title/attributes -- )
?attributes f <model> >>status <world>
dup status>> <status-bar>
2015-07-21 15:20:36 -04:00
{ 7 2 } <filled-border> status-bar-background <solid> >>interior
f track-add
open-world-window ;
: show-summary ( object gadget -- )
[ [ safe-summary ] [ "" ] if* ] dip show-status ;