Add OS metadata, preference hooks, and slider polish

This commit is contained in:
Micha
2025-11-19 18:15:33 +01:00
parent 4efe1a2324
commit d3f9126245
4 changed files with 104 additions and 60 deletions

View File

@@ -10,16 +10,19 @@ import SwiftUI
struct ServerDetailView: View {
@Binding var server: Server
var isFetching: Bool
@AppStorage("showIntervalIndicator") private var showIntervalIndicator: Bool = true
@State private var progress: Double = 0
let timer = Timer.publish(every: 1.0 / 60.0, on: .main, in: .common).autoconnect()
var body: some View {
VStack(spacing: 0) {
ProgressView(value: progress)
.progressViewStyle(LinearProgressViewStyle())
.padding(.horizontal)
.frame(height: 2)
if showIntervalIndicator {
ProgressView(value: progress)
.progressViewStyle(LinearProgressViewStyle())
.padding(.horizontal)
.frame(height: 2)
}
if server.info == nil {
ProgressView("Fetching server info...")
@@ -54,6 +57,7 @@ struct ServerDetailView: View {
}
}
.onReceive(timer) { _ in
guard showIntervalIndicator else { return }
withAnimation(.linear(duration: 1.0 / 60.0)) {
progress += 1.0 / (60.0 * 60.0)
if progress >= 1 { progress = 0 }