From 018ddbc8c190ba5e1c11def0b4ceff9a9deaac33 Mon Sep 17 00:00:00 2001 From: Gerrit Linnemann Date: Fri, 28 Aug 2020 19:54:32 +0200 Subject: [PATCH] ... --- YAPS/YAPS/AppDelegate.swift | 19 +- YAPS/YAPS/Base.lproj/Main.storyboard | 498 +-------------------------- YAPS/YAPS/Shared.swift | 5 +- 3 files changed, 37 insertions(+), 485 deletions(-) diff --git a/YAPS/YAPS/AppDelegate.swift b/YAPS/YAPS/AppDelegate.swift index edfa3c8..8d40d93 100644 --- a/YAPS/YAPS/AppDelegate.swift +++ b/YAPS/YAPS/AppDelegate.swift @@ -25,7 +25,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView], backing: .buffered, defer: false) window.center() - window.setFrameAutosaveName("Main Window") + window.setFrameAutosaveName("YAPS Main Window") window.contentView = NSHostingView(rootView: contentView) window.makeKeyAndOrderFront(nil) } @@ -48,6 +48,10 @@ class AppDelegate: NSObject, NSApplicationDelegate { } */ + @IBAction func openFolder(_ sender: Any) { + + } + @IBAction func getIt(_ sender: Any) { if !Shared.shared.destinationDefined { Shared.shared.destination = FinderHelper.shared.selectFolder(modalTitle: "Choose destination folder.") @@ -55,5 +59,16 @@ class AppDelegate: NSObject, NSApplicationDelegate { } FinderHelper.shared.iLikeThisImage(yapsFile: Shared.shared.currentFile, destination: Shared.shared.destination) } + + @IBAction func zoomIn(_ sender: Any) { + //scrollView.magnification += 0.25 + } + + @IBAction func zoomOut(_ sender: Any) { + //scrollView.magnification -= 0.25 + } + + @IBAction func zoomToFit(_ sender: Any) { + //scrollView.magnify(toFit: imageView.frame) + } } - diff --git a/YAPS/YAPS/Base.lproj/Main.storyboard b/YAPS/YAPS/Base.lproj/Main.storyboard index bc8a578..36eeaad 100644 --- a/YAPS/YAPS/Base.lproj/Main.storyboard +++ b/YAPS/YAPS/Base.lproj/Main.storyboard @@ -65,7 +65,7 @@ - + @@ -117,487 +117,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -643,6 +162,21 @@ + + + + + + + + + + + + + + + diff --git a/YAPS/YAPS/Shared.swift b/YAPS/YAPS/Shared.swift index 28b4993..86a9d76 100644 --- a/YAPS/YAPS/Shared.swift +++ b/YAPS/YAPS/Shared.swift @@ -7,11 +7,14 @@ // import Foundation +import SwiftUI class Shared: ObservableObject { static let shared = Shared() - var currentFile: YapsFile = YapsFile(index: -1, name: "EMPTY", file: .init(fileURLWithPath: "Y"), current: false) + @Published var fileList = [YapsFile]() + @Published var currentFile: YapsFile = YapsFile(index: -1, name: "EMPTY", file: .init(fileURLWithPath: "Y"), current: false) + var destination: URL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] var destinationDefined: Bool = false