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

View File

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