- 创建 Chromium/Electron 应用检测器 - 设计喜报风格的 UI 界面 - 添加应用列表查看功能 - 配置应用图标和颜色资源 - 添加 README 文档 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
57 lines
1.3 KiB
Swift
57 lines
1.3 KiB
Swift
//
|
|
// ChromiumBasedAppListView.swift
|
|
// ChromiumCertificate
|
|
//
|
|
// Created by Astrian Zheng on 14/7/2025.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ChromiumBasedAppListView: View {
|
|
@Binding var isPresented: Bool
|
|
|
|
let chromiumAppsList: [ChromiumApp] = ChromiumDetector.detectChromiumApps()
|
|
|
|
var body: some View {
|
|
VStack(spacing: 0) {
|
|
HStack {
|
|
Text("所有带有 Chromium 的应用程序").font(.headline)
|
|
Spacer()
|
|
Button {
|
|
self.isPresented.toggle()
|
|
} label: {
|
|
Text("关闭")
|
|
}
|
|
}.padding()
|
|
|
|
Divider()
|
|
|
|
ScrollView {
|
|
if chromiumAppsList.isEmpty {
|
|
Text("你的电脑没有遭受 Chromium 的荼毒!望君继续努力。").multilineTextAlignment(.center).padding()
|
|
}
|
|
VStack(spacing: 8) {
|
|
ForEach(Array(chromiumAppsList.enumerated()), id: \.element.id) { index, chromiumApp in
|
|
HStack {
|
|
VStack(alignment: .leading) {
|
|
Text(chromiumApp.name).bold()
|
|
Text(chromiumApp.path)
|
|
.font(.system(.caption, design: .monospaced))
|
|
}
|
|
Spacer()
|
|
}
|
|
|
|
if index < chromiumAppsList.count - 1 {
|
|
Divider()
|
|
}
|
|
}
|
|
}.padding()
|
|
}
|
|
}.frame(width: 300).frame(minHeight: 0, maxHeight: 300)
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
ChromiumBasedAppListView(isPresented: .constant(true))
|
|
}
|