More visually noticeable navigation bar

svn: r10572

original commit: d2c666f1e7ca100a73505223ffb02d338c7d7d37
This commit is contained in:
Eli Barzilay 2008-07-03 05:27:01 +00:00
parent e820ac1623
commit 995a809f7e
2 changed files with 76 additions and 69 deletions

View File

@ -196,8 +196,7 @@
" background-color: #eee; color: #888;" " background-color: #eee; color: #888;"
" border: 1px solid #ddd; text-align: center;")] " border: 1px solid #ddd; text-align: center;")]
[type "text"] [type "text"]
[value "...search..."] [value "...search manuals..."]
[size "12"]
[title "Enter a search string to search the manuals"] [title "Enter a search string to search the manuals"]
[onkeypress ,(format "return DoSearchKey(event, this, ~s);" (version))] [onkeypress ,(format "return DoSearchKey(event, this, ~s);" (version))]
[onfocus ,(sa "this.style.color=\"black\";" [onfocus ,(sa "this.style.color=\"black\";"
@ -535,9 +534,9 @@
(div ([class "maincolumn"]) (div ([class "maincolumn"])
(div ([class "main"]) (div ([class "main"])
,@(render-version d ri) ,@(render-version d ri)
,@(navigation d ri #f) ,@(navigation d ri #t)
,@(render-part d ri) ,@(render-part d ri)
,@(navigation d ri #t)))))))))) ,@(navigation d ri #f))))))))))
(define/private (part-parent d ri) (define/private (part-parent d ri)
(collected-info-parent (part-collected-info d ri))) (collected-info-parent (part-collected-info d ri)))
@ -564,7 +563,7 @@
(define/public (derive-filename d) "bad.html") (define/public (derive-filename d) "bad.html")
(define/private (navigation d ri pre-space?) (define/private (navigation d ri top?)
(define parent (part-parent d ri)) (define parent (part-parent d ri))
(define-values (prev0 next0) (find-siblings d ri)) (define-values (prev0 next0) (find-siblings d ri))
(define prev (define prev
@ -612,10 +611,12 @@
(make-with-attributes #f (make-with-attributes #f
`([title . ,(if title* (string-append label " to " title*) label)] `([title . ,(if title* (string-append label " to " title*) label)]
,@more)))) ,@more))))
(if (not (or prev next parent index up-path)) (define (navbar)
null `(div ([class "navset"]
`(,@(if pre-space? '((p nbsp)) null) [style ,(let ([v (if top? 'bottom 'top)])
(div ([class "navleft"]) (format "margin-~a: 2em; border-~a: ~a"
v v "2px solid #e0e0c0;"))])
(span ([class "navleft"])
,@(render (make-element ,@(render (make-element
(if parent (if parent
(make-target-url "index.html" #f) (make-target-url "index.html" #f)
@ -633,7 +634,7 @@
`((span ([class "smaller"]) nbsp ,(search-index-box))))) `((span ([class "smaller"]) nbsp ,(search-index-box)))))
null) null)
,@(if up-path `(nbsp ,(search-box)) null)) ,@(if up-path `(nbsp ,(search-box)) null))
(div ([class "navright"]) (span ([class "navright"])
,@(render ,@(render
(make-element (make-element
(cond [(not parent) "nonavigation"] (cond [(not parent) "nonavigation"]
@ -662,11 +663,11 @@
[else "nonavigation"]) [else "nonavigation"])
up-content) up-content)
sep-element sep-element
(make-element (if next (make-element
(titled-url "forward" next) (if next (titled-url "forward" next) "nonavigation")
"nonavigation")
next-content))) next-content)))
(p nbsp)))) nbsp)) ; needed to make the navset background visible
(if (or prev next parent index up-path) (list (navbar)) null))
(define/override (render-one d ri fn) (define/override (render-one d ri fn)
(render-one-part d ri fn null)) (render-one-part d ri fn null))

View File

@ -58,18 +58,24 @@ table td {
/* ---------------------------------------- */ /* ---------------------------------------- */
/* Navigation */ /* Navigation */
.navset {
background-color: #f0f0e0;
}
.navleft { .navleft {
margin-left: 1ex;
position: relative; position: relative;
float: left; float: left;
white-space: nowrap; white-space: nowrap;
} }
.navright { .navright {
margin-right: 1ex;
position: relative; position: relative;
float: right; float: right;
white-space: nowrap; white-space: nowrap;
} }
.nonavigation { .nonavigation {
color: #EEEEEE; color: #e0e0e0;
} }
/* ---------------------------------------- */ /* ---------------------------------------- */
@ -139,13 +145,13 @@ font-weight: bold;
.tocview { .tocview {
text-align: left; text-align: left;
background-color: #F5F5DC; background-color: #f0f0e0;
} }
.tocsub { .tocsub {
text-align: left; text-align: left;
margin-top: 0.5em; margin-top: 0.5em;
background-color: #F5F5F5; background-color: #f0f0e0;
} }
.tocviewtitle { .tocviewtitle {