Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust cocoa 'border canvas% style to react to dark mode #309

Merged
merged 1 commit into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gui-lib/mred/private/wx/cocoa/cg.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
(define-appserv CGContextRestoreGState (_fun _CGContextRef -> _void))
(define-appserv CGContextConcatCTM (_fun _CGContextRef _CGAffineTransform -> _void))
(define-appserv CGContextSetRGBFillColor (_fun _CGContextRef _CGFloat _CGFloat _CGFloat _CGFloat -> _void))
(define-appserv CGContextSetRGBStrokeColor (_fun _CGContextRef _CGFloat _CGFloat _CGFloat _CGFloat -> _void))
(define-appserv CGContextFillRect (_fun _CGContextRef _NSRect -> _void))
(define-appserv CGContextClearRect (_fun _CGContextRef _NSRect -> _void))
(define-appserv CGContextAddRect (_fun _CGContextRef _NSRect -> _void))
Expand Down
14 changes: 11 additions & 3 deletions gui-lib/mred/private/wx/cocoa/panel.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"types.rkt"
"utils.rkt"
"cg.rkt"
"window.rkt")
"window.rkt"
"procs.rkt")

(provide
(protect-out panel%
Expand All @@ -24,11 +25,18 @@
[]
(-a #:async-apply (box (void))
_void (drawRect: [_NSRect r])
(let ([ctx (tell NSGraphicsContext currentContext)])
(let ([wob? (white-on-black-panel-scheme?)]
[ctx (tell NSGraphicsContext currentContext)])
(tellv ctx saveGraphicsState)
(let ([cg (tell #:type _CGContextRef ctx graphicsPort)]
[r (tell #:type _NSRect self bounds)])
(CGContextSetRGBFillColor cg 0 0 0 1.0)
(cond
[wob?
(CGContextSetRGBFillColor cg 0 0 0 1.0)
(CGContextSetRGBStrokeColor cg 0.8 0.8 0.8 1.0)]
[else
(CGContextSetRGBFillColor cg 1.0 1.0 1.0 1.0)
(CGContextSetRGBStrokeColor cg 0 0 0 1.0)])
(CGContextAddRect cg r)
(CGContextStrokePath cg))
(tellv ctx restoreGraphicsState))))
Expand Down