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

Commit

Permalink
Fix #5683: Add support for dynamic type on the url & bottom toolbars
Browse files Browse the repository at this point in the history
  • Loading branch information
kylehickinson committed Jul 13, 2022
1 parent 9b269a0 commit 21a7a0a
Show file tree
Hide file tree
Showing 85 changed files with 1,603 additions and 511 deletions.
Empty file removed Client.xcodeproj/project.pbxproj
Empty file.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
6 changes: 3 additions & 3 deletions Client/Assets/Images.xcassets/TabToolbar/Contents.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
22 changes: 0 additions & 22 deletions Client/Assets/Images.xcassets/ntp-search.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
22 changes: 0 additions & 22 deletions Client/Assets/Images.xcassets/reader.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
6 changes: 3 additions & 3 deletions Client/Frontend/Browser/BrowserViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -943,9 +943,9 @@ public class BrowserViewController: UIViewController, BrowserViewControllerDeleg
make.left.right.equalTo(self.view)
}

topToolbar.snp.makeConstraints { make in
make.height.equalTo(UIConstants.topToolbarHeight)
}
// topToolbar.snp.makeConstraints { make in
// make.height.equalTo(UIConstants.topToolbarHeight)
// }

collapsedURLBarView.snp.makeConstraints {
$0.edges.equalToSuperview()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ extension BrowserViewController: PlaylistHelperDelegate {

let pulseAnimation = RadialPulsingAnimation(ringCount: 3)
pulseAnimation.present(
icon: UIImage(named: "welcome-view-playlist-button-icon", in: .current, compatibleWith: nil)!,
icon: self.topToolbar.locationView.playlistButton.snapshot,
from: self.topToolbar.locationView.playlistButton,
on: popover,
browser: self)
Expand Down
15 changes: 14 additions & 1 deletion Client/Frontend/Browser/TabsBar/TabBarCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ class TabBarCell: UICollectionViewCell {

[deselectedOverlayView, closeButton, titleLabel, separatorLine, separatorLineRight].forEach { contentView.addSubview($0) }
initConstraints()

updateFont()

isSelected = false
privateModeCancellable = PrivateBrowsingManager.shared
.$isPrivateBrowsing
Expand Down Expand Up @@ -146,6 +147,18 @@ class TabBarCell: UICollectionViewCell {
closeButton.isHidden = true
deselectedOverlayView.isHidden = false
}
updateFont()
}

override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
updateFont()
}

private func updateFont() {
let clampedTraitCollection = self.traitCollection.clampingSizeCategory(maximum: .extraExtraLarge)
let font = UIFont.preferredFont(forTextStyle: .caption1, compatibleWith: clampedTraitCollection)
titleLabel.font = .systemFont(ofSize: font.pointSize, weight: isSelected ? .semibold : .regular)
}

@objc func closeTab() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class BottomToolbarView: UIView, ToolbarProtocol {
self?.updateColors(PrivateBrowsingManager.shared.isPrivateBrowsing)
}
.store(in: &cancellables)

helper?.updateForTraitCollection(traitCollection)
}

private var privateModeCancellable: AnyCancellable?
Expand Down Expand Up @@ -90,6 +92,11 @@ class BottomToolbarView: UIView, ToolbarProtocol {
}
super.updateConstraints()
}

override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
helper?.updateForTraitCollection(traitCollection)
}

private func setupAccessibility() {
backButton.accessibilityIdentifier = "TabToolbar.backButton"
Expand Down
Loading

0 comments on commit 21a7a0a

Please sign in to comment.