adjust weekend logo setting code so that it works on non-mac os x platforms
This commit is contained in:
parent
f210692a20
commit
031b7b18be
|
@ -9,14 +9,13 @@
|
|||
NSImageView)
|
||||
|
||||
(define (set-dock-tile-bitmap bm)
|
||||
(when (eq? (system-type) 'macosx)
|
||||
(unless old-cocoa?
|
||||
(define dock-tile (tell (tell NSApplication sharedApplication) dockTile))
|
||||
(start-atomic)
|
||||
(define view (tell (tell NSImageView alloc) init))
|
||||
(tellv view setImage: (bitmap->image bm))
|
||||
|
||||
(tellv dock-tile setContentView: view)
|
||||
(tellv dock-tile display)
|
||||
(tellv view release)
|
||||
(end-atomic))))
|
||||
(unless old-cocoa?
|
||||
(define dock-tile (tell (tell NSApplication sharedApplication) dockTile))
|
||||
(start-atomic)
|
||||
(define view (tell (tell NSImageView alloc) init))
|
||||
(tellv view setImage: (bitmap->image bm))
|
||||
|
||||
(tellv dock-tile setContentView: view)
|
||||
(tellv dock-tile display)
|
||||
(tellv view release)
|
||||
(end-atomic)))
|
||||
|
|
|
@ -6,11 +6,13 @@
|
|||
racket/list
|
||||
framework/private/bday
|
||||
framework/splash
|
||||
racket/runtime-path
|
||||
racket/file
|
||||
"dock-icon.rkt"
|
||||
"frame-icon.rkt"
|
||||
"eb.rkt")
|
||||
|
||||
(define-runtime-path doc-icon.rkt "dock-icon.rkt")
|
||||
|
||||
(define files-to-open (command-line #:args filenames filenames))
|
||||
|
||||
;; updates the command-line-arguments with only the files
|
||||
|
@ -95,6 +97,8 @@
|
|||
|
||||
(when (eb-bday?) (install-eb))
|
||||
|
||||
(define weekend-bitmap-spec (collection-file-path "plt-logo-red-shiny.png" "icons"))
|
||||
|
||||
(define normal-bitmap-spec
|
||||
(cond
|
||||
[(and valentines-day? high-color?)
|
||||
|
@ -110,7 +114,7 @@
|
|||
[(and halloween? high-color?)
|
||||
(collection-file-path "PLT-pumpkin.png" "icons")]
|
||||
[(and high-color? weekend?)
|
||||
(collection-file-path "plt-logo-red-shiny.png" "icons")]
|
||||
weekend-bitmap-spec]
|
||||
[high-color?
|
||||
(collection-file-path "plt-logo-red-diffuse.png" "icons")]
|
||||
[(= (get-display-depth) 1)
|
||||
|
@ -119,8 +123,10 @@
|
|||
(collection-file-path "plt-flat.gif" "icons")]))
|
||||
(define normal-bitmap (read-bitmap normal-bitmap-spec))
|
||||
(set-splash-char-observer drracket-splash-char-observer)
|
||||
(when (and high-color? weekend?)
|
||||
(set-dock-tile-bitmap normal-bitmap))
|
||||
(when (eq? (system-type) 'macosx)
|
||||
(when (equal? normal-bitmap-spec weekend-bitmap-spec)
|
||||
(define set-doc-tile-bitmap (dynamic-require doc-icon.rkt 'set-dock-tile-bitmap))
|
||||
(set-doc-tile-bitmap normal-bitmap)))
|
||||
(start-splash normal-bitmap
|
||||
"DrRacket"
|
||||
700
|
||||
|
|
Loading…
Reference in New Issue
Block a user