Add clipboard image editing
Open the editor with an image from the clipboard via menu
("Aus Zwischenablage bearbeiten") or URL (snippingtool://clipboard).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -126,6 +126,11 @@ final class AppCoordinator: ObservableObject {
|
||||
return
|
||||
}
|
||||
|
||||
if modeString == "paste" || modeString == "clipboard" || modeString == "editclipboard" {
|
||||
openEditorFromClipboard()
|
||||
return
|
||||
}
|
||||
|
||||
let mode: CaptureMode?
|
||||
switch modeString {
|
||||
case "fullscreen", "full", "full-screen", "screen":
|
||||
@@ -211,6 +216,16 @@ final class AppCoordinator: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
func openEditorFromClipboard() {
|
||||
guard let pasteboard = NSPasteboard.general.readObjects(forClasses: [NSImage.self], options: nil),
|
||||
let image = pasteboard.first as? NSImage else { return }
|
||||
let tempURL = URL(fileURLWithPath: NSTemporaryDirectory())
|
||||
.appendingPathComponent(Self.filename(ext: imageFormat.fileExtension))
|
||||
DispatchQueue.main.async {
|
||||
self.openEditor(image: image, sourceURL: tempURL)
|
||||
}
|
||||
}
|
||||
|
||||
func openEditorForFile() {
|
||||
DispatchQueue.main.async {
|
||||
NSApplication.shared.setActivationPolicy(.regular)
|
||||
|
||||
Reference in New Issue
Block a user