File tree Expand file tree Collapse file tree 6 files changed +34
-17
lines changed
Expand file tree Collapse file tree 6 files changed +34
-17
lines changed Original file line number Diff line number Diff line change 1111 "mrwindow.rkt "
1212 "mrcontainer.rkt "
1313 "wxtabcanvas.rkt "
14- "gdi.rkt " )
14+ "gdi.rkt "
15+ (only-in "wx/platform.rkt " tab-panel-available?))
1516
1617(provide pane%
1718 vertical-pane%
320321 [get-orientation (λ () (send (mred->wx this ) get-orientation))])))
321322
322323(define list-append append)
323- (define always-use-tab-canvas? (and (getenv "PLT_FLAT_PORTABLE_TAB_PANEL " ) #t ))
324+ (define always-use-tab-canvas? (or (and (getenv "PLT_FLAT_PORTABLE_TAB_PANEL " ) #t )
325+ (not (tab-panel-available?))))
324326
325327(define tab-panel%
326328 (class vertical-panel%
Original file line number Diff line number Diff line change 9696 key-symbol-to-menu-key
9797 needs-grow-box-spacer?
9898 graphical-system-type
99- white-on-black-panel-scheme?))
99+ white-on-black-panel-scheme?
100+ tab-panel-available?))
Original file line number Diff line number Diff line change 1515 (for-syntax racket/base))
1616
1717(provide
18- (protect-out tab-panel%))
18+ (protect-out tab-panel%
19+ tab-panel-available?))
1920
2021(define-runtime-path psm-tab-bar-dir
2122 '(so "PSMTabBarControl.framework " ))
2930 (directory-exists? mm-tab-bar-dir)))
3031
3132;; Load MMTabBarView or PSMTabBarControl:
32- (if use-mm?
33- (void (ffi-lib (build-path mm-tab-bar-dir "MMTabBarView " )))
34- (void (ffi-lib (build-path psm-tab-bar-dir "PSMTabBarControl " ))))
33+ (define tab-ok?
34+ (if use-mm?
35+ (and (ffi-lib (build-path mm-tab-bar-dir "MMTabBarView " ) #:fail (lambda () #f ))
36+ 'mm )
37+ (and (ffi-lib (build-path psm-tab-bar-dir "PSMTabBarControl " ) #:fail (lambda () #f ))
38+ 'psm )))
39+ (define (tab-panel-available?) tab-ok?)
40+
3541(define NSNoTabsNoBorder 6 )
3642
3743(define NSDefaultControlTint 0 )
3844(define NSClearControlTint 7 )
3945
4046(import-class NSView NSTabView NSTabViewItem)
4147(define TabBarControl
42- (if use-mm?
43- (let ()
44- (import-class MMTabBarView)
45- MMTabBarView)
46- (let ()
47- (import-class PSMTabBarControl)
48- PSMTabBarControl)))
48+ (cond
49+ [(not tab-ok?) #f ]
50+ [use-mm?
51+ (import-class MMTabBarView)
52+ MMTabBarView]
53+ [else
54+ (import-class PSMTabBarControl)
55+ PSMTabBarControl]))
4956(import-protocol NSTabViewDelegate)
5057
5158(define NSOrderedAscending -1 )
Original file line number Diff line number Diff line change 6565 get-color-from-user
6666 key-symbol-to-menu-key
6767 needs-grow-box-spacer?
68- graphical-system-type)
68+ graphical-system-type
69+ tab-panel-available?)
6970
7071(define (find-graphical-system-path what)
7172 (case what
200201 ;; in that case we want to return #f.
201202 (< (luminance (get-label-background-color))
202203 (luminance (get-label-foreground-color))))
204+
205+ (define (tab-panel-available?) #t )
Original file line number Diff line number Diff line change 8686 key-symbol-to-menu-key
8787 needs-grow-box-spacer?
8888 graphical-system-type
89- white-on-black-panel-scheme?)
89+ white-on-black-panel-scheme?
90+ tab-panel-available?)
9091 ((dynamic-require platform-lib 'platform-values )))
Original file line number Diff line number Diff line change 9999 key-symbol-to-menu-key
100100 needs-grow-box-spacer?
101101 graphical-system-type
102- white-on-black-panel-scheme?))
102+ white-on-black-panel-scheme?
103+ tab-panel-available?))
103104
104105(define (white-on-black-panel-scheme?)
105106 ;; if the background and foreground are the same
106107 ;; color, probably something has gone wrong;
107108 ;; in that case we want to return #f.
108109 (< (luminance (get-label-background-color))
109110 (luminance (get-label-foreground-color))))
111+
112+ (define (tab-panel-available?) #t )
You can’t perform that action at this time.
0 commit comments