diff --git a/shell/applets/BatteryApplet.qml b/shell/applets/BatteryApplet.qml index 327c43a..13e5846 100644 --- a/shell/applets/BatteryApplet.qml +++ b/shell/applets/BatteryApplet.qml @@ -96,6 +96,7 @@ Column { history: S.BatteryService.history color: root._stateColor active: root.active + maxSamples: 1440 backgroundTint: 0.07 areaMode: true thresholds: [ @@ -162,6 +163,7 @@ Column { history: S.BatteryService.rateHistory color: root._stateColor active: root.active + maxSamples: 60 maxValue: null minValue: null backgroundTint: 0.08 diff --git a/shell/applets/GpuApplet.qml b/shell/applets/GpuApplet.qml index 1d10648..896b1e0 100644 --- a/shell/applets/GpuApplet.qml +++ b/shell/applets/GpuApplet.qml @@ -84,6 +84,7 @@ Column { height: 36 history: S.SystemStats.gpuHistory active: root.active + maxSamples: 60 colorFunction: v => S.Theme.loadColor(v) } diff --git a/shell/applets/MemoryApplet.qml b/shell/applets/MemoryApplet.qml index fe69183..6aa0005 100644 --- a/shell/applets/MemoryApplet.qml +++ b/shell/applets/MemoryApplet.qml @@ -80,6 +80,7 @@ Column { history: S.SystemStats.memHistory color: root.accentColor active: root.active + maxSamples: 30 backgroundTint: 0.15 } diff --git a/shell/applets/SparklineCanvas.qml b/shell/applets/SparklineCanvas.qml index cffabb1..dc68691 100644 --- a/shell/applets/SparklineCanvas.qml +++ b/shell/applets/SparklineCanvas.qml @@ -13,6 +13,9 @@ Canvas { readonly property real _max: maxValue !== null && maxValue !== undefined ? maxValue : (history.length ? Math.max(...history) : 100) readonly property real _min: minValue !== null && minValue !== undefined ? minValue : (history.length ? Math.min(...history) : 0) + // Max x-axis slots - bars get narrower as data fills up, then oldest drops off + property int maxSamples: 0 + // Logarithmic x-axis: compresses old data on the left, expands recent data on the right. // logCurve controls strength (0 = linear, 3 = strong compression). Only visual - does not affect data. property bool logScale: false @@ -66,8 +69,9 @@ Canvas { const x1 = width * (Math.exp(k * (i + 1) / n) - 1) / expK; return [x0, x1 - x0]; } - const step = width / n; - return [i * step, step]; + const step = width / (maxSamples > n ? maxSamples : n); + const off = maxSamples > n ? (maxSamples - n) * step : 0; + return [off + i * step, step]; } // Background tint @@ -145,7 +149,7 @@ Canvas { const dy = yOf(d[i]); const barTop = Math.min(dy, zy); const barH = Math.max(1, Math.abs(dy - zy)); - ctx.fillRect(bx, barTop, Math.ceil(bw), barH); + ctx.fillRect(bx, barTop, Math.max(1, bw - 0.5), barH); } } } diff --git a/shell/applets/TemperatureApplet.qml b/shell/applets/TemperatureApplet.qml index 45534e5..98ad539 100644 --- a/shell/applets/TemperatureApplet.qml +++ b/shell/applets/TemperatureApplet.qml @@ -113,6 +113,7 @@ Column { history: root.history color: root.stateColor active: root.active + maxSamples: 150 backgroundTint: 0.08 thresholds: [ { diff --git a/shell/modules/TrayModule.qml b/shell/modules/TrayModule.qml index 647adce..66a4c89 100644 --- a/shell/modules/TrayModule.qml +++ b/shell/modules/TrayModule.qml @@ -15,24 +15,6 @@ RowLayout { required property var bar property var _activeMenu: null - Component.onCompleted: console.log("[TrayModule] created, enable:", S.Modules.tray.enable, "repeater count:", _trayRepeater.count) - - onVisibleChanged: console.log("[TrayModule] visible:", visible, "enable:", S.Modules.tray.enable, "count:", _trayRepeater.count) - - Connections { - target: _trayRepeater - function onCountChanged() { - console.log("[TrayModule] repeater count:", _trayRepeater.count); - } - } - - Connections { - target: SystemTray.items - function onValuesChanged() { - console.log("[TrayModule] model valuesChanged, values.length:", SystemTray.items.values.length, "repeater count:", _trayRepeater.count); - } - } - Repeater { id: _trayRepeater model: SystemTray.items