Compare commits

..

No commits in common. "3582ea26562e1a0c2e559832cae79fc9e70632b4" and "fcf1c361d91aea66e0a8d83a1fe87c8762e7aa29" have entirely different histories.

3 changed files with 1 additions and 48 deletions

View file

@ -41,7 +41,7 @@ PanelWindow {
property bool _winVisible: false
WlrLayershell.layer: WlrLayer.Overlay
WlrLayershell.layer: WlrLayer.Top
WlrLayershell.exclusiveZone: 0
WlrLayershell.namespace: root.panelNamespace

View file

@ -144,50 +144,6 @@ M.BarSection {
}
}
// Memory history sparkline
Canvas {
id: memSparkline
anchors.left: parent.left
anchors.leftMargin: 12
anchors.right: parent.right
anchors.rightMargin: 12
height: 18
property var _hist: M.SystemStats.memHistory
property color _col: root.accentColor
on_HistChanged: if (root._showPanel)
requestPaint()
on_ColChanged: if (root._showPanel)
requestPaint()
Connections {
target: root
function on_ShowPanelChanged() {
if (root._showPanel)
memSparkline.requestPaint();
}
}
onPaint: {
const ctx = getContext("2d");
if (!ctx)
return;
ctx.clearRect(0, 0, width, height);
const d = _hist;
if (!d.length)
return;
const bw = width / 30;
ctx.fillStyle = Qt.rgba(_col.r, _col.g, _col.b, 0.15).toString();
ctx.fillRect(0, 0, width, height);
ctx.fillStyle = _col.toString();
for (let i = 0; i < d.length; i++) {
const h = Math.max(1, height * d[i] / 100);
ctx.fillRect((30 - d.length + i) * bw, height - h, Math.max(1, bw - 0.5), h);
}
}
}
// Breakdown rows
Item {
width: parent.width

View file

@ -40,7 +40,6 @@ QtObject {
property real memAvailGb: 0
property real memCachedGb: 0
property real memBuffersGb: 0
property var memHistory: []
// Disk
property var diskMounts: []
@ -90,8 +89,6 @@ QtObject {
root.memAvailGb = ev.avail_gb;
root.memCachedGb = ev.cached_gb;
root.memBuffersGb = ev.buffers_gb;
const h = root.memHistory.concat([ev.percent]);
root.memHistory = h.length > 30 ? h.slice(h.length - 30) : h;
}
} catch (e) {}
}