feat: copy translation and dismiss with Return
This commit is contained in:
@@ -499,7 +499,7 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe
|
||||
}
|
||||
if let emojiPicker { return emojiPicker.handle(commandSelector) }
|
||||
if let translation {
|
||||
if commandSelector == #selector(NSResponder.insertNewline(_:)) { translation.translate(); return true }
|
||||
if commandSelector == #selector(NSResponder.insertNewline(_:)) { translation.performPrimaryAction(); return true }
|
||||
return false
|
||||
}
|
||||
switch commandSelector {
|
||||
@@ -835,7 +835,8 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe
|
||||
let accessibilityLabel: String
|
||||
switch command {
|
||||
case .translate:
|
||||
let tool = TranslationController()
|
||||
let tool = TranslationController(pasteboard: pasteboard)
|
||||
tool.dismiss = { [weak self] in self?.dismiss() }
|
||||
translation = tool
|
||||
tool.input = { [weak self] in self?.searchField.stringValue ?? "" }
|
||||
controller = tool
|
||||
|
||||
Reference in New Issue
Block a user