Initial commit

This commit is contained in:
2025-01-19 04:43:22 +01:00
commit 31da35961a
35 changed files with 2249 additions and 0 deletions

View File

@ -0,0 +1,54 @@
//
// Ventry_Upload_WatcherApp.swift
// Ventry Upload Watcher
//
// Created by Jan-Marlon Leibl on 18.01.25.
//
import SwiftUI
import AppKit
@main
struct Ventry_Upload_WatcherApp: App {
// MARK: - Properties
// MARK: - Scene
var body: some Scene {
WindowGroup {
ContentView()
.fixedSize()
}
.windowResizability(.contentSize)
MenuBarExtra {
menuContent
} label: {
menuIcon
}
}
// MARK: - Menu Components
@ViewBuilder
private var menuContent: some View {
Button("Show Window") {
NSApp.activate(ignoringOtherApps: true)
NSApp.windows.first?.makeKeyAndOrderFront(nil)
}
Divider()
Button("Quit") {
NSApplication.shared.terminate(nil)
}
.keyboardShortcut("q")
}
@ViewBuilder
private var menuIcon: some View {
if let nsImage = NSImage(named: "ventry-logo-white") {
Image(nsImage: nsImage)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 16, height: 16)
}
}
}