Skip to content

Commit

Permalink
apply scroll bar tweaking
Browse files Browse the repository at this point in the history
  • Loading branch information
brindy committed Jan 31, 2024
1 parent 9edbfc9 commit 804e6dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions DuckDuckGo/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,16 @@ class MainViewController: UIViewController {

tabManager.cleanupTabsFaviconCache()

// Needs to be called here to established correct view hierarchy
refreshViewsBasedOnAddressBarPosition(appSettings.currentAddressBarPosition)
}

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

// Needs to be called here because sometimes the frames are not the expected size during didLoad
refreshViewsBasedOnAddressBarPosition(appSettings.currentAddressBarPosition)

startOnboardingFlowIfNotSeenBefore()
tabsBarController?.refresh(tabsModel: tabManager.model)
swipeTabsCoordinator?.refresh(tabsModel: tabManager.model)
Expand Down
4 changes: 2 additions & 2 deletions DuckDuckGo/SwipeTabsCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,11 @@ extension SwipeTabsCoordinator {

func addressBarPositionChanged(isTop: Bool) {
if isTop {
collectionView.horizontalScrollIndicatorInsets.bottom = 50
collectionView.horizontalScrollIndicatorInsets.bottom = -2
collectionView.hitTestInsets.top = -12
collectionView.hitTestInsets.bottom = 0
} else {
collectionView.horizontalScrollIndicatorInsets.bottom = -8
collectionView.horizontalScrollIndicatorInsets.bottom = collectionView.frame.height - 8
collectionView.hitTestInsets.top = 0
collectionView.hitTestInsets.bottom = -12
}
Expand Down

0 comments on commit 804e6dc

Please sign in to comment.