Native macOS app for posting to Mastodon, WordPress (self-hosted), and Micro.blog. Features: global hotkey (Ctrl+Option+Cmd+T), multiple accounts with selection, image attachments (up to 4, drag-and-drop), floating panel UI, Keychain storage.
47 lines
1.2 KiB
Swift
47 lines
1.2 KiB
Swift
import SwiftUI
|
|
|
|
struct MenuBarView: View {
|
|
let accountStore: AccountStore
|
|
let onOpenPanel: () -> Void
|
|
let onOpenSettings: () -> Void
|
|
|
|
var body: some View {
|
|
VStack(spacing: 0) {
|
|
Button("New Post...") {
|
|
onOpenPanel()
|
|
}
|
|
.keyboardShortcut("n")
|
|
|
|
Divider()
|
|
|
|
if !accountStore.accounts.isEmpty {
|
|
ForEach(accountStore.accounts) { account in
|
|
HStack {
|
|
Image(systemName: account.serviceType.iconName)
|
|
.frame(width: 16)
|
|
Text(account.displayName)
|
|
.lineLimit(1)
|
|
}
|
|
.padding(.horizontal, 8)
|
|
.padding(.vertical, 2)
|
|
}
|
|
|
|
Divider()
|
|
}
|
|
|
|
Button("Settings...") {
|
|
onOpenSettings()
|
|
}
|
|
.keyboardShortcut(",")
|
|
|
|
Divider()
|
|
|
|
Button("Quit qStatus") {
|
|
NSApplication.shared.terminate(nil)
|
|
}
|
|
.keyboardShortcut("q")
|
|
}
|
|
.frame(width: 200)
|
|
.padding(.vertical, 4)
|
|
}
|
|
}
|