From d2d0404af38c3a018548e7ab455c7612c6df6e59 Mon Sep 17 00:00:00 2001 From: slava Date: Mon, 12 Jun 2006 07:21:08 +0000 Subject: [PATCH] Minor UI improvements --- TODO.FACTOR.txt | 10 +++++++--- doc/handbook/handbook.facts | 22 ++++++++++++++++++++-- library/help/crossref.factor | 6 ------ library/help/markup.factor | 6 ++++++ library/ui/cocoa/menu-bar.factor | 6 ------ library/ui/gadgets/scrolling.factor | 7 ++++--- library/ui/tools/launchpad.factor | 25 +------------------------ library/ui/tools/search.factor | 4 +--- 8 files changed, 39 insertions(+), 47 deletions(-) diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index 82272f9fc7..d5ccf869b6 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -1,5 +1,4 @@ - UI word wrap problem -- UI focus problem after restoring - unix i/o: problems with passing f to syscalls - if a primitive throws an error, :c doesn't show the call frame there @@ -51,10 +50,15 @@ + help: - automatically update help graph when adding/removing articles/words +- help search: + - edit distance algorithm + - store positions in index + - phrase scoring algorithm based on how close the terms occur? + ui: -- initial track size is still wrong +- word wrap in UI broken again +- table line styles - x11 input methods - roundoff is still not quite right with tracks - new browser: @@ -73,7 +77,7 @@ - use display lists - reimplement tab completion - cocoa: - - horizontal scrolling + - horizontal wheel scrolling - polish OS X menu bar code - dock menu - variable width word wrap diff --git a/doc/handbook/handbook.facts b/doc/handbook/handbook.facts index d1cf0a59d8..9851429146 100644 --- a/doc/handbook/handbook.facts +++ b/doc/handbook/handbook.facts @@ -1,4 +1,5 @@ -USING: help inspector parser prettyprint ; +USING: generic hashtables help inspector namespaces parser +prettyprint sequences words ; ARTICLE: "handbook" "Factor documentation" { $subsection "changes" } @@ -28,4 +29,21 @@ ARTICLE: "handbook" "Factor documentation" { $subsection "streams" } { $subsection "parser" } { $subsection "prettyprint" } -{ $subsection "alien" } ; +{ $subsection "alien" } +{ $heading "Index" } +{ $subsection "article-index" } +{ $subsection "primitive-index" } +{ $subsection "type-index" } +{ $subsection "class-index" } ; + +ARTICLE: "article-index" "Article index" +{ $outliner [ articles get hash-keys ] } ; + +ARTICLE: "primitive-index" "Primitive index" +{ $outliner [ all-words [ primitive? ] subset ] } ; + +ARTICLE: "type-index" "Type index" +{ $outliner [ builtins get [ ] subset ] } ; + +ARTICLE: "class-index" "Class index" +{ $outliner [ classes get [ ] subset ] } ; diff --git a/library/help/crossref.factor b/library/help/crossref.factor index 2ae0476cf2..d10ffb9dbb 100644 --- a/library/help/crossref.factor +++ b/library/help/crossref.factor @@ -53,11 +53,5 @@ SYMBOL: help-graph : xref-articles ( -- ) all-articles [ links-out ] help-graph get build-graph ; -: help-outliner ( seq quot -- | quot: obj -- ) - swap sort-articles [ ($subsection) terpri ] each-with ; - -: articles. ( -- ) - articles get hash-keys [ help ] help-outliner ; - : links-in. ( article -- ) links-in [ links-in. ] help-outliner ; diff --git a/library/help/markup.factor b/library/help/markup.factor index 2200476ef9..20e5ad77c4 100644 --- a/library/help/markup.factor +++ b/library/help/markup.factor @@ -204,3 +204,9 @@ M: link summary : $io-error drop "Throws an error if the I/O operation fails." $errors ; + +: help-outliner ( seq quot -- | quot: obj -- ) + swap sort-articles [ ($subsection) terpri ] each-with ; + +: $outliner ( content -- ) + first call natural-sort [ help ] help-outliner ; diff --git a/library/ui/cocoa/menu-bar.factor b/library/ui/cocoa/menu-bar.factor index a7077ca392..5b9603dcb6 100644 --- a/library/ui/cocoa/menu-bar.factor +++ b/library/ui/cocoa/menu-bar.factor @@ -115,7 +115,6 @@ DEFER: described-menu { } { "Run..." menu-run-file "o" } { } - { "Apropos" apropos-window "r" } { "Globals" globals-window "" } { "Memory" memory-window "" } { } @@ -145,10 +144,5 @@ DEFER: described-menu { { "Help" { "Factor Documentation" handbook-window "?" } - { } - { "Help Index" articles-window "" } - { "Types" types-window "" } - { "Classes" classes-window "" } - { "Primitives" primitives-window "" } } } } described-menu set-main-menu ; diff --git a/library/ui/gadgets/scrolling.factor b/library/ui/gadgets/scrolling.factor index e4b244cd70..af0258475e 100644 --- a/library/ui/gadgets/scrolling.factor +++ b/library/ui/gadgets/scrolling.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2005, 2006 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. IN: gadgets-scrolling -USING: arrays gadgets gadgets-frames gadgets-viewports generic -kernel math namespaces sequences ; +USING: arrays gadgets gadgets-frames gadgets-theme +gadgets-viewports generic kernel math namespaces sequences ; ! A scroller combines a viewport with two x and y sliders. ! The follows slot is set by scroll-to. @@ -39,7 +39,8 @@ C: scroller ( gadget -- scroller ) { [ ] set-scroller-x @bottom } { [ ] set-scroller-y @right } } make-frame* - t over set-gadget-root? ; + t over set-gadget-root? + dup faint-boundary ; : set-slider ( value page max slider -- ) #! page/max/value are 3-vectors. diff --git a/library/ui/tools/launchpad.factor b/library/ui/tools/launchpad.factor index 173af32a8d..1e1b091604 100644 --- a/library/ui/tools/launchpad.factor +++ b/library/ui/tools/launchpad.factor @@ -21,38 +21,15 @@ prettyprint sequences words ; : memory-window ( -- ) [ heap-stats. terpri room. ] "Memory" pane-window ; -: articles-window ( -- ) - [ articles. ] "Help index" pane-window ; - -: types-window ( -- ) - [ builtins get [ ] subset [ help ] word-outliner ] - "Types" pane-window ; - -: classes-window ( -- ) - [ classes [ help ] word-outliner ] - "Classes" pane-window ; - -: primitives-window ( -- ) - [ all-words [ primitive? ] subset [ help ] word-outliner ] - "Primitives" pane-window ; - -: apropos-window ( -- ) - [ apropos ] open-window ; - : globals-window ( -- ) global show ; : default-launchpad { { "Listener" [ listener-window ] } + { "Browser" [ browser-window ] } { "Documentation" [ handbook-window ] } - { "Help index" [ articles-window ] } - { "Browser" [ f browser-window ] } - { "Apropos" [ apropos-window ] } { "Globals" [ globals-window ] } - { "Types" [ types-window ] } - { "Classes" [ classes-window ] } - { "Primitives" [ primitives-window ] } { "Memory" [ memory-window ] } { "Save image" [ save ] } { "Exit" [ 0 exit ] } diff --git a/library/ui/tools/search.factor b/library/ui/tools/search.factor index bd6341e4c6..68db88fe04 100644 --- a/library/ui/tools/search.factor +++ b/library/ui/tools/search.factor @@ -25,10 +25,8 @@ M: search-gadget gadget-gestures C: search-gadget ( quot -- ) [ set-search-gadget-quot ] keep { - { [ dup faint-boundary ] set-search-gadget-scroller @center } + { [ ] set-search-gadget-scroller @center } { [ "" ] set-search-gadget-input @top } } make-frame* ; -M: search-gadget pref-dim* drop { 350 200 0 } ; - M: search-gadget focusable-child* search-gadget-input ;