PM-Einstellungen komplett importieren (Vorlagen, Code-Dateien, Trennzeichen, Feld-Listen, Ingest), ▾-Wertelisten, Info-Fenster ⌘B/⌘N + Pfeiltasten, Keyword-Limit pro Eintrag
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012bGzgsxrmbBhDzeMV2L57D
This commit is contained in:
1 parent
12f61b5d66
commit
2bf0d851aa
11 files changed
+516
-15
No files matched your search
@@ -11,6 +11,8 @@ struct IPTCInfoWindow: View {
|
||||
@State private var image: NSImage?
|
||||
@State private var saving = false
|
||||
@AppStorage("iptcWindowUploadTarget") private var uploadTarget = ""
|
||||
@State private var window: NSWindow?
|
||||
@State private var arrowMonitor: Any?
|
||||
|
||||
private var item: PhotoItem? { state.cursorItem }
|
||||
|
||||
@@ -18,7 +20,7 @@ struct IPTCInfoWindow: View {
|
||||
HSplitView {
|
||||
VStack(spacing: 0) {
|
||||
ScrollView {
|
||||
PMMetadataForm(texts: $texts, columns: 1, dirty: dirty, codes: state.codes,
|
||||
PMMetadataForm(texts: $texts, columns: 1, dirty: dirty, codes: state.codes, fieldLists: state.settings.fieldLists,
|
||||
onEdit: { dirty.insert($0) }, extraAfterContent: AnyView(labelSection))
|
||||
.padding(14)
|
||||
}
|
||||
@@ -42,7 +44,14 @@ struct IPTCInfoWindow: View {
|
||||
sidePanel.frame(minWidth: 380, idealWidth: 520)
|
||||
}
|
||||
.navigationTitle(item.map { "IPTC-Info – \($0.filename)" } ?? "IPTC-Info")
|
||||
.onAppear { load(force: true) }
|
||||
.background(WindowAccessor { window = $0 })
|
||||
.onAppear {
|
||||
load(force: true)
|
||||
installArrowKeys()
|
||||
}
|
||||
.onDisappear {
|
||||
if let m = arrowMonitor { NSEvent.removeMonitor(m); arrowMonitor = nil }
|
||||
}
|
||||
.onChange(of: state.cursorID) { _, _ in load(force: true) }
|
||||
.onReceive(state.$items) { _ in if dirty.isEmpty { DispatchQueue.main.async { load(force: false) } } }
|
||||
.task(id: item.map { state.previewURL(for: $0) }) { await loadImage() }
|
||||
@@ -101,14 +110,14 @@ struct IPTCInfoWindow: View {
|
||||
|
||||
Grid(horizontalSpacing: 8, verticalSpacing: 8) {
|
||||
GridRow {
|
||||
Button("Speichern & ←") { saveAndMove(-1) }
|
||||
.keyboardShortcut(.leftArrow, modifiers: [.command, .option])
|
||||
Button("Speichern & →") { saveAndMove(1) }
|
||||
.keyboardShortcut(.rightArrow, modifiers: [.command, .option])
|
||||
Button("Speichern & ← (⌘N)") { saveAndMove(-1) }
|
||||
.keyboardShortcut("n", modifiers: .command)
|
||||
Button("Speichern & → (⌘B)") { saveAndMove(1) }
|
||||
.keyboardShortcut("b", modifiers: .command)
|
||||
}
|
||||
GridRow {
|
||||
Button("←") { move(-1) }
|
||||
Button("→") { move(1) }
|
||||
Button("←") { move(-1) }.help("Ohne Speichern zurück (Pfeil links)")
|
||||
Button("→") { move(1) }.help("Ohne Speichern weiter (Pfeil rechts)")
|
||||
}
|
||||
GridRow {
|
||||
Button("Speichern, Hochladen & →") { saveUploadAndMove() }
|
||||
@@ -180,6 +189,23 @@ struct IPTCInfoWindow: View {
|
||||
return ok
|
||||
}
|
||||
|
||||
/// ←/→ = previous/next image WITHOUT saving (when no text field is being edited);
|
||||
/// ⌃←/⌃→ work even while typing.
|
||||
private func installArrowKeys() {
|
||||
guard arrowMonitor == nil else { return }
|
||||
arrowMonitor = NSEvent.addLocalMonitorForEvents(matching: .keyDown) { event in
|
||||
guard let w = window, event.window === w, w.attachedSheet == nil else { return event }
|
||||
let mods = event.modifierFlags.intersection(.deviceIndependentFlagsMask)
|
||||
guard event.keyCode == 123 || event.keyCode == 124 else { return event }
|
||||
let typing = w.firstResponder is NSText
|
||||
let ctrlOnly = mods == [.control] || mods == [.control, .function] || mods == [.function, .control]
|
||||
let plain = mods.subtracting([.function, .numericPad]).isEmpty
|
||||
guard ctrlOnly || (plain && !typing) else { return event }
|
||||
move(event.keyCode == 123 ? -1 : 1)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
private func move(_ delta: Int) {
|
||||
dirty = []
|
||||
state.iptcNavigate(delta)
|
||||
|
||||
Reference in new issue
Block a user