mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2025-01-25 13:38:43 +01:00
fix: thread leaf loader not using theme color issue
This commit is contained in:
parent
2d46f81b2b
commit
0afa408fb2
@ -18,11 +18,11 @@ final class ThreadReplyLoaderTableViewCell: UITableViewCell {
|
||||
static let cellHeight: CGFloat = 44
|
||||
|
||||
weak var delegate: ThreadReplyLoaderTableViewCellDelegate?
|
||||
var _disposeBag = Set<AnyCancellable>()
|
||||
|
||||
let loadMoreButton: UIButton = {
|
||||
let button = HighlightDimmableButton()
|
||||
button.titleLabel?.font = TimelineLoaderTableViewCell.labelFont
|
||||
button.backgroundColor = Asset.Colors.Background.secondaryGroupedSystemBackground.color
|
||||
button.setTitleColor(Asset.Colors.brandBlue.color, for: .normal)
|
||||
button.setTitle(L10n.Common.Controls.Timeline.Loader.showMoreReplies, for: .normal)
|
||||
return button
|
||||
@ -83,6 +83,15 @@ extension ThreadReplyLoaderTableViewCell {
|
||||
resetSeparatorLineLayout()
|
||||
|
||||
loadMoreButton.addTarget(self, action: #selector(ThreadReplyLoaderTableViewCell.loadMoreButtonDidPressed(_:)), for: .touchUpInside)
|
||||
|
||||
setupBackgroundColor(theme: ThemeService.shared.currentTheme.value)
|
||||
ThemeService.shared.currentTheme
|
||||
.receive(on: RunLoop.main)
|
||||
.sink { [weak self] theme in
|
||||
guard let self = self else { return }
|
||||
self.setupBackgroundColor(theme: theme)
|
||||
}
|
||||
.store(in: &_disposeBag)
|
||||
}
|
||||
|
||||
private func resetSeparatorLineLayout() {
|
||||
@ -113,6 +122,10 @@ extension ThreadReplyLoaderTableViewCell {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func setupBackgroundColor(theme: Theme) {
|
||||
loadMoreButton.backgroundColor = theme.secondarySystemGroupedBackgroundColor
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user