UI completion cleanups

slava 2006-10-07 18:36:32 +00:00
parent 93c3dcf19b
commit 3a6c3b3600
5 changed files with 16 additions and 11 deletions

View File

@ -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:

View File

@ -98,7 +98,7 @@ C: browser ( -- gadget )
{
[ "" [ browser call-tool ] <word-search> ]
set-browser-search
f
[ "Word search" <labelled-gadget> ]
1/5
}
} { 0 1 } make-track* ;

View File

@ -31,7 +31,7 @@ C: help-gadget ( -- gadget )
{
[ "" [ help-gadget call-tool ] <help-search> ]
set-help-gadget-search
f
[ "Help search" <labelled-gadget> ]
1/5
}
} { 0 1 } make-track* ;

View File

@ -108,14 +108,18 @@ M: listener-gadget tool-help
: show-word-search ( listener action -- )
>r dup listener-gadget-input selected-word r>
<word-search> swap show-minibuffer ;
<word-search> "Word search" <labelled-gadget>
swap show-minibuffer ;
: show-source-files-search ( listener action -- )
"" swap <source-files-search> swap show-minibuffer ;
"" swap <source-files-search>
"Source file search" <labelled-gadget>
swap show-minibuffer ;
: show-vocabs-search ( listener action -- )
>r dup listener-gadget-input selected-word r>
<vocabs-search> swap show-minibuffer ;
<vocabs-search> "Vocabulary search" <labelled-gadget>
swap show-minibuffer ;
: show-list ( seq presenter action listener -- )
>r >r >r <model> r> r> <list> <scroller> r>

View File

@ -19,7 +19,7 @@ C: search-field ( string -- gadget )
<editor> 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. ]
<live-search> "Word search" <labelled-gadget> ;
<live-search> ;
: <help-search> ( string action -- gadget )
[ search-help ]
[ first ($link) ]
<live-search> "Help search" <labelled-gadget> ;
<live-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
[ [ <pathname> ] string-completion. ]
<live-search> "Source file search" <labelled-gadget> ;
<live-search> ;
: <vocabs-search> ( string action -- gadget )
vocabs
[ string-completions ] curry
[ [ <vocab-link> ] string-completion. ]
<live-search> "Vocabulary search" <labelled-gadget> ;
<live-search> ;