24 lines
676 B
Swift
24 lines
676 B
Swift
import SwiftUI
|
|
|
|
/// The secondary interface: status and shortcut while working in another app.
|
|
struct MenuBarContent: View {
|
|
@EnvironmentObject private var model: AppModel
|
|
@Environment(\.openWindow) private var openWindow
|
|
|
|
var body: some View {
|
|
Text(model.statusLine)
|
|
if let error = model.lastError {
|
|
Text(error)
|
|
}
|
|
Divider()
|
|
Button(Strings.openApp) {
|
|
openWindow(id: "main")
|
|
model.show(model.section)
|
|
}
|
|
SettingsLink { Text(Strings.settings) }
|
|
Divider()
|
|
Button(Strings.quit) { NSApplication.shared.terminate(nil) }
|
|
.keyboardShortcut("q")
|
|
}
|
|
}
|