Fix: Double conversion network error

This commit is contained in:
Hariharan Mudaliar 2025-08-13 21:35:28 +05:30
commit e8f8cd6723
6 changed files with 55 additions and 22 deletions

View file

@ -90,8 +90,8 @@ struct NotchStatsView: View {
if showNetworkGraph {
graphs.append(DualGraphData(
title: "Network",
positiveValue: String(format: "↓%.1f MB/s", statsManager.networkDownload),
negativeValue: String(format: "↑%.1f MB/s", statsManager.networkUpload),
positiveValue: "↓" + statsManager.networkDownloadString,
negativeValue: "↑" + statsManager.networkUploadString,
positiveData: statsManager.networkDownloadHistory,
negativeData: statsManager.networkUploadHistory,
positiveColor: .orange,
@ -104,8 +104,8 @@ struct NotchStatsView: View {
if showDiskGraph {
graphs.append(DualGraphData(
title: "Disk",
positiveValue: String(format: "R %.1f MB/s", statsManager.diskRead),
negativeValue: String(format: "W %.1f MB/s", statsManager.diskWrite),
positiveValue: "R " + statsManager.diskReadString,
negativeValue: "W " + statsManager.diskWriteString,
positiveData: statsManager.diskReadHistory,
negativeData: statsManager.diskWriteHistory,
positiveColor: .cyan,

View file

@ -64,7 +64,7 @@ class StatsPanel: NSPanel {
self.contentView = hostingView
// Set initial size
let preferredSize = CGSize(width: 600, height: 500)
let preferredSize = CGSize(width: 600, height: 400)
hostingView.setFrameSize(preferredSize)
setContentSize(preferredSize)
}

View file

@ -125,7 +125,7 @@ struct StatsPanelView: View {
.padding(16)
}
}
.frame(width: 600, height: 500)
.frame(width: 650, height: 300)
.background(VisualEffectView(material: .hudWindow, blendingMode: .behindWindow))
.cornerRadius(12)
.shadow(color: .black.opacity(0.4), radius: 20, x: 0, y: 10)