Integrates an editor accessible via "Letzte Aufnahme bearbeiten…" or "Bild bearbeiten…" in the menu bar. Supports arrow, rectangle, ellipse, and text annotations with color picker, line width, undo/redo, and export to file or clipboard. New files in Sources/Editor/: - AnnotationItem/Document: data model and state management - AnnotationCanvasView: NSView with CG rendering and mouse interaction - AnnotationRenderer: shared rendering for canvas and image export - EditorToolbarView: SwiftUI toolbar with tool selection and actions - EditorWindowController: window lifecycle following SettingsWindowController pattern Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
38 lines
963 B
Swift
38 lines
963 B
Swift
import AppKit
|
|
import SwiftUI
|
|
|
|
struct MenuBarContentView: View {
|
|
@EnvironmentObject var coordinator: AppCoordinator
|
|
|
|
var body: some View {
|
|
Button("Ganzer Bildschirm") { coordinator.capture(mode: .fullScreen) }
|
|
Button("Fenster") { coordinator.capture(mode: .window) }
|
|
Button("Bereich auswählen") { coordinator.capture(mode: .region) }
|
|
|
|
Divider()
|
|
|
|
Button("Letzte Aufnahme bearbeiten…") {
|
|
coordinator.openEditorForLastCapture()
|
|
}
|
|
.disabled(coordinator.lastCapturedURL == nil)
|
|
|
|
Button("Bild bearbeiten…") {
|
|
coordinator.openEditorForFile()
|
|
}
|
|
|
|
Divider()
|
|
|
|
Button("Einstellungen…") {
|
|
SettingsWindowController.shared.show(coordinator: coordinator)
|
|
}
|
|
.keyboardShortcut(",")
|
|
|
|
Divider()
|
|
|
|
Button("Beenden") {
|
|
NSApplication.shared.terminate(nil)
|
|
}
|
|
.keyboardShortcut("q")
|
|
}
|
|
}
|