diff --git a/Sources/Photochk/PhotochkApp.swift b/Sources/Photochk/PhotochkApp.swift new file mode 100644 index 0000000..4a162e6 --- /dev/null +++ b/Sources/Photochk/PhotochkApp.swift @@ -0,0 +1,25 @@ +import SwiftUI + +@main +struct PhotochkApp: App { + @State private var model = ScanViewModel() + + var body: some Scene { + WindowGroup { + ContentView(model: model) + .task { model.restorePreviousFolder() } + } + .defaultSize(width: 1120, height: 760) + .commands { + CommandGroup(replacing: .newItem) { + Button("フォルダを選ぶ…") { model.chooseFolder() } + .keyboardShortcut("o", modifiers: .command) + } + CommandGroup(after: .toolbar) { + Button("再スキャン") { model.rescan() } + .keyboardShortcut("r", modifiers: .command) + .disabled(model.folder == nil || model.isScanning) + } + } + } +}