diff --git a/eul/Utilities/ByteUnit.swift b/eul/Utilities/ByteUnit.swift index fad827c1..e27ad64a 100644 --- a/eul/Utilities/ByteUnit.swift +++ b/eul/Utilities/ByteUnit.swift @@ -35,13 +35,13 @@ public struct ByteUnit { public var readable: String { switch bytes { case 0..<(1024 * 1024): - return "\(String(format: "%.\(kilobytes >= 100 ? 0 : 1)f", kilobytes)) kb" + return "\(String(format: "%.\(kilobytes >= 100 ? 0 : 1)f", kilobytes)) KB" case 1024..<(1024 * 1024 * 1024): - return "\(String(format: "%.\(megabytes >= 100 ? 0 : 1)f", megabytes)) mb" + return "\(String(format: "%.\(megabytes >= 100 ? 0 : 1)f", megabytes)) MB" case (1024 * 1024 * 1024)...UInt64.max: - return "\(String(format: "%.\(gigabytes >= 100 ? 0 : 1)f", gigabytes)) gb" + return "\(String(format: "%.\(gigabytes >= 100 ? 0 : 1)f", gigabytes)) GB" default: - return "\(bytes) bytes" + return "\(bytes) Bytes" } } } diff --git a/eul/Views/Components/StatusBarTextView.swift b/eul/Views/Components/StatusBarTextView.swift index 66d9c6f7..b1d396a4 100644 --- a/eul/Views/Components/StatusBarTextView.swift +++ b/eul/Views/Components/StatusBarTextView.swift @@ -11,13 +11,14 @@ import SwiftUI struct StatusBarTextView: View { @ObservedObject var preferenceStore = PreferenceStore.shared var texts: [String] = [] + var alignment: HorizontalAlignment = .leading var fontDesign: Font.Design { preferenceStore.fontDesign.value } func getCompactRow(_ index: Int) -> some View { - VStack(alignment: .leading, spacing: 0) { + VStack(alignment: alignment, spacing: 0) { Text(self.texts[index * 2]) .compact(design: fontDesign) Text(self.texts[index * 2 + 1]) diff --git a/eul/Views/StatusBar/NetworkView.swift b/eul/Views/StatusBar/NetworkView.swift index a9963f86..7192e4e8 100644 --- a/eul/Views/StatusBar/NetworkView.swift +++ b/eul/Views/StatusBar/NetworkView.swift @@ -18,7 +18,7 @@ struct NetworkView: View { var textWidth: CGFloat? { if preferenceStore.textDisplay == .compact { - return 45 + return 50 } return preferenceStore.fontDesign == .default ? 120 : 145 } @@ -30,8 +30,8 @@ struct NetworkView: View { .resizable() .frame(width: 13, height: 13) } - StatusBarTextView(texts: texts) - .frame(width: textWidth) + StatusBarTextView(texts: texts, alignment: .trailing) + .frame(width: textWidth, alignment: .trailing) } } }