Add app entry point

This commit is contained in:
2026-07-27 15:41:33 +00:00
parent 3a79300887
commit aa7fd997a9
+25
View File
@@ -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)
}
}
}
}