Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
brindy committed Dec 2, 2024
1 parent 4bfdaea commit b58bb9b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions DuckDuckGo/FavoritesHomeViewSectionRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,20 @@ class FavoritesHomeViewSectionRenderer {
}

func sectionMargin(in collectionView: UICollectionView) -> CGFloat {
if isPad {
if controller is FavoritesOverlay {
return Constants.largeModeMargin
}

let margin: CGFloat
if isPad {
margin = (collectionView.frame.width - Constants.searchWidthPad) / 2
} else {
let defaultMargin = FavoritesHomeViewSectionRenderer.Constants.sideInsets
return (collectionView.frame.width - Constants.searchWidth + defaultMargin) / 2
let landscapeMargin = (collectionView.frame.width - Constants.searchWidth + defaultMargin) / 2
margin = isPortrait ? defaultMargin : landscapeMargin
}

return margin
}

// Visible margin is adjusted for offset inside Favorite Cells
Expand Down Expand Up @@ -180,7 +188,7 @@ class FavoritesHomeViewSectionRenderer {
referenceSizeForHeaderInSection section: Int) -> CGSize? {
return CGSize(width: 1, height: headerHeight)
}

func collectionView(_ collectionView: UICollectionView,
layout collectionViewLayout: UICollectionViewLayout,
referenceSizeForFooterInSection section: Int) -> CGSize? {
Expand Down

0 comments on commit b58bb9b

Please sign in to comment.