Add "Edit Shortcuts" context menu to Home shortcuts

Long-press (or right-click) any Home shortcut to open the Home settings
sheet for reordering and toggling shortcuts.
This commit is contained in:
Arkadiusz Fal
2026-05-26 07:57:55 +02:00
parent 7a1af02418
commit 07fd5e2744
2 changed files with 28 additions and 0 deletions

View File

@@ -3674,6 +3674,17 @@
}
}
},
"home.editShortcuts" : {
"comment" : "Context menu action on Home shortcuts to open Home settings",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Edit Shortcuts"
}
}
}
},
"home.downloads.notAvailable" : {
"comment" : "Downloads not available on tvOS",
"localizations" : {

View File

@@ -382,6 +382,9 @@ struct HomeView: View {
return LazyVGrid(columns: columns, spacing: gridSpacing) {
ForEach(settingsManager?.visibleShortcuts() ?? HomeShortcutItem.defaultOrder) { shortcut in
shortcutCardView(for: shortcut)
#if !os(tvOS)
.contextMenu { editShortcutsButton }
#endif
}
}
#if os(iOS)
@@ -404,9 +407,23 @@ struct HomeView: View {
) {
shortcutRowView(for: shortcut)
}
#if !os(tvOS)
.contextMenu { editShortcutsButton }
#endif
}
}
#if !os(tvOS)
/// Context menu action that opens the Home settings sheet to reorder/toggle shortcuts.
private var editShortcutsButton: some View {
Button {
showingCustomizeHome = true
} label: {
Label(String(localized: "home.editShortcuts"), systemImage: "gear")
}
}
#endif
@ViewBuilder
private func shortcutCardView(for shortcut: HomeShortcutItem) -> some View {
switch shortcut {