feat: add MenuBarView with start/stop, settings, and error display
This commit is contained in:
parent
dbe3294201
commit
1c9b44ab6b
1 changed files with 43 additions and 0 deletions
43
MyVoxtral/MyVoxtral/Views/MenuBarView.swift
Normal file
43
MyVoxtral/MyVoxtral/Views/MenuBarView.swift
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
import SwiftUI
|
||||||
|
|
||||||
|
struct MenuBarView: View {
|
||||||
|
@ObservedObject var manager: TranscriptionManager
|
||||||
|
@ObservedObject var settings = AppSettings.shared
|
||||||
|
let onShowTranscription: () -> Void
|
||||||
|
let onShowSettings: () -> Void
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
VStack(spacing: 4) {
|
||||||
|
Button(manager.isRecording ? "Stop Recording" : "Start Recording") {
|
||||||
|
manager.toggle()
|
||||||
|
}
|
||||||
|
.keyboardShortcut("r")
|
||||||
|
|
||||||
|
if case .error(let msg) = manager.state {
|
||||||
|
Text(msg)
|
||||||
|
.font(.caption)
|
||||||
|
.foregroundStyle(.red)
|
||||||
|
.lineLimit(2)
|
||||||
|
.padding(.horizontal, 8)
|
||||||
|
}
|
||||||
|
|
||||||
|
Divider()
|
||||||
|
|
||||||
|
Button("Show Transcription") {
|
||||||
|
onShowTranscription()
|
||||||
|
}
|
||||||
|
|
||||||
|
Button("Settings...") {
|
||||||
|
onShowSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
Divider()
|
||||||
|
|
||||||
|
Button("Quit") {
|
||||||
|
NSApplication.shared.terminate(nil)
|
||||||
|
}
|
||||||
|
.keyboardShortcut("q")
|
||||||
|
}
|
||||||
|
.padding(.vertical, 4)
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue