From e19ce1d98fdc1408ed17d674b13e6cd6b1e6f645 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Wed, 5 Jan 2011 20:37:55 -0600 Subject: [PATCH] use new syntax colorer hooks to provide feedback about syntax coloring in the definitions window in drracket original commit: 33cb5a8b6fc06c560cd4cb9a41d2e7ab3c0e44c0 --- collects/framework/private/frame.rkt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/collects/framework/private/frame.rkt b/collects/framework/private/frame.rkt index d343afb4..3bdf85e4 100644 --- a/collects/framework/private/frame.rkt +++ b/collects/framework/private/frame.rkt @@ -2445,6 +2445,7 @@ (define/override (get-editor%) (text:searching-mixin (super get-editor%))) (super-new))) +;; code copied to drracket/private/unit.rkt (define checkout-or-nightly? (or (with-handlers ([exn:fail:filesystem? (λ (x) #f)]) (directory-exists? (collection-path "repo-time-stamp"))) @@ -2473,8 +2474,10 @@ (define/override (on-paint) (cond [on? + (define dc (get-dc)) + (send dc set-font small-control-font) (let-values ([(cw ch) (get-client-size)]) - (send (get-dc) draw-text indicator + (send dc draw-text indicator (- (/ cw 2) (/ indicator-width 2)) (- (/ ch 2) (/ indicator-height 2))))])) (define/public (set-on? new-on?) @@ -2487,9 +2490,8 @@ (super-new [stretchable-width #f] [style '(transparent)]) - (send (get-dc) set-font small-control-font) (define-values (indicator-width indicator-height) - (let-values ([(tw th _1 _2) (send (get-dc) get-text-extent indicator)]) + (let-values ([(tw th _1 _2) (send (get-dc) get-text-extent indicator small-control-font)]) (values tw th))) (min-width (+ (inexact->exact (ceiling indicator-width)) 4))))