Enable clicking on most anyplace in the row
This commit is contained in:
parent
984431eb01
commit
8063488bc8
|
@ -15,7 +15,11 @@ struct VibrantSelectAction: ViewModifier {
|
|||
@GestureState var isLongPressed = false
|
||||
|
||||
func body(content: Content) -> some View {
|
||||
GeometryReader { geometry in
|
||||
content
|
||||
.frame(width: geometry.size.width, height: geometry.size.height, alignment: .leading)
|
||||
.background(self.isLongPressed || self.isTapped ? Color(AppAssets.tableViewCellSelectionColor) : Color(.secondarySystemGroupedBackground))
|
||||
}
|
||||
.foregroundColor(isLongPressed || isTapped ? Color(AppAssets.tableViewCellHighlightedTextColor) : .primary)
|
||||
.listRowBackground(isLongPressed || isTapped ? Color(AppAssets.tableViewCellSelectionColor) : nil)
|
||||
.gesture(
|
||||
|
@ -28,8 +32,8 @@ struct VibrantSelectAction: ViewModifier {
|
|||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
|
||||
self.isTapped = false
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
))
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue