-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
573 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
Pine/Controllers/SplashScreen/SplashScreenRecentDocumentViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// SplashScreenRecentDocumentViewController.swift | ||
// Pine | ||
// | ||
// Created by Luka Kerr on 29/8/19. | ||
// Copyright © 2019 Luka Kerr. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
/// View controller for the "recent document" rows in the tableview in the splash screen. | ||
final class SplashScreenRecentDocumentViewController: NSViewController { | ||
|
||
var url: URL? | ||
|
||
@IBOutlet weak var icon: NSImageView! | ||
@IBOutlet weak var filename: NSTextField! | ||
@IBOutlet weak var path: NSTextField! | ||
|
||
override var nibName: NSNib.Name? { | ||
return NSNib.Name( "SplashScreenRecentDocumentView") | ||
} | ||
|
||
override func viewDidLoad() { | ||
guard let url = url else { return } | ||
icon.image = NSImage(named: "File") | ||
filename.stringValue = (url.lastPathComponent as NSString).deletingPathExtension | ||
path.stringValue = ((url.path as NSString).deletingLastPathComponent as NSString).abbreviatingWithTildeInPath | ||
} | ||
|
||
} |
Oops, something went wrong.