@@ -118,7 +118,7 @@ open class KeyboardShortcutView: NSControl, NSSecureCoding, NSAccessibilityButto
118
118
119
119
120
120
/// Eh, why not. It's good practice.
121
- open static var supportsSecureCoding : Bool {
121
+ public static var supportsSecureCoding : Bool {
122
122
return true
123
123
}
124
124
@@ -146,13 +146,13 @@ open class KeyboardShortcutView: NSControl, NSSecureCoding, NSAccessibilityButto
146
146
/// text color of the currently-recording shortcut.
147
147
///
148
148
/// Note: by using a dynamic color, it will always match the current NSAppearance.
149
- @objc open var tintColor : NSColor = . keyboardFocusIndicatorColor {
149
+ @objc dynamic open var tintColor : NSColor = . keyboardFocusIndicatorColor {
150
150
didSet { self . needsDisplay = true }
151
151
}
152
152
153
153
/// The string to display to the user when no shortcut is displayed by, or
154
154
/// being recorded by the control.
155
- @objc open var placeholderString : String ? {
155
+ @objc dynamic open var placeholderString : String ? {
156
156
get { return self . textLabel. placeholderAttributedString? . string }
157
157
set {
158
158
let style = NSMutableParagraphStyle ( )
@@ -204,7 +204,7 @@ open class KeyboardShortcutView: NSControl, NSSecureCoding, NSAccessibilityButto
204
204
}
205
205
206
206
/// Returns `true` if the control is currently recording a new shortcut.
207
- @objc open private( set) var isRecording = false {
207
+ @objc dynamic open private( set) var isRecording = false {
208
208
willSet { self . willChangeValue ( forKey: #function) }
209
209
didSet { self . didChangeValue ( forKey: #function) }
210
210
}
@@ -245,7 +245,7 @@ open class KeyboardShortcutView: NSControl, NSSecureCoding, NSAccessibilityButto
245
245
246
246
/// Determines whether the control is capable of modifying its shortcut or
247
247
/// recording a new shortcut.
248
- @objc open override var isEnabled : Bool {
248
+ @objc dynamic open override var isEnabled : Bool {
249
249
didSet {
250
250
if !self . isEnabled { self . endRecording ( ) }
251
251
self . needsDisplay = true
@@ -720,7 +720,7 @@ open class KeyboardShortcutView: NSControl, NSSecureCoding, NSAccessibilityButto
720
720
721
721
/// The trailing record/stop button was pressed: start recording if we're
722
722
/// not already doing so, and if we are, clear the shortcut and end recording.
723
- @objc private func buttonAction( _ button: NSButton ) {
723
+ @objc dynamic private func buttonAction( _ button: NSButton ) {
724
724
if !self . isRecording && self . shortcut == nil { // cleared state
725
725
self . window? . makeFirstResponder ( self )
726
726
_ = self . beginRecording ( )
@@ -740,7 +740,7 @@ open class KeyboardShortcutView: NSControl, NSSecureCoding, NSAccessibilityButto
740
740
741
741
/// A `suggestions` shortcut was selected: circumvent recording and directly set.
742
742
/// Note that a suggestion may be selected without the control being recording.
743
- @objc private func selectAction( _ item: NSMenuItem ) {
743
+ @objc dynamic private func selectAction( _ item: NSMenuItem ) {
744
744
guard self . isEnabled else { return }
745
745
self . endRecording ( )
746
746
self . shortcut = self . suggestions [ item. tag]
@@ -784,7 +784,7 @@ open class KeyboardShortcutView: NSControl, NSSecureCoding, NSAccessibilityButto
784
784
/// responder and discard any recording shortcut.
785
785
///
786
786
/// Note: Unbalanced global mode changes can dramatically impact system usability!
787
- @objc private func windowKeyednessChanged( _ note: Notification ) {
787
+ @objc dynamic private func windowKeyednessChanged( _ note: Notification ) {
788
788
guard let window = self . window, ( note. object as? NSWindow ) == window else { return }
789
789
if window. isKeyWindow && window. firstResponder == self { // becomeKey
790
790
guard self . savedOperatingMode == nil else { return }
0 commit comments