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:
@@ -119,6 +119,7 @@ struct HelpTab: View {
|
|||||||
urlRow("snippingtool://fullscreen?edit=true", "Vollbild + Editor")
|
urlRow("snippingtool://fullscreen?edit=true", "Vollbild + Editor")
|
||||||
urlRow("snippingtool://edit", "Bild aus Datei bearbeiten")
|
urlRow("snippingtool://edit", "Bild aus Datei bearbeiten")
|
||||||
urlRow("snippingtool://editlast", "Letzten Screenshot bearbeiten")
|
urlRow("snippingtool://editlast", "Letzten Screenshot bearbeiten")
|
||||||
|
urlRow("snippingtool://clipboard", "Zwischenablage bearbeiten")
|
||||||
}
|
}
|
||||||
|
|
||||||
helpSection("Einrichtung in Logitech Options+") {
|
helpSection("Einrichtung in Logitech Options+") {
|
||||||
|
|||||||
@@ -126,6 +126,11 @@ final class AppCoordinator: ObservableObject {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if modeString == "paste" || modeString == "clipboard" || modeString == "editclipboard" {
|
||||||
|
openEditorFromClipboard()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
let mode: CaptureMode?
|
let mode: CaptureMode?
|
||||||
switch modeString {
|
switch modeString {
|
||||||
case "fullscreen", "full", "full-screen", "screen":
|
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() {
|
func openEditorForFile() {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
NSApplication.shared.setActivationPolicy(.regular)
|
NSApplication.shared.setActivationPolicy(.regular)
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ struct MenuBarContentView: View {
|
|||||||
}
|
}
|
||||||
.disabled(coordinator.lastCapturedURL == nil)
|
.disabled(coordinator.lastCapturedURL == nil)
|
||||||
|
|
||||||
|
Button("Aus Zwischenablage bearbeiten") {
|
||||||
|
coordinator.openEditorFromClipboard()
|
||||||
|
}
|
||||||
|
|
||||||
Button("Bild bearbeiten…") {
|
Button("Bild bearbeiten…") {
|
||||||
coordinator.openEditorForFile()
|
coordinator.openEditorForFile()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user