mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 20:54:51 +00:00
reduce padding in packlist
This commit is contained in:
1 file changed
+10
-13
@@ -61,33 +61,30 @@ class MessagesPackListView: UITableViewController {
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell: UITableViewCell = tableView.cellForRow(at: indexPath) ?? .init()
|
||||
|
||||
guard indexPath.section == 1 else {
|
||||
var config = cell.defaultContentConfiguration()
|
||||
|
||||
config.text = "All"
|
||||
config.directionalLayoutMargins = .zero
|
||||
cell.layoutMargins = UIEdgeInsets(top: 4, left: 4, bottom: 4, right: 4)
|
||||
cell.separatorInset = UIEdgeInsets(top: 0, left: 4, bottom: 0, right: 0)
|
||||
cell.preservesSuperviewLayoutMargins = false
|
||||
config.textProperties.font = UIFont.systemFont(ofSize: 14)
|
||||
config.secondaryTextProperties.font = UIFont.systemFont(ofSize: 12)
|
||||
|
||||
if indexPath.section == 0 {
|
||||
config.text = "All"
|
||||
config.textProperties.color = #colorLiteral(red: 0.7490000129, green: 0.3529999852, blue: 0.949000001, alpha: 1)
|
||||
|
||||
let dlCount = emojiHoarder.downloadedStickers.count
|
||||
config.secondaryText = "\(dlCount) download\(dlCount.plural)"
|
||||
config.secondaryTextProperties.font = UIFont.systemFont(ofSize: 12)
|
||||
config.secondaryTextProperties.color = #colorLiteral(red: 0.7490000129, green: 0.3529999852, blue: 0.949000001, alpha: 1)
|
||||
|
||||
cell.contentConfiguration = config
|
||||
return cell
|
||||
}
|
||||
var config = cell.defaultContentConfiguration()
|
||||
|
||||
} else {
|
||||
if let pack = packFor(indexPath: indexPath) {
|
||||
config.text = pack.name
|
||||
config.textProperties.font = UIFont.systemFont(ofSize: 14)
|
||||
|
||||
let dlCount = emojiHoarder.downloadedStickers.intersection(pack.items).count
|
||||
config.secondaryText = pack.downloadedDescription(emojiHoarder)
|
||||
|
||||
config.secondaryTextProperties.font = UIFont.systemFont(ofSize: 12)
|
||||
config.secondaryTextProperties.color = dlCount == 0 ? .systemRed : .systemGray
|
||||
}
|
||||
}
|
||||
|
||||
cell.contentConfiguration = config
|
||||
return cell
|
||||
|
||||