From e376724aa8b408766a9f714d825aabf224168ad0 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Wed, 25 Oct 2017 15:41:23 -0700 Subject: [PATCH] ui.gadgets.search-tables: remove slot-protocol. ... too much complexity for not enough gain, I think. --- .../search-tables/search-tables.factor | 20 ------------------- basis/ui/tools/browser/popups/popups.factor | 6 +++--- extra/color-table/color-table.factor | 3 +-- 3 files changed, 4 insertions(+), 25 deletions(-) diff --git a/basis/ui/gadgets/search-tables/search-tables.factor b/basis/ui/gadgets/search-tables/search-tables.factor index 8aaa65580f..9337eb1825 100644 --- a/basis/ui/gadgets/search-tables/search-tables.factor +++ b/basis/ui/gadgets/search-tables/search-tables.factor @@ -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>> ; - :: ( values renderer quot -- gadget ) f :> search vertical search-table new-track diff --git a/basis/ui/tools/browser/popups/popups.factor b/basis/ui/tools/browser/popups/popups.factor index 401b8d2925..8108448b73 100644 --- a/basis/ui/tools/browser/popups/popups.factor +++ b/basis/ui/tools/browser/popups/popups.factor @@ -22,18 +22,18 @@ TUPLE: links-popup < wrapper ; '[ @ sort-articles [ dup article-title ] { } map>assoc - ] link-renderer [ second ] + ] link-renderer [ second ] 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 ; : ( model quot title -- gadget ) [ white-interior ] dip - popup-color links-popup new-wrapper ; + popup-color links-popup new-wrapper ; links-popup H{ { T{ key-down f f "ESC" } [ hide-glass ] } diff --git a/extra/color-table/color-table.factor b/extra/color-table/color-table.factor index be6be6b3bc..b096ff8835 100644 --- a/extra/color-table/color-table.factor +++ b/extra/color-table/color-table.factor @@ -41,8 +41,7 @@ M: color-renderer row-value : ( -- table ) named-colors { human<=> } sort-by color-renderer - [ ] - dup table>> + [ ] dup table>> 5 >>gap COLOR: dark-gray >>column-line-color 10 >>min-rows