ui.gadgets.search-tables: remove slot-protocol.

... too much complexity for not enough gain, I think.
factor-shell
John Benediktsson 2017-10-25 15:41:23 -07:00
parent 35efd72f3f
commit e376724aa8
3 changed files with 4 additions and 25 deletions

View File

@ -46,26 +46,6 @@ M: search-field handle-gesture
{ [ pass-to-table ] [ call-next-method ] } 2&&
] [ call-next-method ] if ;
! A protocol with customizable slots
SLOT-PROTOCOL: table-protocol
renderer
action
hook
font
selection-color
focus-border-color
mouse-color
column-line-color
selection-required?
single-click?
selection
min-rows
min-cols
max-rows
max-cols ;
CONSULT: table-protocol search-table table>> ;
:: <search-table> ( values renderer quot -- gadget )
f <model> :> search
vertical search-table new-track

View File

@ -22,18 +22,18 @@ TUPLE: links-popup < wrapper ;
'[
@ sort-articles
[ dup article-title ] { } map>assoc
] <arrow> link-renderer [ second ] <search-table>
] <arrow> link-renderer [ second ] <search-table> dup table>>
[ invoke-primary-operation ] >>action
[ hide-glass ] >>hook
t >>selection-required?
10 >>min-rows
10 >>max-rows
30 >>min-cols
30 >>max-cols ;
30 >>max-cols drop ;
: <links-popup> ( model quot title -- gadget )
[ <links-table> white-interior ] dip
popup-color <labeled-gadget> links-popup new-wrapper ;
popup-color <framed-labeled-gadget> links-popup new-wrapper ;
links-popup H{
{ T{ key-down f f "ESC" } [ hide-glass ] }

View File

@ -41,8 +41,7 @@ M: color-renderer row-value
: <color-table> ( -- table )
named-colors { human<=> } sort-by <model>
color-renderer
[ ] <search-table>
dup table>>
[ ] <search-table> dup table>>
5 >>gap
COLOR: dark-gray >>column-line-color
10 >>min-rows