mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-06-11 16:09:48 +08:00
* clean up title model * update title style * organize issue SC method * remove background colors from styled text in issues * collection view bg white * remove card inset and clean up snap superview code * clean up label design * thread is root and change base font size * remove borders on comment cells * adjust collapse design * adjust comment line spacing and make non-root body smaller * refactor detail view * viewer header background color * more buttons in reaction cell * vertical spacers working * design basically finished; * scroll to bottom accounts for inset * PR review background color white * fixup PR review comments * spacing on merge and review * readme background white * rename to just "spacer" * horizontal spacing * fix tests
49 lines
1.2 KiB
Swift
49 lines
1.2 KiB
Swift
//
|
|
// IssueDiffHunkPathCell.swift
|
|
// Freetime
|
|
//
|
|
// Created by Ryan Nystrom on 7/3/17.
|
|
// Copyright © 2017 Ryan Nystrom. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import IGListKit
|
|
|
|
final class IssueDiffHunkPathCell: UICollectionViewCell, ListBindable {
|
|
|
|
let label = UILabel()
|
|
|
|
override init(frame: CGRect) {
|
|
super.init(frame: frame)
|
|
|
|
contentView.backgroundColor = Styles.Colors.Gray.lighter.color
|
|
|
|
label.adjustsFontSizeToFitWidth = true
|
|
label.textColor = Styles.Colors.Gray.dark.color
|
|
label.font = Styles.Text.code.preferredFont
|
|
contentView.addSubview(label)
|
|
label.snp.makeConstraints { make in
|
|
make.centerY.equalToSuperview()
|
|
make.left.equalToSuperview()
|
|
make.width.lessThanOrEqualToSuperview().offset(-Styles.Sizes.rowSpacing)
|
|
}
|
|
}
|
|
|
|
required init?(coder aDecoder: NSCoder) {
|
|
fatalError("init(coder:) has not been implemented")
|
|
}
|
|
|
|
override func layoutSubviews() {
|
|
super.layoutSubviews()
|
|
layoutContentViewForSafeAreaInsets()
|
|
}
|
|
|
|
// MARK: ListBindable
|
|
|
|
func bindViewModel(_ viewModel: Any) {
|
|
guard let viewModel = viewModel as? String else { return }
|
|
label.text = viewModel
|
|
}
|
|
|
|
}
|