visionOS: Don't highlight non-selectable list rows

This commit is contained in:
Shadowfacts 2023-11-07 22:52:13 -05:00
parent 9d01bbabd7
commit 19db78e352
5 changed files with 30 additions and 0 deletions

View File

@ -385,6 +385,12 @@ extension ConversationCollectionViewController: UICollectionViewDelegate {
func collectionView(_ collectionView: UICollectionView, willPerformPreviewActionForMenuWith configuration: UIContextMenuConfiguration, animator: UIContextMenuInteractionCommitAnimating) { func collectionView(_ collectionView: UICollectionView, willPerformPreviewActionForMenuWith configuration: UIContextMenuConfiguration, animator: UIContextMenuInteractionCommitAnimating) {
MenuPreviewHelper.willPerformPreviewAction(animator: animator, presenter: self) MenuPreviewHelper.willPerformPreviewAction(animator: animator, presenter: self)
} }
#if os(visionOS)
func collectionView(_ collectionView: UICollectionView, shouldHighlightItemAt indexPath: IndexPath) -> Bool {
return self.collectionView(collectionView, shouldSelectItemAt: indexPath)
}
#endif
} }
extension ConversationCollectionViewController: UICollectionViewDragDelegate { extension ConversationCollectionViewController: UICollectionViewDragDelegate {

View File

@ -677,6 +677,12 @@ extension NotificationsCollectionViewController: UICollectionViewDelegate {
reconfigureVisibleCells() reconfigureVisibleCells()
} }
} }
#if os(visionOS)
func collectionView(_ collectionView: UICollectionView, shouldHighlightItemAt indexPath: IndexPath) -> Bool {
return self.collectionView(collectionView, shouldSelectItemAt: indexPath)
}
#endif
} }
extension NotificationsCollectionViewController: UICollectionViewDragDelegate { extension NotificationsCollectionViewController: UICollectionViewDragDelegate {

View File

@ -628,6 +628,12 @@ extension ProfileStatusesViewController: UICollectionViewDelegate {
} }
} }
#if os(visionOS)
func collectionView(_ collectionView: UICollectionView, shouldHighlightItemAt indexPath: IndexPath) -> Bool {
return self.collectionView(collectionView, shouldSelectItemAt: indexPath)
}
#endif
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
if reconfigureVisibleItemsOnEndDecelerating { if reconfigureVisibleItemsOnEndDecelerating {
reconfigureVisibleItemsOnEndDecelerating = false reconfigureVisibleItemsOnEndDecelerating = false

View File

@ -202,6 +202,12 @@ extension StatusEditHistoryViewController: UICollectionViewDelegate {
func collectionView(_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool { func collectionView(_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool {
return false return false
} }
#if os(visionOS)
func collectionView(_ collectionView: UICollectionView, shouldHighlightItemAt indexPath: IndexPath) -> Bool {
return false
}
#endif
} }
extension StatusEditHistoryViewController: TuskerNavigationDelegate { extension StatusEditHistoryViewController: TuskerNavigationDelegate {

View File

@ -1339,6 +1339,12 @@ extension TimelineViewController: UICollectionViewDelegate {
MenuPreviewHelper.willPerformPreviewAction(animator: animator, presenter: self) MenuPreviewHelper.willPerformPreviewAction(animator: animator, presenter: self)
} }
#if os(visionOS)
func collectionView(_ collectionView: UICollectionView, shouldHighlightItemAt indexPath: IndexPath) -> Bool {
return self.collectionView(collectionView, shouldSelectItemAt: indexPath)
}
#endif
func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
if isShowingTimelineDescription { if isShowingTimelineDescription {
removeTimelineDescriptionCell() removeTimelineDescriptionCell()