From 3a6c3b3600e34365efbbca04e31a9380e45c6bda Mon Sep 17 00:00:00 2001 From: slava Date: Sat, 7 Oct 2006 18:36:32 +0000 Subject: [PATCH] UI completion cleanups --- TODO.FACTOR.txt | 3 ++- library/ui/tools/browser.factor | 2 +- library/ui/tools/help.factor | 2 +- library/ui/tools/listener.factor | 10 +++++++--- library/ui/tools/search.factor | 10 +++++----- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index c29dfcbf54..ab1e3bc86e 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -13,7 +13,8 @@ - help search looks funny - menus should not require mouse to be held - tab completion: add a USE: if necessary -- reloading buttons.factor fails +- completion is not ideal: eg, search for "buttons" +- live search: timer delay would be nice + ui: diff --git a/library/ui/tools/browser.factor b/library/ui/tools/browser.factor index 0528ef2757..5568b9be45 100644 --- a/library/ui/tools/browser.factor +++ b/library/ui/tools/browser.factor @@ -98,7 +98,7 @@ C: browser ( -- gadget ) { [ "" [ browser call-tool ] ] set-browser-search - f + [ "Word search" ] 1/5 } } { 0 1 } make-track* ; diff --git a/library/ui/tools/help.factor b/library/ui/tools/help.factor index 936650b422..d7ee783473 100644 --- a/library/ui/tools/help.factor +++ b/library/ui/tools/help.factor @@ -31,7 +31,7 @@ C: help-gadget ( -- gadget ) { [ "" [ help-gadget call-tool ] ] set-help-gadget-search - f + [ "Help search" ] 1/5 } } { 0 1 } make-track* ; diff --git a/library/ui/tools/listener.factor b/library/ui/tools/listener.factor index 4a7cc763ae..3d5390f5b3 100644 --- a/library/ui/tools/listener.factor +++ b/library/ui/tools/listener.factor @@ -108,14 +108,18 @@ M: listener-gadget tool-help : show-word-search ( listener action -- ) >r dup listener-gadget-input selected-word r> - swap show-minibuffer ; + "Word search" + swap show-minibuffer ; : show-source-files-search ( listener action -- ) - "" swap swap show-minibuffer ; + "" swap + "Source file search" + swap show-minibuffer ; : show-vocabs-search ( listener action -- ) >r dup listener-gadget-input selected-word r> - swap show-minibuffer ; + "Vocabulary search" + swap show-minibuffer ; : show-list ( seq presenter action listener -- ) >r >r >r r> r> r> diff --git a/library/ui/tools/search.factor b/library/ui/tools/search.factor index e3e8fd03ef..eb81ce19b1 100644 --- a/library/ui/tools/search.factor +++ b/library/ui/tools/search.factor @@ -19,7 +19,7 @@ C: search-field ( string -- gadget ) over set-gadget-delegate dup dup set-control-self [ set-editor-text ] keep - [ select-all ] keep ; + [ editor-doc-end ] keep ; search-field H{ { T{ key-down f f "UP" } [ find-search-list select-prev ] } @@ -63,12 +63,12 @@ M: live-search focusable-child* live-search-field ; all-words [ word-completions ] curry [ word-completion. ] - "Word search" ; + ; : ( string action -- gadget ) [ search-help ] [ first ($link) ] - "Help search" ; + ; : string-completion. ( pair quot -- ) >r first2 over completion>string swap r> call write-object ; @@ -78,10 +78,10 @@ M: live-search focusable-child* live-search-field ; source-files get hash-keys natural-sort [ string-completions ] curry [ [ ] string-completion. ] - "Source file search" ; + ; : ( string action -- gadget ) vocabs [ string-completions ] curry [ [ ] string-completion. ] - "Vocabulary search" ; + ;