From aa7fd997a97aefc7774b12fb68d8d5e47f710e65 Mon Sep 17 00:00:00 2001 From: yoshikazu Date: Mon, 27 Jul 2026 15:41:33 +0000 Subject: [PATCH] Add app entry point --- Sources/Photochk/PhotochkApp.swift | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Sources/Photochk/PhotochkApp.swift 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) + } + } + } +}