Skip to content

Commit

Permalink
visual tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Jun 24, 2022
1 parent 04426d6 commit e0fd7e9
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 49 deletions.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"info" : {
"author" : "xcode",
"version" : 1
},
"symbols" : [
{
"filename" : "rectangle.3.group.svg",
"idiom" : "universal"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions Tinodios/format/PreviewFormatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class PreviewFormatter: AbstractFormatter {

func annotatedIcon(iconName: String, localizedAnnotation: String? = nil) -> FormatNode {
let icon = NSTextAttachment()
icon.image = (UIImage(systemName: iconName) ?? UIImage(named: iconName))?.withRenderingMode(.alwaysTemplate)
icon.image = (UIImage(systemName: iconName, withConfiguration: UIImage.SymbolConfiguration(weight: .semibold)) ?? UIImage(named: iconName))?.withRenderingMode(.alwaysTemplate)
var aspectRatio: CGFloat = 1
if let size = icon.image?.size {
aspectRatio = size.width / size.height
Expand Down Expand Up @@ -68,7 +68,7 @@ class PreviewFormatter: AbstractFormatter {
}

override func handleImage(using attr: [String: JSONValue]?, draftyKey _: Int?) -> FormatNode {
return annotatedIcon(iconName: "image-50", localizedAnnotation: NSLocalizedString("Picture", comment: "Label shown next to an inline image"))
return annotatedIcon(iconName: "photo", localizedAnnotation: NSLocalizedString("Picture", comment: "Label shown next to an inline image"))
}

override func handleAttachment(using attr: [String: JSONValue]?, draftyKey _: Int?) -> FormatNode {
Expand All @@ -85,7 +85,7 @@ class PreviewFormatter: AbstractFormatter {
}

override func handleForm(_ nodes: [FormatNode]) -> FormatNode {
var result = [annotatedIcon(iconName: "form-50", localizedAnnotation: NSLocalizedString("Form", comment: "Label shown next to a form in preview")), FormatNode(": ")]
var result = [annotatedIcon(iconName: "rectangle.3.group", localizedAnnotation: NSLocalizedString("Form", comment: "Label shown next to a form in preview")), FormatNode(": ")]
result.append(contentsOf: nodes)
return FormatNode(result)
}
Expand Down

0 comments on commit e0fd7e9

Please sign in to comment.