 TUPLE: error-display < track ;
 
 : <error-display> ( error-list -- gadget )
-    vertical error-display new-track
-        add-toolbar
+    vertical error-display new-track with-lines
         swap error>> >>model
-        dup model>> [ [ print-error ] when* ] <pane-control> <scroller> 1 track-add ;
+        dup model>> [ [ print-error ] when* ] <pane-control>
+        margins <scroller> white-interior 1 track-add 
+        add-toolbar ;
 
 : com-inspect ( error-display -- )
     control-value [ inspector ] when* ;

} define-command-map

: <error-list-toolbar> ( error-list -- toolbar )
    [ <toolbar> ] [ error-toggle>> "Show errors:" label-on-left add-gadget ] bi ;

: <error-model> ( visible-errors model -- model' )
    [ swap '[ error-type _ at ] filter ] <smart-arrow> ;

        dup <error-table> >>error-table
        dup <error-display> >>error-display
    :> error-list
    error-list vertical <track> with-lines
        error-list <error-list-toolbar> f track-add
        error-list source-file-table>> margins <scroller> white-interior
        "Source files" source-files-color <labeled-gadget> 1/4 track-add
        error-list error-table>> margins <scroller> white-interior
        "Errors" errors-color <labeled-gadget> 1/4 track-add
        error-list error-display>>
        "Details" details-color <labeled-gadget> 1/2 track-add
        1 track-add ;

M: error-list-gadget focusable-child*
    source-file-table>> ;
