Skip to content

Commit

Permalink
Merge pull request #4690 from wikimedia/native-editor-fonts-update
Browse files Browse the repository at this point in the history
Native editor icons update
  • Loading branch information
tonisevener authored Dec 5, 2023
2 parents 753dbfc + 5450a6a commit 1b3c024
Show file tree
Hide file tree
Showing 34 changed files with 129 additions and 237 deletions.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class WKEditorToolbarExpandingView: WKEditorToolbarView {
}

expandButton.isAccessibilityElement = false
expandButton.setImage(WKIcon.chevronRightCircle, for: .normal)
expandButton.setImage(WKSFSymbolIcon.for(symbol: .chevronRightCircle), for: .normal)
expandButton.addTarget(self, action: #selector(tappedExpand), for: .touchUpInside)
expandButton.isAccessibilityElement = false

Expand All @@ -87,40 +87,40 @@ class WKEditorToolbarExpandingView: WKEditorToolbarView {
formatHeadingButton.accessibilityIdentifier = WKSourceEditorAccessibilityIdentifiers.current?.formatHeadingButton
formatHeadingButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current.accessibilityLabelButtonFormatHeading

citationButton.setImage(WKIcon.citation, for: .normal)
citationButton.setImage(WKSFSymbolIcon.for(symbol: .quoteOpening), for: .normal)
citationButton.addTarget(self, action: #selector(tappedCitation), for: .touchUpInside)
citationButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current.accessibilityLabelButtonCitation

linkButton.setImage(WKIcon.link, for: .normal)
linkButton.setImage(WKSFSymbolIcon.for(symbol: .link), for: .normal)
linkButton.addTarget(self, action: #selector(tappedLink), for: .touchUpInside)
linkButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current.accessibilityLabelButtonLink

templateButton.setImage(WKIcon.template, for: .normal)
templateButton.setImage(WKSFSymbolIcon.for(symbol: .curlybraces), for: .normal)
templateButton.addTarget(self, action: #selector(tappedTemplate), for: .touchUpInside)
templateButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current.accessibilityLabelButtonTemplate

mediaButton.setImage(WKIcon.media, for: .normal)
mediaButton.setImage(WKSFSymbolIcon.for(symbol: .photo), for: .normal)
mediaButton.addTarget(self, action: #selector(tappedMedia), for: .touchUpInside)
mediaButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current.accessibilityLabelButtonMedia

findInPageButton.setImage(WKIcon.findInPage, for: .normal)
findInPageButton.setImage(WKSFSymbolIcon.for(symbol: .docTextMagnifyingGlass), for: .normal)
findInPageButton.addTarget(self, action: #selector(tappedFindInPage), for: .touchUpInside)
findInPageButton.accessibilityIdentifier = WKSourceEditorAccessibilityIdentifiers.current?.findButton
findInPageButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current.accessibilityLabelButtonFind

unorderedListButton.setImage(WKIcon.listUnordered, for: .normal)
unorderedListButton.setImage(WKSFSymbolIcon.for(symbol: .listBullet), for: .normal)
unorderedListButton.addTarget(self, action: #selector(tappedUnorderedList), for: .touchUpInside)
unorderedListButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current.accessibilityLabelButtonListUnordered

orderedListButton.setImage(WKIcon.listOrdered, for: .normal)
orderedListButton.setImage(WKSFSymbolIcon.for(symbol: .listNumber), for: .normal)
orderedListButton.addTarget(self, action: #selector(tappedOrderedList), for: .touchUpInside)
orderedListButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current.accessibilityLabelButtonListOrdered

decreaseIndentionButton.setImage(WKIcon.indentDecrease, for: .normal)
decreaseIndentionButton.setImage(WKSFSymbolIcon.for(symbol: .decreaseIndent), for: .normal)
decreaseIndentionButton.addTarget(self, action: #selector(tappedDecreaseIndentation), for: .touchUpInside)
decreaseIndentionButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current.accessibilityLabelButtonDecreaseIndent

increaseIndentionButton.setImage(WKIcon.indentIncrease, for: .normal)
increaseIndentionButton.setImage(WKSFSymbolIcon.for(symbol: .increaseIndent), for: .normal)
increaseIndentionButton.addTarget(self, action: #selector(tappedIncreaseIndentation), for: .touchUpInside)
increaseIndentionButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current.accessibilityLabelButtonInceaseIndent

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,24 @@ class WKFindAndReplaceView: WKComponentView {
override func awakeFromNib() {
super.awakeFromNib()

closeButton.setImage(WKIcon.close, for: .normal)
closeButton.setImage(WKSFSymbolIcon.for(symbol: .close), for: .normal)
closeButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current.accessibilityLabelFindButtonClose
previousButton.setImage(WKIcon.chevronUp, for: .normal)
previousButton.setImage(WKSFSymbolIcon.for(symbol: .chevronUp), for: .normal)
previousButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current.accessibilityLabelFindButtonPrevious
nextButton.setImage(WKIcon.chevronDown, for: .normal)
nextButton.setImage(WKSFSymbolIcon.for(symbol: .chevronDown), for: .normal)
nextButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current.accessibilityLabelFindButtonNext

replaceButton.setImage(WKIcon.replace, for: .normal)
replaceButton.accessibilityLabel = String.localizedStringWithFormat(WKSourceEditorLocalizedStrings.current.accessibilityLabelReplaceButtonPerformFormat, WKSourceEditorLocalizedStrings.current.accessibilityLabelReplaceTypeSingle)
replaceSwitchButton.setImage(WKIcon.more, for: .normal)
replaceSwitchButton.setImage(WKSFSymbolIcon.for(symbol: .ellipsis), for: .normal)
replaceSwitchButton.accessibilityLabel = String.localizedStringWithFormat(WKSourceEditorLocalizedStrings.current.accessibilityLabelReplaceButtonSwitchFormat, WKSourceEditorLocalizedStrings.current.accessibilityLabelReplaceTypeSingle)

magnifyImageView.image = WKIcon.find
pencilImageView.image = WKIcon.pencil
magnifyImageView.image = WKSFSymbolIcon.for(symbol: .magnifyingGlass)
pencilImageView.image = WKSFSymbolIcon.for(symbol: .pencil)

findClearButton.setImage(WKIcon.closeCircle, for: .normal)
findClearButton.setImage(WKSFSymbolIcon.for(symbol: .multiplyCircleFill), for: .normal)
findClearButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current.accessibilityLabelFindButtonClear
replaceClearButton.setImage(WKIcon.closeCircle, for: .normal)
replaceClearButton.setImage(WKSFSymbolIcon.for(symbol: .multiplyCircleFill), for: .normal)
replaceClearButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current.accessibilityLabelReplaceButtonClear

findTextField.adjustsFontForContentSizeCategory = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ class WKEditorToolbarHighlightView: WKEditorToolbarView {
stackView.isLayoutMarginsRelativeArrangement = true
stackView.layoutMargins = UIEdgeInsets(top: 5, left: 0, bottom: 5, right: 0)

boldButton.setImage(WKIcon.bold, for: .normal)
boldButton.setImage(WKSFSymbolIcon.for(symbol: .bold), for: .normal)
boldButton.addTarget(self, action: #selector(tappedBold), for: .touchUpInside)
boldButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonBold

italicsButton.setImage(WKIcon.italics, for: .normal)
italicsButton.setImage(WKSFSymbolIcon.for(symbol: .italic), for: .normal)
italicsButton.addTarget(self, action: #selector(tappedItalics), for: .touchUpInside)
italicsButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonItalics

Expand All @@ -46,23 +46,23 @@ class WKEditorToolbarHighlightView: WKEditorToolbarView {
formatHeadingButton.accessibilityIdentifier = WKSourceEditorAccessibilityIdentifiers.current?.formatHeadingButton
formatHeadingButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonFormatHeading

citationButton.setImage(WKIcon.citation, for: .normal)
citationButton.setImage(WKSFSymbolIcon.for(symbol: .quoteOpening), for: .normal)
citationButton.addTarget(self, action: #selector(tappedCitation), for: .touchUpInside)
citationButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonCitation

linkButton.setImage(WKIcon.link, for: .normal)
linkButton.setImage(WKSFSymbolIcon.for(symbol: .link), for: .normal)
linkButton.addTarget(self, action: #selector(tappedLink), for: .touchUpInside)
linkButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonLink

templateButton.setImage(WKIcon.template, for: .normal)
templateButton.setImage(WKSFSymbolIcon.for(symbol: .curlybraces), for: .normal)
templateButton.addTarget(self, action: #selector(tappedTemplate), for: .touchUpInside)
templateButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonTemplate

clearMarkupButton.setImage(WKIcon.clear, for: .normal)
clearMarkupButton.addTarget(self, action: #selector(tappedClearMarkup), for: .touchUpInside)
clearMarkupButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonClearFormatting

showMoreButton.setImage(WKIcon.plusCircle, for: .normal)
showMoreButton.setImage(WKSFSymbolIcon.for(symbol: .plusCircleFill), for: .normal)
showMoreButton.addTarget(self, action: #selector(tappedShowMore), for: .touchUpInside)
showMoreButton.accessibilityIdentifier = WKSourceEditorAccessibilityIdentifiers.current?.showMoreButton
showMoreButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonShowMore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class WKEditorInputHeaderSelectViewController: WKComponentViewController {
}()

private lazy var closeButton: UIBarButtonItem = {
let button = UIBarButtonItem(image: WKIcon.close, style: .plain, target: self, action: #selector(close(_:)))
let button = UIBarButtonItem(image: WKSFSymbolIcon.for(symbol: .multiplyCircleFill), style: .plain, target: self, action: #selector(close(_:)))
button.accessibilityIdentifier = WKSourceEditorAccessibilityIdentifiers.current?.closeButton
button.accessibilityLabel = WKSourceEditorLocalizedStrings.current.accessibilityLabelButtonCloseHeaderSelectInputView
return button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,35 @@ class WKEditorToolbarGroupedView: WKEditorToolbarView {
override func awakeFromNib() {
super.awakeFromNib()

unorderedListButton.setImage(WKIcon.listUnordered, for: .normal)
unorderedListButton.setImage(WKSFSymbolIcon.for(symbol: .listBullet), for: .normal)
unorderedListButton.addTarget(self, action: #selector(tappedUnorderedList), for: .touchUpInside)
unorderedListButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonListUnordered

orderedListButton.setImage(WKIcon.listOrdered, for: .normal)
orderedListButton.setImage(WKSFSymbolIcon.for(symbol: .listNumber), for: .normal)
orderedListButton.addTarget(self, action: #selector(tappedOrderedList), for: .touchUpInside)
orderedListButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonListOrdered

decreaseIndentButton.setImage(WKIcon.indentDecrease, for: .normal)
decreaseIndentButton.setImage(WKSFSymbolIcon.for(symbol: .decreaseIndent), for: .normal)
decreaseIndentButton.addTarget(self, action: #selector(tappedDecreaseIndent), for: .touchUpInside)
decreaseIndentButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonDecreaseIndent

increaseIndentButton.setImage(WKIcon.indentIncrease, for: .normal)
increaseIndentButton.setImage(WKSFSymbolIcon.for(symbol: .increaseIndent), for: .normal)
increaseIndentButton.addTarget(self, action: #selector(tappedIncreaseIndent), for: .touchUpInside)
increaseIndentButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonInceaseIndent

superscriptButton.setImage(WKIcon.superscript, for: .normal)
superscriptButton.setImage(WKSFSymbolIcon.for(symbol: .textFormatSuperscript), for: .normal)
superscriptButton.addTarget(self, action: #selector(tappedSuperscript), for: .touchUpInside)
superscriptButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonSuperscript

subscriptButton.setImage(WKIcon.subscript, for: .normal)
subscriptButton.setImage(WKSFSymbolIcon.for(symbol: .textFormatSubscript), for: .normal)
subscriptButton.addTarget(self, action: #selector(tappedSubscript), for: .touchUpInside)
subscriptButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonSubscript

underlineButton.setImage(WKIcon.underline, for: .normal)
underlineButton.setImage(WKSFSymbolIcon.for(symbol: .underline), for: .normal)
underlineButton.addTarget(self, action: #selector(tappedUnderline), for: .touchUpInside)
underlineButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonUnderline

strikethroughButton.setImage(WKIcon.strikethrough, for: .normal)
strikethroughButton.setImage(WKSFSymbolIcon.for(symbol: .strikethrough), for: .normal)
strikethroughButton.addTarget(self, action: #selector(tappedStrikethrough), for: .touchUpInside)
strikethroughButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonStrikethrough
}
Expand Down
Loading

0 comments on commit 1b3c024

Please sign in to comment.