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:
+1
-1
@@ -6,7 +6,7 @@ if(NOT CMAKE_GENERATOR MATCHES "^(Ninja|Xcode)$")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.21)
|
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)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
|
|||||||
+14
-6
@@ -290,9 +290,7 @@ struct ContentView: View {
|
|||||||
Text(label)
|
Text(label)
|
||||||
.font(.caption2)
|
.font(.caption2)
|
||||||
.frame(width: 12, alignment: .leading)
|
.frame(width: 12, alignment: .leading)
|
||||||
ProgressView(value: normalized)
|
valueBar(normalized, width: 82)
|
||||||
.frame(width: 82)
|
|
||||||
.animation(nil, value: normalized)
|
|
||||||
Text("\(value)")
|
Text("\(value)")
|
||||||
.font(.caption2.monospacedDigit())
|
.font(.caption2.monospacedDigit())
|
||||||
.frame(width: 42, alignment: .trailing)
|
.frame(width: 42, alignment: .trailing)
|
||||||
@@ -304,14 +302,24 @@ struct ContentView: View {
|
|||||||
Text(label)
|
Text(label)
|
||||||
.font(.caption2)
|
.font(.caption2)
|
||||||
.frame(width: 76, alignment: .leading)
|
.frame(width: 76, alignment: .leading)
|
||||||
ProgressView(value: Double(value), total: 1023)
|
valueBar(Double(value) / 1023.0, width: 70)
|
||||||
.frame(width: 70)
|
|
||||||
.animation(nil, value: value)
|
|
||||||
Text("\(value)")
|
Text("\(value)")
|
||||||
.font(.caption2.monospacedDigit())
|
.font(.caption2.monospacedDigit())
|
||||||
.frame(width: 32, alignment: .trailing)
|
.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
|
// Entry point: SwiftUI App provides a static main() (top-level code lives in
|
||||||
|
|||||||
Reference in New Issue
Block a user