]> gitweb.factorcode.org Git - factor.git/blob - basis/ui/gadgets/status-bar/status-bar.factor
ui.theme: updates to color scheme.
[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 ui.theme ;
7 IN: ui.gadgets.status-bar
8
9 : status-bar-font ( -- font )
10     sans-serif-font clone
11     status-bar-background >>background
12     status-bar-foreground >>foreground ;
13
14 : status-bar-theme ( label -- label )
15     status-bar-font >>font
16     status-bar-background <solid> >>interior ;
17
18 : <status-bar> ( model -- gadget )
19     1/10 seconds <delay> [ "" like ] <arrow> <label-control>
20     status-bar-theme
21     t >>root? ;
22
23 : open-status-window ( gadget title/attributes -- )
24     ?attributes f <model> >>status <world>
25     dup status>> <status-bar> 
26     { 7 2 } <filled-border> status-bar-background <solid> >>interior
27     f track-add
28     open-world-window ;
29
30 : show-summary ( object gadget -- )
31     [ [ safe-summary ] [ "" ] if* ] dip show-status ;