updates plug with all sorts of awesome improvements

This commit is contained in:
2026-11-09 13:09:09 +01:00
parent a92d6f8871
commit 3afdb6d67f
553 changed files with 22780 additions and 13155 deletions
+9 -1
View File
@@ -20,9 +20,10 @@ enum TitleBarDoubleClick: Equatable {
}
}
/// The top of the window, over the text under the transparent title bar: it moves the window and never draws.
/// The top of the window, over the text under the transparent title bar: it moves the window and covers the text that scrolls under the buttons.
final class DragStripView: NSView {
static let height: CGFloat = 28
static let fadeHeight: CGFloat = 8
weak var scrollTarget: NSScrollView?
weak var dropTarget: NSTextView?
@@ -33,6 +34,13 @@ final class DragStripView: NSView {
/// The window drags at once, also when it is not key.
override func acceptsFirstMouse(for event: NSEvent?) -> Bool { true }
override func draw(_ dirtyRect: NSRect) {
let (fade, solid) = bounds.divided(atDistance: Self.fadeHeight, from: isFlipped ? .maxYEdge : .minYEdge)
Theme.paper.setFill()
solid.fill()
NSGradient(starting: Theme.paper.withAlphaComponent(0), ending: Theme.paper)?.draw(in: fade, angle: isFlipped ? -90 : 90)
}
/// Leaves the window buttons to themselves.
override func hitTest(_ point: NSPoint) -> NSView? {
guard let view = super.hitTest(point) else { return nil }