Files
gart/code/MacApp/Sources/App.swift
T

62 lines
1.8 KiB
Swift

import SwiftUI
@main
struct GArtApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.frame(minWidth: 720, minHeight: 560)
}
.windowStyle(.automatic)
}
}
enum ActiveTab: Hashable {
case project
case captions
case voiceAnalysis
case models
case about
}
struct ContentView: View {
@State private var activeTab: ActiveTab? = .project
var body: some View {
NavigationSplitView {
List(selection: $activeTab) {
Label("Projeto", systemImage: "film")
.tag(ActiveTab.project)
Label("Legendas Dinâmicas", systemImage: "captions.bubble")
.tag(ActiveTab.captions)
Label("Análise de Voz", systemImage: "waveform")
.tag(ActiveTab.voiceAnalysis)
Label("Modelos", systemImage: "tray.and.arrow.down")
.tag(ActiveTab.models)
Label("Sobre", systemImage: "info.circle")
.tag(ActiveTab.about)
}
.listStyle(.sidebar)
.navigationSplitViewColumnWidth(min: 180, ideal: 200)
} detail: {
switch activeTab {
case .project:
ProjectView().id(UUID())
.navigationTitle("Projeto")
case .captions:
CaptionsView().id(UUID())
.navigationTitle("Legendas Dinâmicas")
case .voiceAnalysis:
VoiceAnalysisView().id(UUID())
.navigationTitle("Análise de Voz")
case .models:
ModelDownloadView().id(UUID())
.navigationTitle("Modelos")
case .about, nil:
AboutView()
.navigationTitle("Sobre")
}
}
}
}