This commit is contained in:
Mark Gregory
2026-10-16 21:34:30 +01:00
parent 2aedde9fe2
commit 773191f206
39 changed files with 324 additions and 252 deletions
+39 -2
View File
@@ -8,10 +8,12 @@ struct WorkbenchReplacementApp: App {
WindowGroup("Workbench Replacement") {
WorkbenchLaunchView()
.environmentObject(model)
.frame(minWidth: 1000, minHeight: 650)
.frame(minWidth: 800, minHeight: 520)
}
.defaultSize(width: 1200, height: 800)
.windowResizability(.contentSize)
.commands {
CommandGroup(replacing: .newItem) {}
WorkbenchFileCommands(model: model)
}
@@ -390,3 +392,38 @@ struct WorkbenchSplashView: View {
.frame(width: 90)
}
}
// MARK: - Workbench File Menu
struct WorkbenchFileCommands: Commands {
@ObservedObject var model: DatabaseModel
var body: some Commands {
CommandGroup(replacing: .newItem) {
Button("New Query Tab") {
model.newQueryTab()
}
.keyboardShortcut("t", modifiers: .command)
}
CommandGroup(after: .newItem) {
Button("Open SQL Script…") {
model.openSQLScript()
}
.keyboardShortcut("o", modifiers: .command)
Divider()
Button("Save SQL Script") {
model.saveSQLScript()
}
.keyboardShortcut("s", modifiers: .command)
Button("Save SQL Script As…") {
model.saveSQLScript(asNewFile: true)
}
.keyboardShortcut("s", modifiers: [.command, .shift])
}
}
}