mirror of
https://github.com/nimbold/Firelink.git
synced 2026-07-27 12:29:29 +00:00
afb26378d7
This commit breaks down the massive ContentView into smaller components (SidebarView, DownloadTable, StatusBar) and adds state persistence. DownloadTable UI layout and the DownloadController history are now saved efficiently.
22 lines
670 B
Swift
22 lines
670 B
Swift
import SwiftUI
|
|
|
|
struct StatusBar: View {
|
|
@EnvironmentObject private var controller: DownloadController
|
|
|
|
var body: some View {
|
|
HStack {
|
|
Text(controller.engineMessage.isEmpty ? "Ready" : controller.engineMessage)
|
|
.foregroundStyle(controller.hasAria2 ? Color.secondary : Color.orange)
|
|
.lineLimit(1)
|
|
Spacer()
|
|
Text("\(controller.activeCount) active")
|
|
Text("\(controller.queuedCount) queued")
|
|
Text("\(controller.completedCount) done")
|
|
}
|
|
.font(.caption)
|
|
.padding(.horizontal, 14)
|
|
.padding(.vertical, 8)
|
|
.background(.bar)
|
|
}
|
|
}
|