fix: remove analog progress animation

Use direct-width SwiftUI shape bars instead of native ProgressView controls
so increasing stick and trigger values update without delayed fill motion.

Co-Authored-By: openai/gpt-5.6-luna: replaced animated analog indicators
This commit is contained in:
portersky
2026-08-29 14:05:51 +02:00
parent 80746992f8
commit 822f3c61ad
2 changed files with 15 additions and 7 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ if(NOT CMAKE_GENERATOR MATCHES "^(Ninja|Xcode)$")
endif()
cmake_minimum_required(VERSION 3.21)
project(xone_macos VERSION 0.1.16 LANGUAGES CXX Swift)
project(xone_macos VERSION 0.1.17 LANGUAGES CXX Swift)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+14 -6
View File
@@ -290,9 +290,7 @@ struct ContentView: View {
Text(label)
.font(.caption2)
.frame(width: 12, alignment: .leading)
ProgressView(value: normalized)
.frame(width: 82)
.animation(nil, value: normalized)
valueBar(normalized, width: 82)
Text("\(value)")
.font(.caption2.monospacedDigit())
.frame(width: 42, alignment: .trailing)
@@ -304,14 +302,24 @@ struct ContentView: View {
Text(label)
.font(.caption2)
.frame(width: 76, alignment: .leading)
ProgressView(value: Double(value), total: 1023)
.frame(width: 70)
.animation(nil, value: value)
valueBar(Double(value) / 1023.0, width: 70)
Text("\(value)")
.font(.caption2.monospacedDigit())
.frame(width: 32, alignment: .trailing)
}
}
private func valueBar(_ fraction: Double, width: CGFloat) -> some View {
let clamped = min(max(fraction, 0), 1)
return ZStack(alignment: .leading) {
Color.secondary.opacity(0.18)
.frame(width: width, height: 6)
Color.accentColor
.frame(width: width * CGFloat(clamped), height: 6)
}
.frame(width: width, height: 6)
.clipShape(RoundedRectangle(cornerRadius: 3))
}
}
// Entry point: SwiftUI App provides a static main() (top-level code lives in