diff --git a/Modules/Bar/Widgets/SystemMonitor.qml b/Modules/Bar/Widgets/SystemMonitor.qml index 778c1f743..f6c2ca248 100644 --- a/Modules/Bar/Widgets/SystemMonitor.qml +++ b/Modules/Bar/Widgets/SystemMonitor.qml @@ -110,11 +110,11 @@ Item { } // Memory - rows.push([I18n.tr("common.memory"), `${Math.round(SystemStatService.memPercent)}% (${SystemStatService.formatGigabytes(SystemStatService.memGb).replace(/[^0-9.]/g, "") + " GB"})`]); + rows.push([I18n.tr("common.memory"), `${Math.round(SystemStatService.memPercent)}% (${(SystemStatService.memGb).toFixed(1)} GiB)`]); // Swap (if available) if (SystemStatService.swapTotalGb > 0) { - rows.push([I18n.tr("bar.system-monitor.swap-usage-label"), `${Math.round(SystemStatService.swapPercent)}% (${SystemStatService.formatGigabytes(SystemStatService.swapGb).replace(/[^0-9.]/g, "") + " GB"})`]); + rows.push([I18n.tr("bar.system-monitor.swap-usage-label"), `${Math.round(SystemStatService.swapPercent)}% (${(SystemStatService.swapGb).toFixed(1)} GiB)`]); } // Network diff --git a/Modules/Dock/DockMenu.qml b/Modules/Dock/DockMenu.qml index 7f18d6309..d118ef433 100644 --- a/Modules/Dock/DockMenu.qml +++ b/Modules/Dock/DockMenu.qml @@ -582,6 +582,7 @@ PopupWindow { Rectangle { anchors.fill: parent + anchors.margins: border.width color: Color.mSurfaceVariant radius: Style.radiusS border.color: Color.mOutline diff --git a/Modules/Panels/Settings/Tabs/About/VersionSubTab.qml b/Modules/Panels/Settings/Tabs/About/VersionSubTab.qml index efdfa03d3..55da6675d 100644 --- a/Modules/Panels/Settings/Tabs/About/VersionSubTab.qml +++ b/Modules/Panels/Settings/Tabs/About/VersionSubTab.qml @@ -33,7 +33,8 @@ ColumnLayout { property string commitInfo: "" readonly property bool isGitVersion: root.currentVersion.endsWith("-git") - readonly property int giga: (1024 * 1024 * 1024) + readonly property int gigaB: (1024 * 1024 * 1024) + readonly property int gigaD: (1000 * 1000 * 1000) // Update status: compare versions (strip -git suffix for comparison) readonly property string installedBase: root.currentVersion.replace("-git", "") @@ -96,7 +97,7 @@ ColumnLayout { version: UpdateService.currentVersion, compositor: TelemetryService.getCompositorType(), os: HostService.osPretty || "Unknown", - ramGb: Math.round((root.getModule("Memory")?.result?.total || 0) / root.giga), + ramGb: Math.round((root.getModule("Memory")?.result?.total || 0) / root.gigaB), monitors: monitors, ui: { scaleRatio: Settings.data.general.scaleRatio, @@ -140,7 +141,7 @@ ColumnLayout { info += "GPU: " + gpu.result.map(g => g.name || "Unknown").join(", ") + "\n"; } if (mem?.result) { - info += "Memory: " + SystemStatService.formatGigabytes(mem.result.total / root.giga) + "\n"; + info += "Memory: " + (mem.result.total / root.gigaB).toFixed(1) + " GB \n"; } if (wm?.result) { info += "WM: " + (wm.result.prettyName || wm.result.processName || "N/A") + "\n"; @@ -734,9 +735,9 @@ ColumnLayout { const mem = root.getModule("Memory"); if (!mem?.result) return "N/A"; - const used = SystemStatService.formatGigabytes(mem.result.used / root.giga); - const total = SystemStatService.formatGigabytes(mem.result.total / root.giga); - return used + " / " + total; + const used = (mem.result.used / root.gigaB).toFixed(1); + const total = (mem.result.total / root.gigaB).toFixed(1); + return used + " GiB / " + total + " GiB"; } color: Color.mOnSurface pointSize: sysInfo.textSize @@ -758,9 +759,9 @@ ColumnLayout { const rootDisk = disk.result.find(d => d.mountpoint === "/"); if (!rootDisk?.bytes) return "N/A"; - const used = SystemStatService.formatGigabytes(rootDisk.bytes.used / root.giga); - const total = SystemStatService.formatGigabytes(rootDisk.bytes.total / root.giga); - return used + " / " + total + " (" + rootDisk.filesystem + ")"; + const used = (rootDisk.bytes.used / root.gigaD).toFixed(1); + const total = (rootDisk.bytes.total / root.gigaD).toFixed(1); + return used + " GB / " + total + " GB" + " (" + rootDisk.filesystem + ")"; } color: Color.mOnSurface pointSize: sysInfo.textSize diff --git a/Modules/Panels/SystemStats/SystemStatsPanel.qml b/Modules/Panels/SystemStats/SystemStatsPanel.qml index 2811d2219..3f4f75e72 100644 --- a/Modules/Panels/SystemStats/SystemStatsPanel.qml +++ b/Modules/Panels/SystemStats/SystemStatsPanel.qml @@ -165,7 +165,7 @@ SmartPanel { } NText { - text: `${Math.round(SystemStatService.memPercent)}% (${SystemStatService.formatGigabytes(SystemStatService.memGb).replace(/[^0-9.]/g, "")} GB)` + text: `${Math.round(SystemStatService.memPercent)}% (${(SystemStatService.memGb).toFixed(1)} GiB)` pointSize: Style.fontSizeXS color: Color.mPrimary font.family: Settings.data.ui.fontFixed @@ -386,7 +386,7 @@ SmartPanel { } NText { - text: `${SystemStatService.formatGigabytes(SystemStatService.swapGb).replace(/[^0-9.]/g, "")} / ${SystemStatService.formatGigabytes(SystemStatService.swapTotalGb).replace(/[^0-9.]/g, "")} GB` + text: `${(SystemStatService.swapGb).toFixed(1)} / ${(SystemStatService.swapTotalGb).toFixed(1)} GiB` pointSize: Style.fontSizeXS color: Color.mOnSurface Layout.fillWidth: true diff --git a/Modules/Tooltip/Tooltip.qml b/Modules/Tooltip/Tooltip.qml index 703fb6690..e0717ae8d 100644 --- a/Modules/Tooltip/Tooltip.qml +++ b/Modules/Tooltip/Tooltip.qml @@ -639,7 +639,7 @@ PopupWindow { Rectangle { anchors.fill: parent - anchors.margins: border.width / 2 + anchors.margins: border.width color: Color.mSurface border.color: Color.mOutline border.width: Style.borderS diff --git a/Services/System/SystemStatService.qml b/Services/System/SystemStatService.qml index a11c6290c..805fa07b6 100644 --- a/Services/System/SystemStatService.qml +++ b/Services/System/SystemStatService.qml @@ -172,11 +172,11 @@ Singleton { // Minimum floor of 1 MB/s so graph doesn't fluctuate at low speeds readonly property real rxMaxSpeed: { const max = Math.max(...rxSpeedHistory); - return Math.max(max, 1048576); // 1 MB/s floor + return Math.max(max, 1000000); // 1 MB/s floor } readonly property real txMaxSpeed: { const max = Math.max(...txSpeedHistory); - return Math.max(max, 524288); // 512 KB/s floor + return Math.max(max, 512000); // 512 KB/s floor } // Ready-to-use ratios based on current maximums (0..1 range) @@ -501,7 +501,7 @@ Singleton { const newUsedGb = {}; const newSizeGb = {}; const newAvailableGb = {}; - const bytesPerGb = 1024 * 1024 * 1024; + const bytesPerGb = 1000 * 1000 * 1000; // Start from line 1 (skip header) for (var i = 1; i < lines.length; i++) { const parts = lines[i].trim().split(/\s+/); @@ -1209,11 +1209,11 @@ Singleton { // Helper function to format network speeds function formatSpeed(bytesPerSecond) { const units = ["KB", "MB", "GB"]; - let value = bytesPerSecond / 1024; + let value = bytesPerSecond / 1000; let unitIndex = 0; - while (value >= 1024 && unitIndex < units.length - 1) { - value /= 1024; + while (value >= 1000 && unitIndex < units.length - 1) { + value /= 1000; unitIndex++; } @@ -1232,13 +1232,13 @@ Singleton { const units = ["", "K", "M", "G"]; let value = bytesPerSecond; let unitIndex = 0; - while (value >= 1024 && unitIndex < units.length - 1) { - value = value / 1024.0; + while (value >= 1000 && unitIndex < units.length - 1) { + value = value / 1000.0; unitIndex++; } // Promote at ~100 of current unit (e.g., 100k -> ~0.1M shown as 0.1M or 0M if rounded) if (unitIndex < units.length - 1 && value >= 100) { - value = value / 1024.0; + value = value / 1000.0; unitIndex++; } const display = Math.round(value).toString();