Show issue state icons in lists
This commit is contained in:
@@ -1130,23 +1130,8 @@ private func detailViews(
|
||||
}
|
||||
|
||||
private func issueTitle(_ titleLabel: UILabel, state: String) -> UIView {
|
||||
let symbol: String
|
||||
let color: UIColor
|
||||
let accessibilityLabel: String
|
||||
switch state {
|
||||
case "open":
|
||||
(symbol, color, accessibilityLabel) = ("exclamationmark.circle.fill", .systemGreen, "Open issue")
|
||||
case "closed":
|
||||
(symbol, color, accessibilityLabel) = ("checkmark.circle.fill", .systemPurple, "Closed issue")
|
||||
default:
|
||||
(symbol, color, accessibilityLabel) = ("questionmark.circle.fill", .systemGray, "Unknown issue state")
|
||||
}
|
||||
let icon = UIImageView(image: UIImage(systemName: symbol))
|
||||
icon.tintColor = color
|
||||
icon.preferredSymbolConfiguration = UIImage.SymbolConfiguration(textStyle: .title1)
|
||||
icon.setContentHuggingPriority(.required, for: .horizontal)
|
||||
icon.isAccessibilityElement = true
|
||||
icon.accessibilityLabel = accessibilityLabel
|
||||
let icon = UIImageView()
|
||||
configureIssueStateIcon(icon, state: state, textStyle: .title1)
|
||||
let stack = UIStackView(arrangedSubviews: [icon, titleLabel])
|
||||
stack.axis = .horizontal
|
||||
stack.alignment = .firstBaseline
|
||||
|
||||
Reference in New Issue
Block a user