fix(notes): move transcription button
This commit is contained in:
@@ -175,6 +175,7 @@ struct NoteEditorContentView: View {
|
|||||||
@ObservedObject var note: Note
|
@ObservedObject var note: Note
|
||||||
@Environment(\.managedObjectContext) private var viewContext
|
@Environment(\.managedObjectContext) private var viewContext
|
||||||
let onAddNote: () -> Void
|
let onAddNote: () -> Void
|
||||||
|
@State private var showTranscription = false
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
@@ -194,6 +195,17 @@ struct NoteEditorContentView: View {
|
|||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
|
Button(action: {
|
||||||
|
withAnimation {
|
||||||
|
showTranscription.toggle()
|
||||||
|
}
|
||||||
|
}) {
|
||||||
|
Image(systemName: showTranscription ? "text.bubble.fill" : "text.bubble")
|
||||||
|
.font(.body)
|
||||||
|
.foregroundColor(showTranscription ? .blue : .primary)
|
||||||
|
}
|
||||||
|
.padding(.trailing, 8)
|
||||||
|
|
||||||
Button(action: onAddNote) {
|
Button(action: onAddNote) {
|
||||||
Image(systemName: "plus")
|
Image(systemName: "plus")
|
||||||
.font(.body)
|
.font(.body)
|
||||||
@@ -219,7 +231,8 @@ struct NoteEditorContentView: View {
|
|||||||
// Note editor content
|
// Note editor content
|
||||||
NoteEditorContentOnly(
|
NoteEditorContentOnly(
|
||||||
drawing: bindingForDrawing(),
|
drawing: bindingForDrawing(),
|
||||||
text: bindingForText()
|
text: bindingForText(),
|
||||||
|
showTranscription: $showTranscription
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
.background(Color(.systemGroupedBackground))
|
.background(Color(.systemGroupedBackground))
|
||||||
@@ -258,9 +271,9 @@ struct NoteEditorContentView: View {
|
|||||||
struct NoteEditorContentOnly: View {
|
struct NoteEditorContentOnly: View {
|
||||||
@Binding var drawing: PKDrawing
|
@Binding var drawing: PKDrawing
|
||||||
@Binding var text: String
|
@Binding var text: String
|
||||||
|
@Binding var showTranscription: Bool
|
||||||
|
|
||||||
@State private var isRecognizing = false
|
@State private var isRecognizing = false
|
||||||
@State private var showTranscription = false
|
|
||||||
@State private var viewAppeared = false
|
@State private var viewAppeared = false
|
||||||
@State private var recognitionWorkItem: DispatchWorkItem?
|
@State private var recognitionWorkItem: DispatchWorkItem?
|
||||||
|
|
||||||
@@ -334,24 +347,6 @@ struct NoteEditorContentOnly: View {
|
|||||||
.padding()
|
.padding()
|
||||||
.transition(.move(edge: .bottom).combined(with: .opacity))
|
.transition(.move(edge: .bottom).combined(with: .opacity))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Toggle transcription button
|
|
||||||
if !showTranscription {
|
|
||||||
Button(action: {
|
|
||||||
withAnimation {
|
|
||||||
showTranscription = true
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
HStack {
|
|
||||||
Image(systemName: "text.bubble")
|
|
||||||
Text("Show Transcription")
|
|
||||||
}
|
|
||||||
.font(.subheadline)
|
|
||||||
.foregroundColor(.blue)
|
|
||||||
.padding(.vertical, 8)
|
|
||||||
}
|
|
||||||
.padding(.bottom)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user