Skip to content

Commit

Permalink
feat: activate menu on new document
Browse files Browse the repository at this point in the history
work on #25
  • Loading branch information
bsorrentino committed Dec 29, 2023
1 parent 26b1d33 commit 69f4322
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions PlantUML/PlantUMLDiagramMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,21 @@ struct PlantUMLDiagramMenu: View {
@State var activeScreen:MenuItem = .Menu

var body: some View {

switch( activeScreen ) {
case .Menu:
if case .Menu = activeScreen, doc.isNew {
Menu
case .HandDrawn:
PlantUMLDrawingView( name: "Diagram" )
case .HandWritten:
}
else if case .HandDrawn = activeScreen, doc.isNew {
PlantUMLDrawingView( onGeneratedScript: { script in
doc.text = script
activeScreen = .HandWritten
})
}
else {
PlantUMLDocumentView( document: PlantUMLDocumentProxy( document: $doc ))
// [Document based app shows 2 back chevrons on iPad](https://stackoverflow.com/a/74245034/521197)
.toolbarRole(.navigationStack)

}

}
}

Expand Down

0 comments on commit 69f4322

Please sign in to comment.