fix: keep resting content below the top fade

The 32-point viewport fade covered launcher rows with only 16 points of inset and emoji with only 12. Match their top spacing to the shared fade height while keeping the viewport mask fixed during scrolling.
This commit is contained in:
Valdemar Lorenzen
2026-10-16 09:26:04 +02:00
parent f579d43b00
commit 27c203b336
5 changed files with 53 additions and 5 deletions
+2 -2
View File
@@ -39,7 +39,7 @@ final class EmojiPickerController: NSViewController, NSCollectionViewDataSource,
layout.itemSize = NSSize(width: 64, height: 56)
layout.minimumInteritemSpacing = 6
layout.minimumLineSpacing = 6
layout.sectionInset = NSEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
layout.sectionInset = NSEdgeInsets(top: LauncherScrollView.fadeHeight, left: 16, bottom: 12, right: 16)
collection.collectionViewLayout = layout
collection.backgroundColors = [.clear]
collection.dataSource = self
@@ -260,7 +260,7 @@ final class EmojiPickerController: NSViewController, NSCollectionViewDataSource,
}
func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, insetForSectionAt section: Int) -> NSEdgeInsets {
NSEdgeInsets(top: section == 1 ? 18 : 12, left: 16, bottom: splitFavorites && section == 0 ? 0 : 12, right: 16)
NSEdgeInsets(top: section == 1 ? 18 : LauncherScrollView.fadeHeight, left: 16, bottom: splitFavorites && section == 0 ? 0 : 12, right: 16)
}
func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem {
@@ -310,7 +310,7 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe
scrollView.contentView.drawsBackground = false
scrollView.horizontalScrollElasticity = .none
scrollView.automaticallyAdjustsContentInsets = false
scrollView.contentInsets = NSEdgeInsets(top: 16, left: 0, bottom: 16, right: 0)
scrollView.contentInsets = NSEdgeInsets(top: LauncherScrollView.fadeHeight, left: 0, bottom: 16, right: 0)
statusLabel.font = .systemFont(ofSize: 12)
statusLabel.textColor = SunsetPalette.secondaryText
@@ -1079,6 +1079,7 @@ final class ApplicationCell: NSTableCellView {
@MainActor
final class LauncherScrollView: NSScrollView {
static let fadeHeight: CGFloat = 32
private let edgeFade = CAGradientLayer()
override init(frame frameRect: NSRect) {
@@ -1095,7 +1096,7 @@ final class LauncherScrollView: NSScrollView {
override func layout() {
super.layout()
let fade = min(0.5, 32 / max(bounds.height, 1))
let fade = min(0.5, Self.fadeHeight / max(bounds.height, 1))
CATransaction.begin()
CATransaction.setDisableActions(true)
edgeFade.frame = bounds