Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix #3763: Update initial height of menu when page actions are visible #3767

Merged
merged 1 commit into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,8 @@ extension BrowserViewController: ToolbarDelegate {
if let url = selectedTabURL, let tab = tabManager.selectedTab {
activities = shareActivities(for: url, tab: tab, sourceView: view, sourceRect: self.view.convert(self.topToolbar.menuButton.frame, from: self.topToolbar.menuButton.superview), arrowDirection: .up)
}
let menuController = MenuViewController(content: { menuController in
let initialHeight: CGFloat = selectedTabURL != nil ? 470 : 370
let menuController = MenuViewController(initialHeight: initialHeight, content: { menuController in
VStack(spacing: 6) {
featuresMenuSection(menuController)
Divider()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ struct MenuItemButton: View {
class MenuViewController: UINavigationController, UIPopoverPresentationControllerDelegate {

private var menuNavigationDelegate: MenuNavigationControllerDelegate?
private let initialHeight: CGFloat

init<MenuContent: View>(@ViewBuilder content: (MenuViewController) -> MenuContent) {
init<MenuContent: View>(initialHeight: CGFloat, @ViewBuilder content: (MenuViewController) -> MenuContent) {
self.initialHeight = initialHeight
super.init(nibName: nil, bundle: nil)
viewControllers = [MenuHostingController(content: content(self))]
menuNavigationDelegate = MenuNavigationControllerDelegate(panModal: self)
Expand Down Expand Up @@ -199,7 +201,7 @@ extension MenuViewController: PanModalPresentable {
.maxHeight
}
var shortFormHeight: PanModalHeight {
isPresentingInnerMenu ? .maxHeight : .contentHeight(370)
isPresentingInnerMenu ? .maxHeight : .contentHeight(initialHeight)
}
var allowsExtendedPanScrolling: Bool {
true
Expand Down