new ui
This commit is contained in:
@@ -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])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user