Skip to content

Commit

Permalink
Merge pull request #2 from IdeasOnCanvas/saveDialoge
Browse files Browse the repository at this point in the history
add info in savePanel
  • Loading branch information
Patrick-Kladek authored Dec 22, 2017
2 parents 69d76bf + 37c6b5b commit 9c8c04d
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions Screenshot Framer/Document.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ final class Document: NSDocument {

// MARK: - Override

override class var autosavesInPlace: Bool {
return true
}
override class var autosavesInPlace: Bool { return true }

override var shouldRunSavePanelWithAccessoryView: Bool { return true }

override func makeWindowControllers() {
let windowController = DocumentWindowController()
Expand All @@ -48,6 +48,19 @@ final class Document: NSDocument {
}
}

override func prepareSavePanel(_ savePanel: NSSavePanel) -> Bool {
let accessoryView = NSView(frame: CGRect(x: 0, y: 0, width: savePanel.frame.width, height: 60))
let detailLabel = NSTextField(labelWithString: "Screenshot Framer needs a project directory to start.\nYou will be able to access all files in this directory but no files outside of this directory")

detailLabel.frame = CGRect(x: 0, y: 15, width: savePanel.frame.width, height: detailLabel.frame.height)
detailLabel.alignment = .center
detailLabel.maximumNumberOfLines = 2

accessoryView.addSubview(detailLabel)
savePanel.accessoryView = accessoryView

return true
}

// Responder Chain

Expand Down

0 comments on commit 9c8c04d

Please sign in to comment.