]> gitweb.factorcode.org Git - factor.git/blob - basis/ui/gadgets/status-bar/status-bar.factor
Margins
[factor.git] / basis / ui / gadgets / status-bar / status-bar.factor
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
8
9 CONSTANT: status-bar-background COLOR: FactorDarkSlateBlue
10 CONSTANT: status-bar-foreground COLOR: white
11
12 : status-bar-font ( -- font )
13     sans-serif-font clone
14     status-bar-background >>background
15     status-bar-foreground >>foreground ;
16
17 : status-bar-theme ( label -- label )
18     status-bar-font >>font
19     status-bar-background <solid> >>interior ;
20
21 : <status-bar> ( model -- gadget )
22     1/10 seconds <delay> [ "" like ] <arrow> <label-control>
23     status-bar-theme
24     t >>root? ;
25
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 
30     { 1 1 } >>fill 
31     f track-add
32     open-world-window ;
33
34 : show-summary ( object gadget -- )
35     [ [ safe-summary ] [ "" ] if* ] dip show-status ;