adjust inset so that it matches bounding box for the current

version of the file tree, and then adjust main so that it
uses a narrower font for the language names
This commit is contained in:
Robby Findler 2012-05-26 16:44:35 -05:00
parent 2f6b5962a6
commit eb63b4f9ca
2 changed files with 26 additions and 15 deletions

View File

@ -1,5 +1,7 @@
#lang scheme #lang scheme
(provide langs-pict) (provide langs-pict
langs-in-tree
langs-with-colors)
(require "draw-plain.ss" (require "draw-plain.ss"
slideshow slideshow/code slideshow slideshow/code
scheme/runtime-path) scheme/runtime-path)
@ -58,14 +60,13 @@
(text (car cl) (current-code-font) (current-font-size))))) (text (car cl) (current-code-font) (current-font-size)))))
(define (langs-pict color? #:picts [p (if (pict? color?) (list color?) (list))]) (define (langs-pict color? #:picts [p (if (pict? color?) (list color?) (list))])
(define colors (map line->color (define colors (langs-with-colors))
(append colored-langs (list (list "everything else" "#000000")))))
(define len (length colors)) (define len (length colors))
(define start (ceiling (/ len 2))) (define start (ceiling (/ len 2)))
(define-values (one two) (split-at colors start)) (define-values (one two) (split-at colors start))
(ht-append (ht-append
0 0
(inset (lang-pict 550 color?) 20 0 0 0) (langs-in-tree color?)
(apply vc-append 40 (apply vc-append 40
(ht-append 20 (ht-append 20
((if color? values ghost) ((if color? values ghost)
@ -74,4 +75,11 @@
(apply vl-append 2 two))) (apply vl-append 2 two)))
p))) p)))
(define (langs-with-colors)
(map line->color
(append colored-langs (list (list "everything else" "#000000")))))
(define (langs-in-tree color?)
(inset (lang-pict 550 color?) 14 -30 10 10))
;(slide (langs-pict #f)) (slide (langs-pict #t)) ;(slide (langs-pict #f)) (slide (langs-pict #t))

View File

@ -1,6 +1,8 @@
#lang racket/base #lang racket/base
(require "lang-slide.rkt" (require "lang-slide.rkt"
slideshow unstable/gui/slideshow) slideshow
slideshow/code
unstable/gui/slideshow)
(provide langs hudak-quote perlis-quote) (provide langs hudak-quote perlis-quote)
@ -18,15 +20,16 @@
(define (langs) (define (langs)
(define p1+p2 (vl-append 10 p1 p2)) (define p1+p2 (vl-append 10 p1 p2))
(slide/staged [#;hudak one two] (parameterize ([current-code-font 'default])
;#:title "Files in Racket" (slide/staged [#;hudak one two]
;#:layout 'tall ;#:title "Files in Racket"
(cond ;#:layout 'tall
[(eq? stage-name 'hudak) (cond
(mini-slide (vr-append 60 hudak-quote perlis-quote))] [(eq? stage-name 'hudak)
[(eq? stage-name 'one) (mini-slide (vr-append 60 hudak-quote perlis-quote))]
(langs-pict #f #:picts (list (lt-superimpose p1 (ghost p1+p2))))] [(eq? stage-name 'one)
[else (langs-pict #f #:picts (list (lt-superimpose p1 (ghost p1+p2))))]
(langs-pict p1+p2)]))) [else
(langs-pict p1+p2)]))))
(langs) (langs)