aboutsummaryrefslogtreecommitdiff
path: root/src/Barometer.qml
diff options
context:
space:
mode:
authordodoradio <dodoradio@outlook.com>2023-08-07 21:25:44 +0100
committerArseniy Movshev <dodoradio@outlook.com>2023-11-24 17:20:54 +0000
commit8825bca5587ba07e7462622ba37d125ba17e4969 (patch)
treed70927c4fbd096cc510d05ed76830ff28efd6add /src/Barometer.qml
parent298ed17d1450b3590d3702e446c5f61aca9fa6b0 (diff)
Add barometer graphgraph
This is based mostly on my work from asteroid-health (https://git.dodorad.io/dodoradio/asteroid-health). Some tweaks have been applied on top of this code, which might prove useful in asteroid-health as well.
Diffstat (limited to '')
-rw-r--r--src/Barometer.qml18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/Barometer.qml b/src/Barometer.qml
index c34f51d..b494fc0 100644
--- a/src/Barometer.qml
+++ b/src/Barometer.qml
@@ -23,6 +23,7 @@ import QtSensors 5.11
import org.asteroid.controls 1.0
import org.asteroid.utils 1.0
import Nemo.Configuration 1.0
+import "graphs"
Item {
id: barometerRoot
@@ -38,14 +39,23 @@ Item {
width: parent.width*0.2
height: width
anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: pressureText.top
+ anchors.bottom: baroGraph.top
+ }
+ BarometerGraph {
+ id: baroGraph
+ height: parent.height/3
+ width: parent.width*7/8
+ anchors.centerIn: parent
}
Label {
id: pressureText
- anchors.centerIn: parent
+ anchors.top:baroGraph.bottom
+ anchors.topMargin: parent.height*0.05
+ anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
text: (pressureSensor.reading.pressure + barometerOffset.value)/100
- font.pixelSize: parent.height / 4
+ font.pixelSize: parent.height / 12
+ font.bold: true
}
ConfigurationValue {
id: barometerOffset
@@ -57,6 +67,6 @@ Item {
anchors.top: pressureText.bottom
horizontalAlignment: Text.AlignHCenter
text: "hPa"
- font.pixelSize: parent.height / 6
+ font.pixelSize: parent.height / 18
}
}