mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Initial fan graph widget
This commit is contained in:
@@ -1,16 +1,48 @@
|
||||
import { Palette } from "std-widgets.slint";
|
||||
import { Graph } from "../widgets/graph.slint";
|
||||
|
||||
export struct Node { x: length, y: length}
|
||||
|
||||
export component PageFans inherits VerticalLayout {
|
||||
Rectangle {
|
||||
clip: true;
|
||||
// TODO: slow with border-radius
|
||||
padding: 8px;
|
||||
// height: parent.height - infobar.height - mainview.padding - self.padding * 2;
|
||||
// TODO: border-radius: 8px;
|
||||
mainview := VerticalLayout {
|
||||
padding: 10px;
|
||||
spacing: 10px;
|
||||
Text {
|
||||
text: "TODO";
|
||||
}
|
||||
in-out property <[Node]> nodes: [
|
||||
{
|
||||
x: 10px,
|
||||
y: 10px,
|
||||
},
|
||||
{
|
||||
x: 40px,
|
||||
y: 30px,
|
||||
},
|
||||
{
|
||||
x: 70px,
|
||||
y: 50px,
|
||||
},
|
||||
{
|
||||
x: 100px,
|
||||
y: 70px,
|
||||
},
|
||||
{
|
||||
x: 130px,
|
||||
y: 90px,
|
||||
},
|
||||
{
|
||||
x: 160px,
|
||||
y: 110px,
|
||||
},
|
||||
{
|
||||
x: 190px,
|
||||
y: 130px,
|
||||
},
|
||||
{
|
||||
x: 220px,
|
||||
y: 150px,
|
||||
},
|
||||
];
|
||||
HorizontalLayout {
|
||||
Graph {
|
||||
// width: root.preferred-width;
|
||||
// height: root.preferred-height;
|
||||
nodes <=> root.nodes;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user