       { f           [ content-background ] }
     } case ;
 
-TUPLE: thread-status < label thread ;
+TUPLE: thread-status < label ;
 
 M: thread-status model-changed
     [ value>> ] dip {
-        [ [ thread>> thread-status-text ] [ string<< ] bi ]
-        [ [ thread-status-color <solid> ] [ parent>> interior<< ] bi* ]
+        [ [ thread-status-text ] [ string<< ] bi* ]
+        [ [ thread-status-foreground ] [ font>> foreground<< ] bi* ]
+        [ [ thread-status-background <solid> ] [ parent>> parent>> interior<< ] bi* ]
     } 2cleave ;
 
-: <thread-status> ( model thread -- gadget )
+: <thread-status> ( model -- gadget )
     "" thread-status new-label
-        swap >>thread
         swap >>model ;
 
 : add-thread-status ( track -- track )
-    dup status>> self <thread-status> margins
-    f track-add ;
+    horizontal <track> { 5 5 } >>gap
+        "Thread:" <label>
+            dup font>> t >>bold? drop
+            f track-add
+        self name>> <label> f track-add
+        over status>> <thread-status>
+            dup font>> t >>bold? drop
+            f track-add
+    margins f track-add ;
 
 : add-traceback ( track -- track )
     dup traceback>> 1 track-add ;

M: walker-gadget focusable-child*
    traceback>> ;

: thread-status-text ( status thread -- string )
    name>> swap {
        { +stopped+ "Stopped" }
        { +suspended+ "Suspended" }
        { +running+ "Running" }
    } at "Thread: %s (%s)" sprintf ;

: thread-status-color ( status -- color )
    {
      { +stopped+   [ thread-status-stopped-background ] }
      { +suspended+ [ thread-status-suspended-background ] }

! Copyright (C) 2006, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs colors colors.constants combinators
concurrency.messaging formatting fry inspector kernel make
models models.arrow namespaces sequences threads tools.walker ui
ui.commands ui.gadgets ui.gadgets.buttons ui.gadgets.labels
ui.gadgets.status-bar ui.gadgets.theme ui.gadgets.toolbar
ui.gadgets.tracks ui.gestures ui.pens.solid ui.tools.browser
ui.tools.common ui.tools.listener ui.tools.traceback ;
IN: ui.tools.walker

TUPLE: walker-gadget < tool
