qstatus/qStatus/Views/MenuBarView.swift
Paweł Orzech c27437b33c
Initial implementation of qStatus macOS menubar app
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.
2026-02-27 23:40:51 +01:00

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)
}
}