Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit 555dcd0

Browse files
authored
Fix crash on popup window display; adjust naming (#2315)
Task/Issue URL: https://app.asana.com/0/1177771139624306/1206762780611864/f Description: fixes missing constraint ref
1 parent 6534946 commit 555dcd0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

DuckDuckGo/MainWindow/MainView.swift

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ final class MainView: NSView {
3030
let divider = ColorView(frame: .zero, backgroundColor: .separatorColor)
3131

3232
private(set) var navigationBarTopConstraint: NSLayoutConstraint!
33-
private(set) var addressBarHeightConstraint: NSLayoutConstraint!
3433
private(set) var bookmarksBarHeightConstraint: NSLayoutConstraint!
3534

3635
@Published var isMouseAboveWebView: Bool = false

DuckDuckGo/MainWindow/MainViewController.swift

+6-4
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,15 @@ final class MainViewController: NSViewController {
129129
tabBarViewController.view.isHidden = true
130130
mainView.tabBarContainerView.isHidden = true
131131
mainView.navigationBarTopConstraint.constant = 0.0
132-
mainView.addressBarHeightConstraint.constant = mainView.tabBarContainerView.frame.height
132+
resizeNavigationBar(isHomePage: false, animated: false)
133+
133134
updateBookmarksBarViewVisibility(visible: false)
134135
} else {
135136
mainView.navigationBarContainerView.wantsLayer = true
136137
mainView.navigationBarContainerView.layer?.masksToBounds = false
137138

138-
resizeNavigationBarForHomePage(tabCollectionViewModel.selectedTabViewModel?.tab.content == .newtab, animated: false)
139+
resizeNavigationBar(isHomePage: tabCollectionViewModel.selectedTabViewModel?.tab.content == .newtab,
140+
animated: false)
139141

140142
let bookmarksBarVisible = AppearancePreferences.shared.showBookmarksBar
141143
updateBookmarksBarViewVisibility(visible: bookmarksBarVisible)
@@ -291,7 +293,7 @@ final class MainViewController: NSViewController {
291293
}
292294
}
293295

294-
private func resizeNavigationBarForHomePage(_ homePage: Bool, animated: Bool) {
296+
private func resizeNavigationBar(isHomePage homePage: Bool, animated: Bool) {
295297
updateDividerColor(isShowingHomePage: homePage)
296298
navigationBarViewController.resizeAddressBar(for: homePage ? .homePage : (isInPopUpWindow ? .popUpWindow : .default), animated: animated)
297299
}
@@ -303,7 +305,7 @@ final class MainViewController: NSViewController {
303305
guard let self, let selectedTabViewModel else { return }
304306
defer { lastTabContent = content }
305307

306-
resizeNavigationBarForHomePage(content == .newtab, animated: content == .newtab && lastTabContent != .newtab)
308+
resizeNavigationBar(isHomePage: content == .newtab, animated: content == .newtab && lastTabContent != .newtab)
307309
updateBookmarksBar(content)
308310
adjustFirstResponder(selectedTabViewModel: selectedTabViewModel, tabContent: content)
309311
}

0 commit comments

Comments
 (0)