2021-09-15 14:18:19 +02:00
|
|
|
//
|
|
|
|
// CircleAvatarButton.swift
|
|
|
|
// Mastodon
|
|
|
|
//
|
|
|
|
// Created by Cirno MainasuK on 2021-9-15.
|
|
|
|
//
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
2022-01-27 14:23:39 +01:00
|
|
|
public final class CircleAvatarButton: AvatarButton {
|
2021-09-15 14:18:19 +02:00
|
|
|
|
2022-01-27 14:23:39 +01:00
|
|
|
@Published public var needsHighlighted = false
|
2021-11-04 08:21:12 +01:00
|
|
|
|
2022-01-27 14:23:39 +01:00
|
|
|
public var borderColor: UIColor = UIColor.systemFill
|
|
|
|
public var borderWidth: CGFloat = 1.0
|
2021-10-28 13:17:41 +02:00
|
|
|
|
2022-01-27 14:23:39 +01:00
|
|
|
public override func updateAppearance() {
|
2021-11-04 08:21:12 +01:00
|
|
|
super.updateAppearance()
|
2021-09-15 14:18:19 +02:00
|
|
|
|
|
|
|
layer.masksToBounds = true
|
|
|
|
layer.cornerRadius = frame.width * 0.5
|
2021-11-04 08:21:12 +01:00
|
|
|
layer.borderColor = borderColor.cgColor
|
2021-10-28 13:17:41 +02:00
|
|
|
layer.borderWidth = borderWidth
|
2021-09-15 14:18:19 +02:00
|
|
|
}
|
2021-11-04 08:21:12 +01:00
|
|
|
|
2021-09-15 14:18:19 +02:00
|
|
|
}
|