Add delete to the selection bar and drop the in-header close button

The selection bar covered copying but not the other action people reach
for with a selection. The header also carried a second close button next
to the window's own traffic light, so it was removed in favor of that.
This commit is contained in:
2026-10-09 22:45:16 +08:00
parent 78d56ca79b
commit 569e56dbba
3 changed files with 21 additions and 11 deletions
+12 -3
View File
@@ -83,9 +83,6 @@ struct PanelView: View {
.buttonStyle(.plain).foregroundStyle(.secondary).help("Search (Cmd+F)")
Button { addPhotos() } label: { Image(systemName: "photo.on.rectangle.angled") }
.buttonStyle(.plain).foregroundStyle(.secondary).help("Add photos")
Button { PanelController.shared.hide() } label: { Image(systemName: "xmark") }
.buttonStyle(.plain).foregroundStyle(.secondary)
.help("Hide the panel (Cmd+W) — Prompt keeps running so Shift-Shift capture still works. Quit from the menu bar icon or Cmd+Q.")
}
.padding(.horizontal, 12)
.padding(.vertical, 10)
@@ -576,6 +573,12 @@ struct PanelView: View {
.font(.caption)
.buttonStyle(.plain)
.foregroundStyle(Color.accentColor)
Button { deleteSelection() } label: {
Image(systemName: "trash")
}
.buttonStyle(.plain)
.foregroundStyle(.red)
.help("Delete selected")
Button { clearSelection() } label: {
Image(systemName: "xmark.circle.fill")
}
@@ -588,6 +591,12 @@ struct PanelView: View {
.background(Color.accentColor.opacity(0.12))
}
private func deleteSelection() {
guard !selection.isEmpty else { return }
store.delete(ids: selection)
clearSelection()
}
private func copySelection(asList: Bool) {
guard !selection.isEmpty else { return }
if asList {