mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Hide insertion point in shortcut key field
This commit is contained in:
parent
addd5be598
commit
a5f7ded0da
@ -8,8 +8,9 @@ unreleased
|
||||
### Improvements
|
||||
|
||||
- Display an open dialog on launch if so set even when iCloud storage is disabled.
|
||||
- Improve stability on text encoding change
|
||||
- Improve stability on text encoding change.
|
||||
- Refine dialog messages on text encoding change.
|
||||
- [trivial] Hide insertion point in shortcut input fields in Key Binding pane.
|
||||
|
||||
|
||||
### Fixes
|
||||
|
@ -44,6 +44,9 @@ final class ShortcutKeyField: NSTextField {
|
||||
|
||||
guard super.becomeFirstResponder() else { return false }
|
||||
|
||||
// hide insertion point
|
||||
(self.currentEditor() as? NSTextView)?.insertionPointColor = .textBackgroundColor
|
||||
|
||||
self.keyDownMonitor = NSEvent.addLocalMonitorForEvents(matching: .keyDown, handler: { [weak self] (event: NSEvent) -> NSEvent? in
|
||||
|
||||
guard
|
||||
@ -90,6 +93,9 @@ final class ShortcutKeyField: NSTextField {
|
||||
/// end editing
|
||||
override func textDidEndEditing(_ notification: Notification) {
|
||||
|
||||
// restore insertion point
|
||||
(self.currentEditor() as? NSTextView)?.insertionPointColor = .controlTextColor
|
||||
|
||||
// end monitoring key down event
|
||||
if let monitor = self.keyDownMonitor {
|
||||
NSEvent.removeMonitor(monitor)
|
||||
|
Loading…
Reference in New Issue
Block a user