Add app entry point
This commit is contained in:
@@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user