mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2025-02-02 18:36:44 +01:00
Add some ✨ styling (IOS-234)
This commit is contained in:
parent
6e61e3ca25
commit
c1c6ef44e9
@ -15,7 +15,6 @@ class TimelineStatusPill: UIButton {
|
||||
reason.title, attributes: AttributeContainer(
|
||||
[
|
||||
.font: UIFontMetrics(forTextStyle: .subheadline).scaledFont(for: .systemFont(ofSize: 15, weight: .bold)),
|
||||
.foregroundColor: UIColor.white
|
||||
]
|
||||
))
|
||||
|
||||
@ -26,12 +25,28 @@ class TimelineStatusPill: UIButton {
|
||||
|
||||
configuration.image = image
|
||||
configuration.imagePadding = 8
|
||||
configuration.baseBackgroundColor = reason.backgroundColor
|
||||
configuration.cornerStyle = .capsule
|
||||
configuration.background.backgroundColor = reason.backgroundColor
|
||||
|
||||
self.configuration = configuration
|
||||
}
|
||||
|
||||
override func updateConfiguration() {
|
||||
guard let reason, var updatedConfiguration = configuration else {
|
||||
return super.updateConfiguration()
|
||||
}
|
||||
|
||||
switch state {
|
||||
case .selected, .highlighted, .focused:
|
||||
updatedConfiguration.baseForegroundColor = UIColor.white.withAlphaComponent(0.5)
|
||||
default:
|
||||
updatedConfiguration.baseForegroundColor = .white
|
||||
}
|
||||
|
||||
updatedConfiguration.background.backgroundColor = reason.backgroundColor
|
||||
self.configuration = updatedConfiguration
|
||||
}
|
||||
|
||||
public enum Reason {
|
||||
case newPosts
|
||||
case postSent
|
||||
|
Loading…
x
Reference in New Issue
Block a user