Merge pull request #231 from objectiveSee/feature/edit-ux
Add double-tap to edit functionality for prompt buttons
This commit is contained in:
commit
0ad1a96c2b
@ -234,7 +234,16 @@ extension CustomPrompt {
|
||||
.padding(.vertical, 6)
|
||||
.contentShape(Rectangle())
|
||||
.scaleEffect(isSelected ? 1.05 : 1.0)
|
||||
.onTapGesture(perform: onTap)
|
||||
.onTapGesture(count: 2) {
|
||||
// Double tap to edit
|
||||
if let onEdit = onEdit {
|
||||
onEdit(self)
|
||||
}
|
||||
}
|
||||
.onTapGesture(count: 1) {
|
||||
// Single tap to select
|
||||
onTap()
|
||||
}
|
||||
.contextMenu {
|
||||
if onEdit != nil || onDelete != nil {
|
||||
if let onEdit = onEdit {
|
||||
@ -341,4 +350,4 @@ extension CustomPrompt {
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture(perform: action)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ struct PromptSelectionGrid: View {
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
|
||||
Text("Right-click on prompts to edit or delete")
|
||||
Text("Double-click to edit • Right-click for more options")
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
@ -80,4 +80,3 @@ struct PromptSelectionGrid: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user