ui.gadgets.search-tables: remove slot-protocol.
... too much complexity for not enough gain, I think.factor-shell
parent
35efd72f3f
commit
e376724aa8
|
@ -46,26 +46,6 @@ M: search-field handle-gesture
|
||||||
{ [ pass-to-table ] [ call-next-method ] } 2&&
|
{ [ pass-to-table ] [ call-next-method ] } 2&&
|
||||||
] [ call-next-method ] if ;
|
] [ 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 )
|
:: <search-table> ( values renderer quot -- gadget )
|
||||||
f <model> :> search
|
f <model> :> search
|
||||||
vertical search-table new-track
|
vertical search-table new-track
|
||||||
|
|
|
@ -22,18 +22,18 @@ TUPLE: links-popup < wrapper ;
|
||||||
'[
|
'[
|
||||||
@ sort-articles
|
@ sort-articles
|
||||||
[ dup article-title ] { } map>assoc
|
[ dup article-title ] { } map>assoc
|
||||||
] <arrow> link-renderer [ second ] <search-table>
|
] <arrow> link-renderer [ second ] <search-table> dup table>>
|
||||||
[ invoke-primary-operation ] >>action
|
[ invoke-primary-operation ] >>action
|
||||||
[ hide-glass ] >>hook
|
[ hide-glass ] >>hook
|
||||||
t >>selection-required?
|
t >>selection-required?
|
||||||
10 >>min-rows
|
10 >>min-rows
|
||||||
10 >>max-rows
|
10 >>max-rows
|
||||||
30 >>min-cols
|
30 >>min-cols
|
||||||
30 >>max-cols ;
|
30 >>max-cols drop ;
|
||||||
|
|
||||||
: <links-popup> ( model quot title -- gadget )
|
: <links-popup> ( model quot title -- gadget )
|
||||||
[ <links-table> white-interior ] dip
|
[ <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{
|
links-popup H{
|
||||||
{ T{ key-down f f "ESC" } [ hide-glass ] }
|
{ T{ key-down f f "ESC" } [ hide-glass ] }
|
||||||
|
|
|
@ -41,8 +41,7 @@ M: color-renderer row-value
|
||||||
: <color-table> ( -- table )
|
: <color-table> ( -- table )
|
||||||
named-colors { human<=> } sort-by <model>
|
named-colors { human<=> } sort-by <model>
|
||||||
color-renderer
|
color-renderer
|
||||||
[ ] <search-table>
|
[ ] <search-table> dup table>>
|
||||||
dup table>>
|
|
||||||
5 >>gap
|
5 >>gap
|
||||||
COLOR: dark-gray >>column-line-color
|
COLOR: dark-gray >>column-line-color
|
||||||
10 >>min-rows
|
10 >>min-rows
|
||||||
|
|
Loading…
Reference in New Issue