feat: scroll results beneath transparent launcher bars
This commit is contained in:
@@ -266,6 +266,8 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe
|
||||
scrollView.drawsBackground = false
|
||||
scrollView.contentView.drawsBackground = false
|
||||
scrollView.horizontalScrollElasticity = .none
|
||||
scrollView.automaticallyAdjustsContentInsets = false
|
||||
scrollView.contentInsets = NSEdgeInsets(top: 16, left: 0, bottom: 16, right: 0)
|
||||
|
||||
statusLabel.font = .systemFont(ofSize: 12)
|
||||
statusLabel.textColor = SunsetPalette.secondaryText
|
||||
@@ -310,7 +312,7 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe
|
||||
footer.orientation = .horizontal
|
||||
footer.alignment = .centerY
|
||||
footer.spacing = 12
|
||||
for view in [header, sectionLabel, scrollView, emptyLabel, footer] {
|
||||
for view in [scrollView, header, sectionLabel, emptyLabel, footer] {
|
||||
view.translatesAutoresizingMaskIntoConstraints = false
|
||||
content.addSubview(view)
|
||||
}
|
||||
@@ -323,10 +325,10 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe
|
||||
symbol.heightAnchor.constraint(equalToConstant: 22),
|
||||
sectionLabel.topAnchor.constraint(equalTo: header.bottomAnchor, constant: 16),
|
||||
sectionLabel.leadingAnchor.constraint(equalTo: content.leadingAnchor, constant: 16),
|
||||
scrollView.topAnchor.constraint(equalTo: sectionLabel.bottomAnchor, constant: 6),
|
||||
scrollView.topAnchor.constraint(equalTo: sectionLabel.bottomAnchor, constant: -10),
|
||||
scrollView.leadingAnchor.constraint(equalTo: content.leadingAnchor, constant: 8),
|
||||
scrollView.trailingAnchor.constraint(equalTo: content.trailingAnchor, constant: -8),
|
||||
scrollView.bottomAnchor.constraint(equalTo: footer.topAnchor, constant: -8),
|
||||
scrollView.bottomAnchor.constraint(equalTo: footer.topAnchor, constant: 8),
|
||||
emptyLabel.centerXAnchor.constraint(equalTo: scrollView.centerXAnchor),
|
||||
emptyLabel.centerYAnchor.constraint(equalTo: scrollView.centerYAnchor),
|
||||
emptyLabel.leadingAnchor.constraint(greaterThanOrEqualTo: content.leadingAnchor, constant: 16),
|
||||
@@ -927,7 +929,7 @@ final class LauncherScrollView: NSScrollView {
|
||||
|
||||
override func layout() {
|
||||
super.layout()
|
||||
let fade = min(0.5, 16 / max(bounds.height, 1))
|
||||
let fade = min(0.5, 32 / max(bounds.height, 1))
|
||||
CATransaction.begin()
|
||||
CATransaction.setDisableActions(true)
|
||||
edgeFade.frame = bounds
|
||||
|
||||
Reference in New Issue
Block a user