adds schema view and schema generating command
This commit is contained in:
@@ -130,16 +130,15 @@ private struct PaneToggles: View {
|
||||
}
|
||||
}
|
||||
|
||||
/// Git ⌘G · Search ⌘F · Fluid ⌘L · Hidden ⌘., then `?`. Search is an action; the others toggle.
|
||||
/// While Helder reads aloud, a Stop toggle leads the group; switching it off stops the reading.
|
||||
/// Git ⌘G · Schema ⌘D · Search ⌘F · Fluid ⌘L · Hidden ⌘., then `?`. Search is an action; the others toggle.
|
||||
/// Schema shows only in a Laravel app. While Helder reads aloud, a Stop toggle leads the group.
|
||||
private struct TitleToolbar: View {
|
||||
let model: WorkspaceModel
|
||||
|
||||
var body: some View {
|
||||
let layout = model.layout
|
||||
HStack(spacing: Metrics.toolbarIconGap) {
|
||||
ButtonGroup(stop + [
|
||||
git,
|
||||
ButtonGroup(stop + [git] + schema + [
|
||||
GroupItem("Search", keys: "⌘F", kind: .action,
|
||||
tip: Text("Search the open file, the project and the file names.")) { model.perform(.showSearch(seed: "")) },
|
||||
GroupItem("Fluid", keys: "⌘L", kind: .toggle(isOn: layout.fluid),
|
||||
@@ -173,6 +172,17 @@ private struct TitleToolbar: View {
|
||||
}
|
||||
}
|
||||
|
||||
private var schema: [GroupItem] {
|
||||
guard model.schema?.isLaravelApp == true else { return [] }
|
||||
let open = model.layout.isSchemaViewOpen
|
||||
let tip = open
|
||||
? Tooltip.stated("Schema view: ", "open", ". Click to close it (⌘D).")
|
||||
: Tooltip.stated("Schema view: ", "closed", ". Click to open the database diagram (⌘D).")
|
||||
return [GroupItem("Schema", keys: "⌘D", kind: .toggle(isOn: open), tip: tip) {
|
||||
model.perform(.toggleSchemaView)
|
||||
}]
|
||||
}
|
||||
|
||||
private var stop: [GroupItem] {
|
||||
guard model.readAloud.isReading else { return [] }
|
||||
return [GroupItem("Stop", kind: .toggle(isOn: true), tip: Tooltip.stated("Read aloud: ", "playing", ". Click to stop.")) {
|
||||
|
||||
Reference in New Issue
Block a user