Some fixes in the energy view

pull/509/head
Michael Zanetti 2021-01-18 20:49:17 +01:00
parent 553717a37e
commit ddbde5130e
3 changed files with 15 additions and 5 deletions

View File

@ -262,6 +262,7 @@ void LogsModel::logsReply(int /*commandId*/, const QVariantMap &data)
m_busyInternal = false;
if (m_viewStartTime.isValid() && m_list.count() > 0 && m_list.last()->timestamp() > m_viewStartTime && m_canFetchMore) {
// qDebug() << "Fetching more because of viewStartTime" << m_viewStartTime.toString() << "last" << m_list.last()->timestamp().toString();
fetchMore();
} else {
m_busy = false;

View File

@ -53,7 +53,7 @@ MainViewBase {
Flickable {
anchors.fill: parent
topMargin: app.margins
anchors.margins: app.margins / 2
contentHeight: energyGrid.childrenRect.height
GridLayout {
@ -62,9 +62,11 @@ MainViewBase {
visible: consumers.count > 0
columns: root.width > 600 ? 2 : 1
rowSpacing: 0
columnSpacing: 0
SmartMeterChart {
Layout.preferredWidth: energyGrid.width / energyGrid.columns
Layout.fillWidth: true
// Layout.preferredWidth: energyGrid.width / energyGrid.columns
Layout.preferredHeight: width * .7
meters: consumers
title: qsTr("Total consumed energy")
@ -75,7 +77,8 @@ MainViewBase {
ChartView {
id: chartView
Layout.fillWidth: true
Layout.preferredHeight: width * .75
// Layout.preferredWidth: energyGrid.width / energyGrid.columns
Layout.preferredHeight: width * .7
legend.alignment: Qt.AlignBottom
legend.font.pixelSize: app.smallFont
legend.visible: false

View File

@ -57,12 +57,15 @@ MainViewBase {
cellWidth: gridView.width / tilesPerRow
cellHeight: cellWidth
moveDisplaced: Transition { NumberAnimation { properties: "x,y"; duration: 150; easing.type: Easing.InOutQuad } }
model: tagsProxy
delegate: ThingTile {
id: delegateRoot
width: gridView.cellWidth
height: gridView.cellHeight
device: engine.deviceManager.devices.getDevice(deviceId)
visible: thingId !== fakeDragItem.deviceId
onClicked: pageStack.push(Qt.resolvedUrl("../devicepages/" + NymeaUtils.interfaceListToDevicePage(deviceClass.interfaces)), {device: device})
@ -76,6 +79,8 @@ MainViewBase {
NumberAnimation { from: 3; to: -3; target: delegateRoot; duration: 150; property: "rotation" }
NumberAnimation { from: -3; to: 0; target: delegateRoot; duration: 75; property: "rotation" }
}
}
MouseArea {
@ -103,6 +108,7 @@ MainViewBase {
onReleased: {
drag.target = null
draggedItem = null
fakeDragItem.deviceId = ""
}
onClicked: {
@ -115,8 +121,8 @@ MainViewBase {
width: gridView.cellWidth
height: gridView.cellHeight
Drag.active: dragArea.drag.active
visible: Drag.active
property var deviceId
visible: deviceId !== ""
property var deviceId: ""
}
DropArea {