]> gitweb.factorcode.org Git - factor.git/commitdiff
Tweak tables a bit
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 17 Feb 2009 14:24:55 +0000 (08:24 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 17 Feb 2009 14:24:55 +0000 (08:24 -0600)
basis/ui/gadgets/tables/tables.factor

index ee605185eca21668d861913d1943911a625f7c5f..c8c4d7c76242ef244a27e5a368044194e830425d 100644 (file)
@@ -34,14 +34,15 @@ TUPLE: table < line-gadget
 { action initial: [ drop ] }
 single-click?
 { hook initial: [ ] }
-{ gap initial: 6 }
+{ gap initial: 2 }
 column-widths total-width
 focus-border-color
 { mouse-color initial: COLOR: black }
-{ column-line-color initial: COLOR: dark-gray }
+{ column-line-color initial: T{ rgba f 0 0 0 0 } }
 selection-required?
 selected-index selected-value
 mouse-index
+{ takes-focus? initial: t }
 focused? ;
 
 : <table> ( rows renderer -- table )
@@ -263,7 +264,7 @@ M: table model-changed
     [ hand-rel second ] keep y>line ;
 
 : table-button-down ( table -- )
-    dup request-focus
+    dup takes-focus?>> [ dup request-focus ] when
     dup control-value empty? [ drop ] [
         dup [ mouse-row ] keep validate-line
         [ >>mouse-index ] [ (select-row) ] bi