move stuff into components
This commit is contained in:
parent
6370732e4e
commit
14292e6683
17 changed files with 81 additions and 149 deletions
|
|
@ -1,11 +1,11 @@
|
|||
import QtQuick
|
||||
import Quickshell.Io
|
||||
import QtQuick.Controls
|
||||
import "." as M
|
||||
|
||||
Row {
|
||||
M.BarSection {
|
||||
id: root
|
||||
spacing: 2
|
||||
tooltip: "Memory: " + root.percent + "% used"
|
||||
|
||||
property int percent: 0
|
||||
|
||||
|
|
@ -16,8 +16,7 @@ Row {
|
|||
const m = {};
|
||||
text().split("\n").forEach(l => {
|
||||
const [k, v] = l.split(":");
|
||||
if (v)
|
||||
m[k.trim()] = parseInt(v.trim());
|
||||
if (v) m[k.trim()] = parseInt(v.trim());
|
||||
});
|
||||
const total = m.MemTotal;
|
||||
const avail = m.MemAvailable;
|
||||
|
|
@ -43,9 +42,4 @@ Row {
|
|||
font.family: M.Theme.fontFamily
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
HoverHandler { id: hover }
|
||||
ToolTip {
|
||||
visible: hover.hovered
|
||||
text: "Memory: " + root.percent + "% used"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue