Skip to content

Commit

Permalink
feat: substitute LineEditor with CodeViewer
Browse files Browse the repository at this point in the history
work on  issue #22
  • Loading branch information
bsorrentino committed Aug 21, 2023
1 parent e8123a2 commit cfc66af
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions PlantUML/PlantUMLContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import SwiftUI
import Combine
import PlantUMLFramework
import PlantUMLKeyboard
import LineEditor
import CodeViewer

import AppSecureStorage
Expand All @@ -23,7 +22,7 @@ import AppSecureStorage


struct PlantUMLContentView: View {
typealias PlantUMLLineEditorView = StandardLineEditorView<Symbol>
typealias PlantUMLLineEditorView = CodeViewer

@Environment(\.scenePhase) var scene
@Environment(\.interfaceOrientation) var interfaceOrientation: InterfaceOrientationHolder
Expand All @@ -41,7 +40,7 @@ struct PlantUMLContentView: View {

@State var keyboardTab: String = "general"
@State private var isScaleToFit = true
@State private var fontSize = CGFloat(12)
@State private var fontSize = CGFloat(15)
@State private var showLine:Bool = false
@State private var saving = false
@State private var diagramImage:UIImage?
Expand Down Expand Up @@ -145,13 +144,22 @@ extension PlantUMLContentView {

var EditorView_Fragment: some View {

PlantUMLLineEditorView( text: $document.text,
fontSize: $fontSize,
showLine: $showLine) { onHide, onPressSymbol in
PlantUMLKeyboardView( selectedTab: $keyboardTab,
onHide: onHide,
onPressSymbol: onPressSymbol)
}

PlantUMLLineEditorView( content: $document.text,
mode: .plain_text,
darkTheme: .terminal,
lightTheme: .chrome,
isReadOnly: false,
fontSize: fontSize
)

// PlantUMLLineEditorView( text: $document.text,
// fontSize: $fontSize,
// showLine: $showLine) { onHide, onPressSymbol in
// PlantUMLKeyboardView( selectedTab: $keyboardTab,
// onHide: onHide,
// onPressSymbol: onPressSymbol)
// }
}

// [SwiftUI Let View disappear automatically](https://stackoverflow.com/a/60820491/521197)
Expand Down

0 comments on commit cfc66af

Please sign in to comment.