Tweak tables a bit
parent
0bbe79d386
commit
e37c89a434
|
@ -34,14 +34,15 @@ TUPLE: table < line-gadget
|
||||||
{ action initial: [ drop ] }
|
{ action initial: [ drop ] }
|
||||||
single-click?
|
single-click?
|
||||||
{ hook initial: [ ] }
|
{ hook initial: [ ] }
|
||||||
{ gap initial: 6 }
|
{ gap initial: 2 }
|
||||||
column-widths total-width
|
column-widths total-width
|
||||||
focus-border-color
|
focus-border-color
|
||||||
{ mouse-color initial: COLOR: black }
|
{ 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?
|
selection-required?
|
||||||
selected-index selected-value
|
selected-index selected-value
|
||||||
mouse-index
|
mouse-index
|
||||||
|
{ takes-focus? initial: t }
|
||||||
focused? ;
|
focused? ;
|
||||||
|
|
||||||
: <table> ( rows renderer -- table )
|
: <table> ( rows renderer -- table )
|
||||||
|
@ -263,7 +264,7 @@ M: table model-changed
|
||||||
[ hand-rel second ] keep y>line ;
|
[ hand-rel second ] keep y>line ;
|
||||||
|
|
||||||
: table-button-down ( table -- )
|
: table-button-down ( table -- )
|
||||||
dup request-focus
|
dup takes-focus?>> [ dup request-focus ] when
|
||||||
dup control-value empty? [ drop ] [
|
dup control-value empty? [ drop ] [
|
||||||
dup [ mouse-row ] keep validate-line
|
dup [ mouse-row ] keep validate-line
|
||||||
[ >>mouse-index ] [ (select-row) ] bi
|
[ >>mouse-index ] [ (select-row) ] bi
|
||||||
|
|
Loading…
Reference in New Issue