From 804e6dc8bbc4231b203f3044f7858a94db1b58b9 Mon Sep 17 00:00:00 2001 From: Chris Brind Date: Wed, 31 Jan 2024 17:41:13 +0000 Subject: [PATCH] apply scroll bar tweaking --- DuckDuckGo/MainViewController.swift | 4 ++++ DuckDuckGo/SwipeTabsCoordinator.swift | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/DuckDuckGo/MainViewController.swift b/DuckDuckGo/MainViewController.swift index 8cb119f1d7..62888a3094 100644 --- a/DuckDuckGo/MainViewController.swift +++ b/DuckDuckGo/MainViewController.swift @@ -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) diff --git a/DuckDuckGo/SwipeTabsCoordinator.swift b/DuckDuckGo/SwipeTabsCoordinator.swift index 996d7f0ac0..cb01700d7f 100644 --- a/DuckDuckGo/SwipeTabsCoordinator.swift +++ b/DuckDuckGo/SwipeTabsCoordinator.swift @@ -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 }