From 6eee97759ec29e471b0cd6924038a9462d9d7ecf Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 24 Jan 2023 10:19:04 -0500 Subject: [PATCH] Add context menu action to remove pinned timeline Closes #334 --- .../Screens/Customize Timelines/PinnedTimelinesView.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Tusker/Screens/Customize Timelines/PinnedTimelinesView.swift b/Tusker/Screens/Customize Timelines/PinnedTimelinesView.swift index cd188ba5..9ee5c0c8 100644 --- a/Tusker/Screens/Customize Timelines/PinnedTimelinesView.swift +++ b/Tusker/Screens/Customize Timelines/PinnedTimelinesView.swift @@ -45,6 +45,13 @@ struct PinnedTimelinesView: View { .foregroundColor(Color(.lightGray)) .accessibilityHidden(true) } + .contextMenu { + Button(role: .destructive) { + pinnedTimelines.removeAll(where: { $0.id == timeline.id }) + } label: { + Label("Remove Pinned Timeline", systemImage: "trash") + } + } } .onMove { indices, newOffset in pinnedTimelines.move(fromOffsets: indices, toOffset: newOffset)