Skip to content

Commit

Permalink
Opt in Pro Max sized iPhones for the wider button spacing in the Editor
Browse files Browse the repository at this point in the history
  • Loading branch information
vincode-io committed Oct 18, 2024
1 parent 872b292 commit cf1a85d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Zavala/Editor/EditorViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ class EditorViewController: UIViewController, DocumentsActivityItemsConfiguratio
cell.reference = self?.generateBacklinkVerbaige(outline: outline)
}

configureButtonBars()
configureButtonBars(size: view.bounds.size)
updateUI()
collectionView.reloadData()

Expand Down Expand Up @@ -2044,7 +2044,7 @@ extension EditorViewController: ImageTransitionDelegate {

private extension EditorViewController {

func configureButtonBars() {
func configureButtonBars(size: CGSize) {
undoMenuButtonGroup = ButtonGroup(hostController: self, containerType: .standard, alignment: .none)
undoButton = undoMenuButtonGroup.addButton(label: .undoControlLabel, image: .undo, selector: .undo)
cutButton = undoMenuButtonGroup.addButton(label: .cutControlLabel, image: .cut, selector: .cut)
Expand Down Expand Up @@ -2105,7 +2105,12 @@ private extension EditorViewController {
formatMenuButtonGroup.remove(linkButton)
rightToolbarButtonGroup.insert(linkButton, at: 1)
}

navButtonGroup.containerWidth = size.width
leftToolbarButtonGroup.containerWidth = size.width
rightToolbarButtonGroup.containerWidth = size.width
}

}

func buildEllipsisMenu() -> UIMenu {
Expand Down
2 changes: 1 addition & 1 deletion Zavala/Utility/ButtonGroup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ButtonGroup: NSObject {
private var popoverController: UIViewController?

private var width: CGFloat {
if containerWidth > 480 {
if containerWidth >= 440 {
return containerType.wideWidth * CGFloat(stackView.arrangedSubviews.count)
} else {
return containerType.width * CGFloat(stackView.arrangedSubviews.count)
Expand Down

0 comments on commit cf1a85d

Please sign in to comment.