From da56b2ac6daf4a51d040fe231b02a7c83c4b1fde Mon Sep 17 00:00:00 2001 From: Matt Kiazyk Date: Sun, 7 Mar 2021 14:33:32 -0600 Subject: [PATCH] Updates estimated time on info pane to 2 lines for better readability --- Xcodes/Backend/Progress+.swift | 3 +++ Xcodes/Frontend/Common/ObservingProgressIndicator.swift | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Xcodes/Backend/Progress+.swift b/Xcodes/Backend/Progress+.swift index b71b994..6e7688c 100644 --- a/Xcodes/Backend/Progress+.swift +++ b/Xcodes/Backend/Progress+.swift @@ -2,6 +2,9 @@ import os.log import Foundation extension Progress { + var xcodesLocalizedDescription: String { + return localizedAdditionalDescription.replacingOccurrences(of: " — ", with: "\n") + } func updateFromAria2(string: String) { let range = NSRange(location: 0, length: string.utf16.count) diff --git a/Xcodes/Frontend/Common/ObservingProgressIndicator.swift b/Xcodes/Frontend/Common/ObservingProgressIndicator.swift index d4dc428..88a11ef 100644 --- a/Xcodes/Frontend/Common/ObservingProgressIndicator.swift +++ b/Xcodes/Frontend/Common/ObservingProgressIndicator.swift @@ -48,8 +48,8 @@ public struct ObservingProgressIndicator: View { ) .help("Downloading: \(Int((progress.progress.fractionCompleted * 100)))% complete") - if showsAdditionalDescription, progress.progress.localizedAdditionalDescription.isEmpty == false { - Text(progress.progress.localizedAdditionalDescription) + if showsAdditionalDescription, progress.progress.xcodesLocalizedDescription.isEmpty == false { + Text(progress.progress.xcodesLocalizedDescription) .font(.subheadline) .foregroundColor(.secondary) }