-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Early implementation of download monitor view, accessible by clicking…
… download progressview
- Loading branch information
1 parent
93f6ed0
commit 5657748
Showing
4 changed files
with
67 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// InstallStatus.swift | ||
// Mythic | ||
// | ||
// Created by Esiayo Alegbe on 3/12/2023. | ||
// | ||
|
||
import SwiftUI | ||
import Foundation | ||
import Charts // TBA | ||
|
||
struct InstallStatusView: View { | ||
private let status: Legendary.InstallStatus = Legendary.Installing.installStatus | ||
@Binding var isPresented: Bool | ||
|
||
var body: some View { | ||
VStack { | ||
Text("Downloading \(Legendary.Installing.game?.title ?? "[unknown]")…") | ||
.font(.title) | ||
|
||
GroupBox { | ||
Text("Progress: \(Int(status.progress?.percentage ?? 0))% (\(status.progress?.downloaded ?? 0)/\(status.progress?.total ?? 0) objects)") | ||
Text("Downloaded \(status.download?.downloaded ?? 0) MiB, Written \(status.download?.written ?? 0)") | ||
Text("Elapsed: \("\(status.progress?.runtime ?? "[unknown]")"), ETA: \("\(status.progress?.eta ?? "[unknown]")")") | ||
} | ||
.fixedSize() | ||
|
||
Button("Close") { isPresented = false } | ||
.buttonStyle(.borderedProminent) | ||
.foregroundStyle(.accent) | ||
} | ||
.padding() | ||
} | ||
} | ||
|
||
#Preview { | ||
InstallStatusView(isPresented: .constant(true)) | ||
} |