1 ! Copyright (C) 2007, 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors calendar colors.constants fonts kernel models
4 models.arrow models.delay sequences summary ui
5 ui.gadgets.borders ui.gadgets.labels ui.gadgets.tracks
6 ui.gadgets.worlds ui.pens.solid ui.private ;
7 IN: ui.gadgets.status-bar
9 CONSTANT: status-bar-background COLOR: FactorDarkSlateBlue
10 CONSTANT: status-bar-foreground COLOR: white
12 : status-bar-font ( -- font )
14 status-bar-background >>background
15 status-bar-foreground >>foreground ;
17 : status-bar-theme ( label -- label )
18 status-bar-font >>font
19 status-bar-background <solid> >>interior ;
21 : <status-bar> ( model -- gadget )
22 1/10 seconds <delay> [ "" like ] <arrow> <label-control>
26 : open-status-window ( gadget title/attributes -- )
27 ?attributes f <model> >>status <world>
28 dup status>> <status-bar>
29 { 7 2 } <border> COLOR: FactorDarkSlateBlue <solid> >>interior
34 : show-summary ( object gadget -- )
35 [ [ safe-summary ] [ "" ] if* ] dip show-status ;