Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c843108e8d | ||
![]() |
c94fa35bc5 | ||
![]() |
bcfe618463 |
|
@ -67,8 +67,26 @@
|
|||
(when (and wx (send wx callbacks-enabled?))
|
||||
(queue-window*-event wxb (lambda (wx) (send wx do-callback)))))))
|
||||
|
||||
;; The MMTabBarView widget doesn't support disabling, so we have to
|
||||
;; implement it. Also, we need to override a method to disable (for now)
|
||||
;; reordering tabs.
|
||||
(define-objc-mixin (EnableMixin Superclass)
|
||||
[wxb]
|
||||
(-a _id (hitTest: [_NSPoint pt])
|
||||
(let ([wx (->wx wxb)])
|
||||
(if (and wx
|
||||
(not (send wx is-enabled-to-root?)))
|
||||
#f
|
||||
(super-tell hitTest: #:type _NSPoint pt))))
|
||||
(-a _BOOL (shouldStartDraggingAttachedTabBarButton: b withMouseDownEvent: evt)
|
||||
#f))
|
||||
|
||||
;; A no-op mixin instead of `EnableMixin` for PSMTabBarControl:
|
||||
(define-objc-mixin (EmptyMixin Superclass)
|
||||
[wxb])
|
||||
|
||||
(define-objc-class RacketPSMTabBarControl TabBarControl
|
||||
#:mixins (FocusResponder KeyMouseResponder CursorDisplayer)
|
||||
#:mixins (FocusResponder KeyMouseResponder CursorDisplayer (if use-mm? EnableMixin EmptyMixin))
|
||||
[wxb]
|
||||
(-a _void (tabView: [_id cocoa] didSelectTabViewItem: [_id item-cocoa])
|
||||
(super-tell #:type _void tabView: cocoa didSelectTabViewItem: item-cocoa)
|
||||
|
@ -224,7 +242,8 @@
|
|||
(tellv tabv-cocoa setControlTint: #:type _int
|
||||
(if on? NSDefaultControlTint NSClearControlTint))
|
||||
(when control-cocoa
|
||||
(tellv control-cocoa setEnabled: #:type _BOOL on?))))
|
||||
(unless use-mm?
|
||||
(tellv control-cocoa setEnabled: #:type _BOOL on?)))))
|
||||
|
||||
(define/override (can-accept-focus?)
|
||||
(and (not control-cocoa)
|
||||
|
|
|
@ -9,7 +9,11 @@
|
|||
(provide (protect-out (all-defined-out)))
|
||||
|
||||
(define-runtime-lib gio-lib
|
||||
[(unix) (ffi-lib "libgio-2.0" '("0" ""))]
|
||||
[(unix) (ffi-lib "libgio-2.0" '("0" "")
|
||||
;; For old glib, libgio isn't separate;
|
||||
;; try to find bindings in already-loaded
|
||||
;; libraries:
|
||||
#:fail (lambda () #f))]
|
||||
[(macosx)
|
||||
(ffi-lib "libgio-2.0.0.dylib")]
|
||||
[(windows)
|
||||
|
|
Loading…
Reference in New Issue
Block a user