Skip to content

Commit

Permalink
Fix compile failures
Browse files Browse the repository at this point in the history
  • Loading branch information
tonisevener committed Aug 2, 2024
1 parent 3af2106 commit 429b88f
Show file tree
Hide file tree
Showing 41 changed files with 390 additions and 389 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class WMFTodayContinueReadingWidgetViewController: ExtensionViewController, NCWi
} else {
self.daysAgoView.isHidden = true
}
let styles = HtmlUtils.Styles(font: WKFont.for(.headline, compatibleWith: traitCollection), boldFont: WKFont.for(.boldHeadline, compatibleWith: traitCollection), italicsFont: WKFont.for(.headline, compatibleWith: traitCollection), boldItalicsFont: WKFont.for(.boldHeadline, compatibleWith: traitCollection), color: theme.colors.primaryText, linkColor: theme.colors.link, lineSpacing: 1)
let styles = HtmlUtils.Styles(font: WMFFont.for(.headline, compatibleWith: traitCollection), boldFont: WMFFont.for(.boldHeadline, compatibleWith: traitCollection), italicsFont: WMFFont.for(.headline, compatibleWith: traitCollection), boldItalicsFont: WMFFont.for(.boldHeadline, compatibleWith: traitCollection), color: theme.colors.primaryText, linkColor: theme.colors.link, lineSpacing: 1)

self.titleLabel.attributedText = NSAttributedString.attributedStringFromHtml(article.displayTitleHTML, styles: styles)
let combinedCompletion = {
Expand Down
4 changes: 2 additions & 2 deletions WMF Framework/ActionButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import WMFComponents

class ActionButton: SetupButton {

var titleLabelFont = WKFont.mediumSubheadline
var titleLabelFont = WMFFont.mediumSubheadline

override func setup() {
super.setup()
Expand Down Expand Up @@ -31,7 +31,7 @@ class ActionButton: SetupButton {

// Override this method and call super
open func updateFonts(with traitCollection: UITraitCollection) {
titleLabel?.font = WKFont.for(titleLabelFont, compatibleWith: traitCollection)
titleLabel?.font = WMFFont.for(titleLabelFont, compatibleWith: traitCollection)
}
}

Expand Down
2 changes: 1 addition & 1 deletion WMF Framework/CollectionViewEditController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ public class CollectionViewEditController: NSObject, UIGestureRecognizerDelegate
rightButton?.tag = editingState.tag
rightButton?.isEnabled = isRightBarButtonEnabled

let font = WKFont.for(.boldHeadline)
let font = WMFFont.for(.boldHeadline)
let attributes = [NSAttributedString.Key.font: font]
rightButton?.setTitleTextAttributes(attributes, for: .normal)
leftButton?.setTitleTextAttributes(attributes, for: .normal)
Expand Down
12 changes: 6 additions & 6 deletions WMF Framework/ExploreCardCollectionViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,12 @@ public class ExploreCardCollectionViewCell: CollectionViewCell, CardBackgroundVi

public override func updateFonts(with traitCollection: UITraitCollection) {
super.updateFonts(with: traitCollection)
titleLabel.font = WKFont.for(.semiboldSubheadline, compatibleWith: traitCollection)
subtitleLabel.font = WKFont.for(.subheadline, compatibleWith: traitCollection)
footerButton.titleLabel?.font = WKFont.for(.mediumSubheadline, compatibleWith: traitCollection)
undoLabel.font = WKFont.for(.subheadline, compatibleWith: traitCollection)
undoButton.titleLabel?.font = WKFont.for(.mediumSubheadline, compatibleWith: traitCollection)
customizationButton.titleLabel?.font = WKFont.for(.boldTitle1, compatibleWith: traitCollection)
titleLabel.font = WMFFont.for(.semiboldSubheadline, compatibleWith: traitCollection)
subtitleLabel.font = WMFFont.for(.subheadline, compatibleWith: traitCollection)
footerButton.titleLabel?.font = WMFFont.for(.mediumSubheadline, compatibleWith: traitCollection)
undoLabel.font = WMFFont.for(.subheadline, compatibleWith: traitCollection)
undoButton.titleLabel?.font = WMFFont.for(.mediumSubheadline, compatibleWith: traitCollection)
customizationButton.titleLabel?.font = WMFFont.for(.boldTitle1, compatibleWith: traitCollection)
}

private var cardShadowColor: UIColor = .black {
Expand Down
2 changes: 1 addition & 1 deletion WMF Framework/NavigationBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public class NavigationBar: SetupView, FakeProgressReceiving, FakeProgressDelega
let navigationTitleLabel = UILabel()
navigationTitleLabel.text = title
navigationTitleLabel.sizeToFit()
navigationTitleLabel.font = WKFont.for(.boldTitle1)
navigationTitleLabel.font = WMFFont.for(.boldTitle1)
titleView = navigationTitleLabel
let titleItem = UIBarButtonItem(customView: navigationTitleLabel)
extractedTitleBarButtonItem = titleItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -863,8 +863,8 @@ public extension ArticleAsLivingDocViewModel.Event.Large {
return nil
}

let font = WKFont.for(.callout, compatibleWith: traitCollection)
let italicFont = WKFont.for(.italicCallout, compatibleWith: traitCollection)
let font = WMFFont.for(.callout, compatibleWith: traitCollection)
let italicFont = WMFFont.for(.italicCallout, compatibleWith: traitCollection)
let attributes = [NSAttributedString.Key.font: font,
NSAttributedString.Key.foregroundColor: theme.colors.primaryText]

Expand Down Expand Up @@ -897,10 +897,10 @@ public extension ArticleAsLivingDocViewModel.Event.Large {
return sideScrollingCellWidth - sideScrollingCellPadding.left - sideScrollingCellPadding.right
}()

private static let changeDetailDescriptionTextStyle = WKFont.subheadline
private static let changeDetailDescriptionTextStyleItalic = WKFont.italicSubheadline
private static let changeDetailDescriptionTextStyle = WMFFont.subheadline
private static let changeDetailDescriptionTextStyleItalic = WMFFont.italicSubheadline

static let changeDetailReferenceTitleStyle = WKFont.boldSubheadline
static let changeDetailReferenceTitleStyle = WMFFont.boldSubheadline
static let changeDetailReferenceTitleDescriptionSpacing: CGFloat = 13
static let additionalPointsForShadow: CGFloat = 16

Expand Down Expand Up @@ -929,7 +929,7 @@ public extension ArticleAsLivingDocViewModel.Event.Large {

var changeDetails: [ChangeDetail] = []

let styles = HtmlUtils.Styles(font: WKFont.for(.subheadline, compatibleWith: traitCollection), boldFont: WKFont.for(.boldSubheadline, compatibleWith: traitCollection), italicsFont: WKFont.for(.italicSubheadline, compatibleWith: traitCollection), boldItalicsFont: WKFont.for(.boldItalicSubheadline, compatibleWith: traitCollection), color: theme.colors.primaryText, linkColor: theme.colors.link, lineSpacing: 1)
let styles = HtmlUtils.Styles(font: WMFFont.for(.subheadline, compatibleWith: traitCollection), boldFont: WMFFont.for(.boldSubheadline, compatibleWith: traitCollection), italicsFont: WMFFont.for(.italicSubheadline, compatibleWith: traitCollection), boldItalicsFont: WMFFont.for(.boldItalicSubheadline, compatibleWith: traitCollection), color: theme.colors.primaryText, linkColor: theme.colors.link, lineSpacing: 1)

switch typedEvent {
case .newTalkPageTopic(let newTalkPageTopic):
Expand All @@ -954,7 +954,7 @@ public extension ArticleAsLivingDocViewModel.Event.Large {

switch template {
case .articleDescription(let articleDescription):
let font = WKFont.for(Self.changeDetailDescriptionTextStyle, compatibleWith: traitCollection)
let font = WMFFont.for(Self.changeDetailDescriptionTextStyle, compatibleWith: traitCollection)
let attributes = [NSAttributedString.Key.font: font,
NSAttributedString.Key.foregroundColor:
theme.colors.primaryText]
Expand Down Expand Up @@ -1020,7 +1020,7 @@ public extension ArticleAsLivingDocViewModel.Event.Large {
return heightForThreeLineSnippet
}

let snippetFont = WKFont.for(Self.changeDetailDescriptionTextStyle, compatibleWith: traitCollection)
let snippetFont = WMFFont.for(Self.changeDetailDescriptionTextStyle, compatibleWith: traitCollection)
let snippetAttributes = [NSAttributedString.Key.font: snippetFont]
let threeLineSnippetText = """
1
Expand All @@ -1041,7 +1041,7 @@ public extension ArticleAsLivingDocViewModel.Event.Large {
return heightForReferenceTitle
}

let referenceTitleFont = WKFont.for(self.changeDetailReferenceTitleStyle, compatibleWith: traitCollection)
let referenceTitleFont = WMFFont.for(self.changeDetailReferenceTitleStyle, compatibleWith: traitCollection)
let referenceTitleAttributes = [NSAttributedString.Key.font: referenceTitleFont]
let oneLineTitleText = "1"
let oneLineTitleAttString = NSAttributedString(string: oneLineTitleText, attributes: referenceTitleAttributes)
Expand Down Expand Up @@ -1154,8 +1154,8 @@ public extension ArticleAsLivingDocViewModel.Event.Large {

private func descriptionForJournalCitation(_ journalCitation: SignificantEvents.Citation.Journal, traitCollection: UITraitCollection, theme: Theme) -> NSAttributedString? {

let font = WKFont.for(Self.changeDetailDescriptionTextStyle, compatibleWith: traitCollection)
let boldFont = WKFont.for(Self.changeDetailDescriptionTextStyleItalic, compatibleWith: traitCollection)
let font = WMFFont.for(Self.changeDetailDescriptionTextStyle, compatibleWith: traitCollection)
let boldFont = WMFFont.for(Self.changeDetailDescriptionTextStyleItalic, compatibleWith: traitCollection)
let attributes = [NSAttributedString.Key.font: font,
NSAttributedString.Key.foregroundColor:
theme.colors.primaryText]
Expand Down Expand Up @@ -1221,8 +1221,8 @@ public extension ArticleAsLivingDocViewModel.Event.Large {
}

private func descriptionForWebsiteCitation(_ websiteCitation: SignificantEvents.Citation.Website, traitCollection: UITraitCollection, theme: Theme) -> NSAttributedString? {
let font = WKFont.for(Self.changeDetailDescriptionTextStyle, compatibleWith: traitCollection)
let italicFont = WKFont.for(Self.changeDetailDescriptionTextStyleItalic, compatibleWith: traitCollection)
let font = WMFFont.for(Self.changeDetailDescriptionTextStyle, compatibleWith: traitCollection)
let italicFont = WMFFont.for(Self.changeDetailDescriptionTextStyleItalic, compatibleWith: traitCollection)
let attributes = [NSAttributedString.Key.font: font,
NSAttributedString.Key.foregroundColor:
theme.colors.primaryText]
Expand Down Expand Up @@ -1277,8 +1277,8 @@ public extension ArticleAsLivingDocViewModel.Event.Large {

private func descriptionForNewsCitation(_ newsCitation: SignificantEvents.Citation.News, traitCollection: UITraitCollection, theme: Theme) -> NSAttributedString? {

let font = WKFont.for(Self.changeDetailDescriptionTextStyle, compatibleWith: traitCollection)
let italicFont = WKFont.for(Self.changeDetailDescriptionTextStyleItalic, compatibleWith: traitCollection)
let font = WMFFont.for(Self.changeDetailDescriptionTextStyle, compatibleWith: traitCollection)
let italicFont = WMFFont.for(Self.changeDetailDescriptionTextStyleItalic, compatibleWith: traitCollection)
let attributes = [NSAttributedString.Key.font: font,
NSAttributedString.Key.foregroundColor:
theme.colors.primaryText]
Expand Down Expand Up @@ -1337,8 +1337,8 @@ public extension ArticleAsLivingDocViewModel.Event.Large {

private func descriptionForBookCitation(_ bookCitation: SignificantEvents.Citation.Book, traitCollection: UITraitCollection, theme: Theme) -> NSAttributedString? {

let font = WKFont.for(Self.changeDetailDescriptionTextStyle, compatibleWith: traitCollection)
let italicFont = WKFont.for(Self.changeDetailDescriptionTextStyleItalic, compatibleWith: traitCollection)
let font = WMFFont.for(Self.changeDetailDescriptionTextStyle, compatibleWith: traitCollection)
let italicFont = WMFFont.for(Self.changeDetailDescriptionTextStyleItalic, compatibleWith: traitCollection)
let attributes = [NSAttributedString.Key.font: font,
NSAttributedString.Key.foregroundColor:
theme.colors.primaryText]
Expand Down Expand Up @@ -1555,7 +1555,7 @@ public extension ArticleAsLivingDocViewModel.Event.Large {
userType != .anonymous else {
let anonymousUserInfo = CommonStrings.revisionUserInfoAnonymous

let font = WKFont.for(.subheadline, compatibleWith: traitCollection)
let font = WMFFont.for(.subheadline, compatibleWith: traitCollection)
let attributes = [NSAttributedString.Key.font: font,
NSAttributedString.Key.foregroundColor: theme.colors.secondaryText]
let mutableAttributedString = NSMutableAttributedString(string: anonymousUserInfo, attributes: attributes)
Expand All @@ -1573,7 +1573,7 @@ public extension ArticleAsLivingDocViewModel.Event.Large {
let formattedEditCount = NumberFormatter.localizedThousandsStringFromNumber(NSNumber(value: editCount)).localizedLowercase
let userInfo = String.localizedStringWithFormat( CommonStrings.revisionUserInfo, userName, formattedEditCount)

let font = WKFont.for(.subheadline, compatibleWith: traitCollection)
let font = WMFFont.for(.subheadline, compatibleWith: traitCollection)
let attributes = [NSAttributedString.Key.font: font,
NSAttributedString.Key.foregroundColor: theme.colors.secondaryText]
let rangeOfUserName = (userInfo as NSString).range(of: userName)
Expand Down
Loading

0 comments on commit 429b88f

Please sign in to comment.