mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Fix timeline, details views for proper toolbar scroll behavior
Both the details and timeline container views were not extending behind the toolbar and thus content would not show when scrolled behind it. Top anchors should anchor to the top of the super view rather than safe area guides and AppKit automatically adjusts the scroll insets for NSToolbar and optionally (if available) NSTitlebarAccessoryViewController. This allows for the divider to appear when content scrolls behind it and for content to "shine through" the translucency of the NSToolbar.
This commit is contained in:
@@ -30,11 +30,10 @@ final class DetailContainerView: NSView, NSTextFinderBarContainer {
|
||||
contentView.translatesAutoresizingMaskIntoConstraints = false
|
||||
addSubview(contentView, positioned: .below, relativeTo: detailStatusBarView)
|
||||
|
||||
// Constrain the content view to fill the available space on all sides except the top, which we'll constrain to the find bar
|
||||
var constraints = constraintsToMakeSubViewFullSize(contentView).filter { $0.firstAttribute != .top }
|
||||
// Constrain the content view to fill the available space on all sides
|
||||
var constraints = constraintsToMakeSubViewFullSize(contentView)
|
||||
|
||||
constraints.append(findBarContainerView.topAnchor.constraint(equalTo: self.safeAreaLayoutGuide.topAnchor))
|
||||
constraints.append(findBarContainerView.bottomAnchor.constraint(equalTo: contentView.topAnchor))
|
||||
NSLayoutConstraint.activate(constraints)
|
||||
contentViewConstraints = constraints
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user