From 822f3c61add7b289595b8fb5be2d86e38a3a4a3a Mon Sep 17 00:00:00 2001 From: portersky Date: Sat, 29 Aug 2026 14:05:51 +0200 Subject: [PATCH] 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 --- CMakeLists.txt | 2 +- src/app/main.swift | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 389ce14..6f0e337 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/src/app/main.swift b/src/app/main.swift index b16b797..3305bf5 100644 --- a/src/app/main.swift +++ b/src/app/main.swift @@ -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