diff --git a/Gifski/Assets.xcassets/BackgroundImage.imageset/BackgroundImage.png b/Gifski/Assets.xcassets/BackgroundImage.imageset/BackgroundImage.png new file mode 100644 index 00000000..14592358 Binary files /dev/null and b/Gifski/Assets.xcassets/BackgroundImage.imageset/BackgroundImage.png differ diff --git a/Gifski/Assets.xcassets/BackgroundImage.imageset/BackgroundImage@2x.png b/Gifski/Assets.xcassets/BackgroundImage.imageset/BackgroundImage@2x.png new file mode 100644 index 00000000..e6f407a2 Binary files /dev/null and b/Gifski/Assets.xcassets/BackgroundImage.imageset/BackgroundImage@2x.png differ diff --git a/Gifski/Assets.xcassets/BackgroundImage.imageset/Contents.json b/Gifski/Assets.xcassets/BackgroundImage.imageset/Contents.json new file mode 100644 index 00000000..24951baa --- /dev/null +++ b/Gifski/Assets.xcassets/BackgroundImage.imageset/Contents.json @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "mac", + "filename" : "BackgroundImage.png", + "scale" : "1x" + }, + { + "idiom" : "mac", + "filename" : "BackgroundImage@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Gifski/Constants.swift b/Gifski/Constants.swift index 0a174a3d..a2f28f92 100644 --- a/Gifski/Constants.swift +++ b/Gifski/Constants.swift @@ -11,4 +11,5 @@ extension Defaults.Keys { struct Constants { static let defaultWindowSize = CGSize(width: 360, height: 240) + static let backgroundImage = NSImage(named: "BackgroundImage")! } diff --git a/Gifski/VideoDropView.swift b/Gifski/VideoDropView.swift index b79f5148..3723cbb6 100644 --- a/Gifski/VideoDropView.swift +++ b/Gifski/VideoDropView.swift @@ -67,6 +67,11 @@ class DropView: SSView { override func draw(_ dirtyRect: CGRect) { super.draw(dirtyRect) + // We only draw it when the drop view controller is the main view controller. + if window?.contentViewController is VideoDropViewController { + Constants.backgroundImage.draw(in: dirtyRect) + } + if isDraggingHighlighted { highlightColor.set() let path = NSBezierPath(rect: bounds) diff --git a/Gifski/VideoDropViewController.swift b/Gifski/VideoDropViewController.swift index 974a4dbf..8dcb8b9e 100644 --- a/Gifski/VideoDropViewController.swift +++ b/Gifski/VideoDropViewController.swift @@ -2,8 +2,9 @@ import AppKit final class VideoDropViewController: NSViewController { private let videoValidator = VideoValidator() + private lazy var videoDropView = with(VideoDropView()) { - $0.dropText = "Drop a Video to Convert to GIF" + $0.dropText = "Drop a Video" $0.onComplete = { [weak self] url in NSApp.activate(ignoringOtherApps: true) self?.convert(url) diff --git a/Stuff/BackgroundImage.sketch b/Stuff/BackgroundImage.sketch new file mode 100644 index 00000000..33bbd863 Binary files /dev/null and b/Stuff/BackgroundImage.sketch differ