Compare commits

...

3 Commits
master ... v6.5

Author SHA1 Message Date
Matthew Flatt
c843108e8d OS X: disable reordering of tabs in the new tab-panel% widget
Fixes racket/drracket#52

(cherry picked from commit f0d10e9cc8)
2016-04-18 09:50:02 -06:00
Matthew Flatt
c94fa35bc5 repair to work with ancient Gtk
(cherry picked from commit 2fa9b94683)
2016-04-17 14:32:47 -06:00
Matthew Flatt
bcfe618463 fix disable of tab-panel% with 'no-border
(cherry picked from commit 6de1e4310c)
2016-04-15 22:01:28 -06:00
2 changed files with 26 additions and 3 deletions

View File

@ -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)

View File

@ -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)