mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Restored files from old Mac, force pushing
This commit is contained in:
parent
5dd95228b8
commit
5040381840
126 changed files with 10431 additions and 67 deletions
52
DynamicIsland/components/Live activities/DownloadView.swift
Normal file
52
DynamicIsland/components/Live activities/DownloadView.swift
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
//
|
||||
// DownloadView.swift
|
||||
// boringNotch
|
||||
//
|
||||
// Created by Harsh Vardhan Goswami on 17/08/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
enum Browser {
|
||||
case safari
|
||||
case chrome
|
||||
}
|
||||
|
||||
struct DownloadFile {
|
||||
var name: String
|
||||
var size: Int
|
||||
var formattedSize: String
|
||||
var browser: Browser
|
||||
}
|
||||
|
||||
class DownloadWatcher: ObservableObject {
|
||||
@Published var downloadFiles: [DownloadFile] = []
|
||||
}
|
||||
|
||||
struct DownloadArea: View {
|
||||
@EnvironmentObject var watcher: DownloadWatcher
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: .center) {
|
||||
HStack {
|
||||
if watcher.downloadFiles.first!.browser == .safari {
|
||||
AppIcon(for: "com.apple.safari")
|
||||
} else {
|
||||
Image(.chrome).resizable().scaledToFit().frame(width: 30, height: 30)
|
||||
}
|
||||
VStack(alignment: .leading) {
|
||||
Text("Download")
|
||||
Text("In progress").font(.system(.footnote)).foregroundStyle(.gray)
|
||||
}
|
||||
}
|
||||
Spacer()
|
||||
HStack(spacing: 12) {
|
||||
VStack(alignment: .trailing) {
|
||||
Text(watcher.downloadFiles.first!.formattedSize)
|
||||
Text(watcher.downloadFiles.first!.name).font(.caption2).foregroundStyle(.gray)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue