Remove About, reorder Pro section

This commit is contained in:
Beingpax 2025-04-19 13:32:51 +05:45
parent 07b9da74dd
commit ffa9782eec
4 changed files with 12 additions and 160 deletions

View File

@ -1,147 +0,0 @@
import SwiftUI
import AppKit
struct AboutView: View {
@Environment(\.colorScheme) private var colorScheme
let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown"
var body: some View {
GeometryReader { geometry in
ScrollView {
VStack {
Spacer()
CardView {
VStack(spacing: 30) {
appLogo
appDescription
featuresSection
contactInfo
}
.padding()
}
.frame(width: min(geometry.size.width * 0.9, 600))
.frame(minHeight: min(geometry.size.height * 0.9, 800))
Spacer()
}
.frame(minWidth: geometry.size.width, minHeight: geometry.size.height)
}
.padding() // Add padding here
}
}
private var appLogo: some View {
Group {
if let image = NSImage(named: "AppIcon") {
Image(nsImage: image)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 128, height: 128)
.cornerRadius(16)
.shadow(radius: 5)
} else {
Image(systemName: "questionmark.app.dashed")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 128, height: 128)
.foregroundColor(.secondary)
}
}
.accessibilityLabel("VoiceInk App Icon")
}
private var appDescription: some View {
VStack(spacing: 10) {
Text("VoiceInk")
.font(.system(size: 36, weight: .bold, design: .rounded))
.foregroundColor(.primary)
Text("Version \(appVersion)")
.font(.subheadline)
.foregroundColor(.secondary)
Text("VoiceInk is a powerful voice-to-text application that leverages local whisper AI models to provide accurate and efficient transcription in real-time.")
.font(.body)
.multilineTextAlignment(.center)
.padding()
.frame(maxWidth: 600)
}
}
private var featuresSection: some View {
VStack(alignment: .leading, spacing: 15) {
Text("Key Features")
.font(.headline)
.padding(.bottom, 5)
FeatureRow(icon: "waveform", text: "Real-time transcription")
FeatureRow(icon: "globe", text: "Support for multiple languages")
FeatureRow(icon: "keyboard", text: "Global hotkey for quick access")
FeatureRow(icon: "chart.bar", text: "VoiceInk insights and metrics")
FeatureRow(icon: "lock.shield", text: "Privacy-focused with local processing")
}
.padding()
.background(RoundedRectangle(cornerRadius: 10).fill(Color(.controlBackgroundColor)))
.shadow(color: Color.black.opacity(0.1), radius: 5, x: 0, y: 2)
}
private var contactInfo: some View {
VStack(spacing: 15) {
Text("Contact Us")
.font(.headline)
Button(action: {
if let url = URL(string: "mailto:prakashjoshipax@gmail.com?subject=VoiceInk%20Help%20%26%20Support") {
NSWorkspace.shared.open(url)
}
}) {
Text("prakashjoshipax@gmail.com")
.underline()
.foregroundColor(.blue)
}
.buttonStyle(PlainButtonStyle())
Text("© 2025 VoiceInk. All rights reserved.")
.font(.caption)
.foregroundColor(.secondary)
}
.padding()
.background(RoundedRectangle(cornerRadius: 10).fill(Color(.controlBackgroundColor)))
.shadow(color: Color.black.opacity(0.1), radius: 5, x: 0, y: 2)
}
}
struct FeatureRow: View {
let icon: String
let text: String
var body: some View {
HStack(spacing: 15) {
Image(systemName: icon)
.foregroundColor(.blue)
.frame(width: 24, height: 24)
Text(text)
.font(.body)
}
}
}
struct CardView<Content: View>: View {
let content: Content
init(@ViewBuilder content: () -> Content) {
self.content = content()
}
var body: some View {
content
.background(Color(.controlBackgroundColor))
.cornerRadius(20)
.shadow(color: Color.black.opacity(0.2), radius: 10, x: 0, y: 5)
}
}
struct AboutView_Previews: PreviewProvider {
static var previews: some View {
AboutView()
}
}

View File

@ -14,9 +14,8 @@ enum ViewType: String, CaseIterable {
case permissions = "Permissions"
case audioInput = "Audio Input"
case dictionary = "Dictionary"
case license = "VoiceInk Pro"
case settings = "Settings"
case about = "About"
case license = "VoiceInk Pro"
var icon: String {
switch self {
@ -30,9 +29,8 @@ enum ViewType: String, CaseIterable {
case .permissions: return "shield.fill"
case .audioInput: return "mic.fill"
case .dictionary: return "character.book.closed.fill"
case .license: return "checkmark.seal.fill"
case .settings: return "gearshape.fill"
case .about: return "info.circle.fill"
case .license: return "checkmark.seal.fill"
}
}
}
@ -258,8 +256,6 @@ struct ContentView: View {
case .settings:
SettingsView()
.environmentObject(whisperState)
case .about:
AboutView()
case .license:
LicenseManagementView()
case .permissions:

View File

@ -3,6 +3,7 @@ import SwiftUI
struct LicenseManagementView: View {
@StateObject private var licenseViewModel = LicenseViewModel()
@Environment(\.colorScheme) private var colorScheme
let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown"
var body: some View {
ScrollView {
@ -43,8 +44,15 @@ struct LicenseManagementView: View {
.font(.system(size: 32))
.foregroundStyle(.blue)
Text(licenseViewModel.licenseState == .licensed ? "VoiceInk Pro" : "Upgrade to Pro")
.font(.system(size: 32, weight: .bold))
HStack(alignment: .lastTextBaseline, spacing: 8) {
Text(licenseViewModel.licenseState == .licensed ? "VoiceInk Pro" : "Upgrade to Pro")
.font(.system(size: 32, weight: .bold))
Text("v\(appVersion)")
.font(.subheadline)
.foregroundColor(.secondary)
.padding(.bottom, 4)
}
}
Text(licenseViewModel.licenseState == .licensed ?

View File

@ -187,11 +187,6 @@ struct MenuBarView: View {
}
.disabled(!updaterViewModel.canCheckForUpdates)
Button("About VoiceInk") {
NSApplication.shared.orderFrontStandardAboutPanel(nil)
NSApp.activate(ignoringOtherApps: true)
}
Button("Help and Support") {
openMailForSupport()
}