mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Revert "💄 Modernise Sidebar"
Unwind previous commit
This reverts commit 14384e6ad5.
This commit is contained in:
@@ -95,6 +95,17 @@ class MainFeedTableViewSectionHeader: UITableViewHeaderFooterView {
|
||||
return button
|
||||
}()
|
||||
|
||||
private let topSeparatorView: UIView = {
|
||||
let view = UIView()
|
||||
view.backgroundColor = UIColor.separator
|
||||
return view
|
||||
}()
|
||||
|
||||
private let bottomSeparatorView: UIView = {
|
||||
let view = UIView()
|
||||
view.backgroundColor = UIColor.separator
|
||||
return view
|
||||
}()
|
||||
|
||||
override init(reuseIdentifier: String?) {
|
||||
super.init(reuseIdentifier: reuseIdentifier)
|
||||
@@ -134,9 +145,15 @@ private extension MainFeedTableViewSectionHeader {
|
||||
addSubviewAtInit(titleView)
|
||||
addSubviewAtInit(disclosureButton)
|
||||
updateExpandedState(animate: false)
|
||||
addBackgroundView()
|
||||
addSubviewAtInit(topSeparatorView)
|
||||
addSubviewAtInit(bottomSeparatorView)
|
||||
}
|
||||
|
||||
func updateExpandedState(animate: Bool) {
|
||||
if !isLastSection && self.disclosureExpanded {
|
||||
self.bottomSeparatorView.isHidden = false
|
||||
}
|
||||
|
||||
let duration = animate ? 0.3 : 0.0
|
||||
|
||||
@@ -149,6 +166,9 @@ private extension MainFeedTableViewSectionHeader {
|
||||
self.disclosureButton.transform = CGAffineTransform(rotationAngle: 0)
|
||||
}
|
||||
}, completion: { _ in
|
||||
if !self.isLastSection && !self.disclosureExpanded {
|
||||
self.bottomSeparatorView.isHidden = true
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -173,6 +193,21 @@ private extension MainFeedTableViewSectionHeader {
|
||||
titleView.setFrameIfNotEqual(layout.titleRect)
|
||||
unreadCountView.setFrameIfNotEqual(layout.unreadCountRect)
|
||||
disclosureButton.setFrameIfNotEqual(layout.disclosureButtonRect)
|
||||
|
||||
let x = -safeAreaInsets.left
|
||||
let width = safeAreaInsets.left + safeAreaInsets.right + frame.width
|
||||
let height = 0.33
|
||||
|
||||
let top = CGRect(x: x, y: 0, width: width, height: height)
|
||||
topSeparatorView.setFrameIfNotEqual(top)
|
||||
|
||||
let bottom = CGRect(x: x, y: frame.height - height, width: width, height: height)
|
||||
bottomSeparatorView.setFrameIfNotEqual(bottom)
|
||||
}
|
||||
|
||||
func addBackgroundView() {
|
||||
self.backgroundView = UIView(frame: self.bounds)
|
||||
self.backgroundView?.backgroundColor = AppAssets.sectionHeaderColor
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user