Some styling in pick-server-header (#690)
This commit is contained in:
parent
00a05514a9
commit
4ce111164d
|
@ -23,8 +23,24 @@ extension CategoryPickerSection {
|
|||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: String(describing: PickServerCategoryCollectionViewCell.self), for: indexPath) as! PickServerCategoryCollectionViewCell
|
||||
cell.categoryView.titleLabel.text = item.title
|
||||
cell.observe(\.isSelected, options: [.initial, .new]) { cell, _ in
|
||||
// cell.categoryView.highlightedIndicatorView.alpha = cell.isSelected ? 1 : 0
|
||||
cell.categoryView.titleLabel.textColor = cell.isSelected ? Asset.Colors.Label.primary.color : Asset.Colors.Label.secondary.color
|
||||
|
||||
let textColor: UIColor
|
||||
let backgroundColor: UIColor
|
||||
let borderColor: UIColor
|
||||
|
||||
if cell.isSelected {
|
||||
textColor = .white
|
||||
backgroundColor = Asset.Colors.Primary._700.color
|
||||
borderColor = Asset.Colors.Primary._700.color
|
||||
} else {
|
||||
textColor = .label
|
||||
backgroundColor = .clear
|
||||
borderColor = .separator
|
||||
}
|
||||
|
||||
cell.categoryView.backgroundColor = backgroundColor
|
||||
cell.categoryView.titleLabel.textColor = textColor
|
||||
cell.categoryView.layer.borderColor = borderColor.cgColor
|
||||
}
|
||||
.store(in: &cell.observations)
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class PickServerCategoryView: UIView {
|
|||
let titleLabel: UILabel = {
|
||||
let label = UILabel()
|
||||
label.textAlignment = .center
|
||||
label.font = .systemFont(ofSize: 15, weight: .semibold)
|
||||
label.font = .systemFont(ofSize: 15, weight: .regular)
|
||||
label.textColor = Asset.Colors.Label.secondary.color
|
||||
return label
|
||||
}()
|
||||
|
|
Loading…
Reference in New Issue