updates plug with all sorts of awesome improvements
This commit is contained in:
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user