Use SymbolConfigurations for buttons (IOS-241)
I feel so stupid from time to time
This commit is contained in:
parent
65075c5404
commit
7c6c9b5e79
|
@ -19,7 +19,9 @@ class NotificationFilteringBannerTableViewCell: UITableViewCell {
|
||||||
|
|
||||||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
||||||
|
|
||||||
iconImageView = UIImageView(image: UIImage(systemName: "archivebox"))
|
let iconConfiguration = UIImage.SymbolConfiguration(scale: .large)
|
||||||
|
let icon = UIImage(systemName: "archivebox", withConfiguration: iconConfiguration)
|
||||||
|
iconImageView = UIImageView(image: icon)
|
||||||
iconImageView.translatesAutoresizingMaskIntoConstraints = false
|
iconImageView.translatesAutoresizingMaskIntoConstraints = false
|
||||||
|
|
||||||
iconImageWrapperView = UIView()
|
iconImageWrapperView = UIView()
|
||||||
|
@ -67,8 +69,6 @@ class NotificationFilteringBannerTableViewCell: UITableViewCell {
|
||||||
iconImageWrapperView.heightAnchor.constraint(equalToConstant: CGSize.authorAvatarButtonSize.height).priority(.defaultHigh),
|
iconImageWrapperView.heightAnchor.constraint(equalToConstant: CGSize.authorAvatarButtonSize.height).priority(.defaultHigh),
|
||||||
iconImageView.centerXAnchor.constraint(equalTo: iconImageWrapperView.centerXAnchor),
|
iconImageView.centerXAnchor.constraint(equalTo: iconImageWrapperView.centerXAnchor),
|
||||||
iconImageView.centerYAnchor.constraint(equalTo: iconImageWrapperView.centerYAnchor),
|
iconImageView.centerYAnchor.constraint(equalTo: iconImageWrapperView.centerYAnchor),
|
||||||
iconImageView.widthAnchor.constraint(equalToConstant: 27),
|
|
||||||
iconImageView.heightAnchor.constraint(equalToConstant: 24),
|
|
||||||
|
|
||||||
contentStackView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 8),
|
contentStackView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 8),
|
||||||
contentStackView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 16),
|
contentStackView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 16),
|
||||||
|
|
|
@ -14,10 +14,15 @@ class NotificationPolicyHeaderView: UIView {
|
||||||
// TODO: Localization
|
// TODO: Localization
|
||||||
titleLabel.text = "Filter Notifications from..."
|
titleLabel.text = "Filter Notifications from..."
|
||||||
|
|
||||||
closeButton = UIButton()
|
|
||||||
closeButton.setImage(UIImage(systemName: "xmark.circle.fill"), for: .normal)
|
let buttonImageConfiguration = UIImage.SymbolConfiguration(scale: .large)
|
||||||
|
let buttonImage = UIImage(systemName: "xmark.circle.fill", withConfiguration: buttonImageConfiguration)
|
||||||
|
var buttonConfiguration = UIButton.Configuration.plain()
|
||||||
|
buttonConfiguration.image = buttonImage
|
||||||
|
buttonConfiguration.contentInsets = .init(top: 10, leading: 10, bottom: 10, trailing: 10)
|
||||||
|
|
||||||
|
closeButton = UIButton(configuration: buttonConfiguration)
|
||||||
closeButton.translatesAutoresizingMaskIntoConstraints = false
|
closeButton.translatesAutoresizingMaskIntoConstraints = false
|
||||||
closeButton.setInsets(forContentPadding: UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10), imageTitlePadding: 0)
|
|
||||||
closeButton.contentMode = .center
|
closeButton.contentMode = .center
|
||||||
|
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
|
|
Loading…
Reference in New Issue