fix: match notes scroll offsets to compact bars

This commit is contained in:
2026-10-19 21:39:00 +02:00
parent 3a638ba9d1
commit 0ec5e87e0b
3 changed files with 8 additions and 4 deletions
@@ -1184,6 +1184,9 @@ final class ApplicationCell: NSTableCellView {
@MainActor
final class LauncherScrollView: NSScrollView {
static let fadeHeight: CGFloat = 32
var edgeFadeHeight: CGFloat = LauncherScrollView.fadeHeight {
didSet { needsLayout = true }
}
private let edgeFade = CAGradientLayer()
override init(frame frameRect: NSRect) {
@@ -1200,7 +1203,7 @@ final class LauncherScrollView: NSScrollView {
override func layout() {
super.layout()
let fade = min(0.5, Self.fadeHeight / max(bounds.height, 1))
let fade = min(0.5, edgeFadeHeight / max(bounds.height, 1))
CATransaction.begin()
CATransaction.setDisableActions(true)
edgeFade.frame = bounds
+3 -2
View File
@@ -120,14 +120,15 @@ final class NotesController: NSViewController, NSTextViewDelegate {
editor.textContainerInset = NSSize(width: 22, height: 8)
editor.setAccessibilityLabel("Note editor")
let scroll = LauncherScrollView()
scroll.edgeFadeHeight = 16
scroll.documentView = editor
scroll.hasVerticalScroller = true
scroll.autohidesScrollers = true
scroll.drawsBackground = false
scroll.scrollerStyle = .overlay
scroll.automaticallyAdjustsContentInsets = false
scroll.contentInsets = NSEdgeInsets(top: LauncherScrollView.fadeHeight, left: 0,
bottom: LauncherScrollView.fadeHeight, right: 0)
scroll.contentInsets = NSEdgeInsets(top: scroll.edgeFadeHeight, left: 0,
bottom: scroll.edgeFadeHeight, right: 0)
status.font = .systemFont(ofSize: 12)
status.textColor = SunsetPalette.secondaryText
status.setAccessibilityLabel("Notes save status")