Merge PR #736: Drop blurred label
This commit is contained in:
commit
e33ebfc5dd
@ -257,7 +257,6 @@
|
|||||||
<file>ui/components/CircleBackground.qml</file>
|
<file>ui/components/CircleBackground.qml</file>
|
||||||
<file>ui/devicepages/CoolingThingPage.qml</file>
|
<file>ui/devicepages/CoolingThingPage.qml</file>
|
||||||
<file>ui/devicepages/EvChargerThingPage.qml</file>
|
<file>ui/devicepages/EvChargerThingPage.qml</file>
|
||||||
<file>ui/components/BlurredLabel.qml</file>
|
|
||||||
<file>ui/components/NymeaSpinBox.qml</file>
|
<file>ui/components/NymeaSpinBox.qml</file>
|
||||||
<file>ui/mainviews/EnergyPieChartDelegate.qml</file>
|
<file>ui/mainviews/EnergyPieChartDelegate.qml</file>
|
||||||
<file>ui/mainviews/energy/PowerConsumptionBalanceHistory.qml</file>
|
<file>ui/mainviews/energy/PowerConsumptionBalanceHistory.qml</file>
|
||||||
|
|||||||
@ -1,38 +0,0 @@
|
|||||||
import QtQuick 2.5
|
|
||||||
import QtQuick.Controls 2.1
|
|
||||||
import QtGraphicalEffects 1.0
|
|
||||||
import Nymea 1.0
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
implicitWidth: label.implicitWidth + Style.margins * 2
|
|
||||||
implicitHeight: label.implicitHeight + Style.margins * 2
|
|
||||||
|
|
||||||
property alias text: label.text
|
|
||||||
property alias font: label.font
|
|
||||||
property alias wrapMode: label.wrapMode
|
|
||||||
property alias horizontalAlignment: label.horizontalAlignment
|
|
||||||
property alias textFormat: label.textFormat
|
|
||||||
|
|
||||||
property bool blurred: false
|
|
||||||
|
|
||||||
Label {
|
|
||||||
id: label
|
|
||||||
anchors.fill: parent
|
|
||||||
}
|
|
||||||
|
|
||||||
ShaderEffectSource {
|
|
||||||
id: effectSource
|
|
||||||
anchors.fill: parent
|
|
||||||
sourceItem: label
|
|
||||||
hideSource: true
|
|
||||||
visible: false
|
|
||||||
}
|
|
||||||
|
|
||||||
FastBlur {
|
|
||||||
anchors.fill: parent
|
|
||||||
source: effectSource
|
|
||||||
radius: root.blurred ? 32 : 0
|
|
||||||
Behavior on radius { NumberAnimation { duration: Style.animationDuration } }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -220,54 +220,6 @@ ThingPageBase {
|
|||||||
: isDischarging ? qsTr("At the current rate, the battery will last until %1.").arg('<span style="font-size:' + Style.bigFont.pixelSize + 'px">' + endTime.toLocaleTimeString(Locale.ShortFormat) + "</span>")
|
: isDischarging ? qsTr("At the current rate, the battery will last until %1.").arg('<span style="font-size:' + Style.bigFont.pixelSize + 'px">' + endTime.toLocaleTimeString(Locale.ShortFormat) + "</span>")
|
||||||
: ""
|
: ""
|
||||||
}
|
}
|
||||||
|
|
||||||
BlurredLabel {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
visible: isEnergyMeter || isConsumer
|
|
||||||
blurred: periodConsumptionModel.busy
|
|
||||||
font: Style.smallFont
|
|
||||||
text: isConsumer ?
|
|
||||||
qsTr("A total of %1 kWh has been <b>consumed</b> in the last 24 hours.").arg('<span style="font-size:' + Style.bigFont.pixelSize + 'px">' + (totalPeriodConsumption).toFixed(1) + '</span>')
|
|
||||||
: qsTr("A total of %1 kWh has been <b>obtained</b> in the last 24 hours.").arg('<span style="font-size:' + Style.bigFont.pixelSize + 'px">' + (totalPeriodConsumption).toFixed(1) + '</span>')
|
|
||||||
textFormat: Text.RichText
|
|
||||||
|
|
||||||
LogsModel {
|
|
||||||
id: periodConsumptionModel
|
|
||||||
engine: root.isEnergyMeter || root.isConsumer ? _engine : null
|
|
||||||
thingId: root.thing.id
|
|
||||||
typeIds: isEnergyMeter ? [root.totalEnergyConsumedStateType.id] : []
|
|
||||||
viewStartTime: root.startTime
|
|
||||||
live: true
|
|
||||||
}
|
|
||||||
property LogEntry logEntryAtStart: periodConsumptionModel.busy ? null : periodConsumptionModel.findClosest(periodConsumptionModel.viewStartTime)
|
|
||||||
property double totalPeriodConsumption: logEntryAtStart && totalEnergyConsumedState ? totalEnergyConsumedState.value - logEntryAtStart.value : 0
|
|
||||||
}
|
|
||||||
|
|
||||||
BlurredLabel {
|
|
||||||
visible: isEnergyMeter || isProducer
|
|
||||||
Layout.fillWidth: true
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
blurred: periodProductionModel.busy
|
|
||||||
font: Style.smallFont
|
|
||||||
text: isProducer ?
|
|
||||||
qsTr("A total of %1 kWh has been <b>produced</b> in the last 24 hours.").arg('<span style="font-size:' + Style.bigFont.pixelSize + 'px">' + (totalPeriodProduction).toFixed(1) + '</span>')
|
|
||||||
: qsTr("A total of %1 kWh has been <b>returned</b> in the last 24 hours.").arg('<span style="font-size:' + Style.bigFont.pixelSize + 'px">' + (totalPeriodProduction).toFixed(1) + '</span>')
|
|
||||||
textFormat: Text.RichText
|
|
||||||
|
|
||||||
LogsModel {
|
|
||||||
id: periodProductionModel
|
|
||||||
engine: root.isEnergyMeter || root.isProducer ? _engine : null
|
|
||||||
thingId: root.thing.id
|
|
||||||
typeIds: isEnergyMeter ? [root.totalEnergyProducedStateType.id] : []
|
|
||||||
viewStartTime: root.startTime
|
|
||||||
live: true
|
|
||||||
}
|
|
||||||
property LogEntry logEntryAtStart: periodProductionModel.busy ? null : periodProductionModel.findClosest(periodProductionModel.viewStartTime)
|
|
||||||
property double totalPeriodProduction: logEntryAtStart && totalEnergyProducedState ? totalEnergyProducedState.value - logEntryAtStart.value : 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -388,7 +388,7 @@ StatsBase {
|
|||||||
backgroundRect: Qt.rect(chartView.plotArea.x + toolTip.x, chartView.plotArea.y + toolTip.y, toolTip.width, toolTip.height)
|
backgroundRect: Qt.rect(chartView.plotArea.x + toolTip.x, chartView.plotArea.y + toolTip.y, toolTip.width, toolTip.height)
|
||||||
|
|
||||||
property int idx: Math.floor(mouseArea.mouseX * categoryAxis.count / mouseArea.width)
|
property int idx: Math.floor(mouseArea.mouseX * categoryAxis.count / mouseArea.width)
|
||||||
visible: mouseArea.containsMouse
|
visible: mouseArea.containsMouse || mouseArea.preventStealing
|
||||||
|
|
||||||
x: Math.min(idx * mouseArea.width / categoryAxis.count, mouseArea.width - width)
|
x: Math.min(idx * mouseArea.width / categoryAxis.count, mouseArea.width - width)
|
||||||
property double setMaxValue: {
|
property double setMaxValue: {
|
||||||
|
|||||||
@ -269,12 +269,12 @@ Item {
|
|||||||
width: 1
|
width: 1
|
||||||
color: Style.foregroundColor
|
color: Style.foregroundColor
|
||||||
x: mouseArea.mouseX
|
x: mouseArea.mouseX
|
||||||
visible: mouseArea.containsMouse
|
visible: mouseArea.containsMouse || mouseArea.preventStealing
|
||||||
}
|
}
|
||||||
|
|
||||||
NymeaToolTip {
|
NymeaToolTip {
|
||||||
id: toolTip
|
id: toolTip
|
||||||
visible: mouseArea.containsMouse
|
visible: mouseArea.containsMouse || mouseArea.preventStealing
|
||||||
|
|
||||||
backgroundItem: chartView
|
backgroundItem: chartView
|
||||||
backgroundRect: Qt.rect(mouseArea.x + toolTip.x, mouseArea.y + toolTip.y, toolTip.width, toolTip.height)
|
backgroundRect: Qt.rect(mouseArea.x + toolTip.x, mouseArea.y + toolTip.y, toolTip.width, toolTip.height)
|
||||||
|
|||||||
@ -16,6 +16,11 @@ ChartView {
|
|||||||
|
|
||||||
property EnergyManager energyManager: null
|
property EnergyManager energyManager: null
|
||||||
|
|
||||||
|
ThingsProxy {
|
||||||
|
id: batteries
|
||||||
|
engine: _engine
|
||||||
|
shownInterfaces: ["energystorage"]
|
||||||
|
}
|
||||||
|
|
||||||
PieSeries {
|
PieSeries {
|
||||||
id: consumptionBalanceSeries
|
id: consumptionBalanceSeries
|
||||||
|
|||||||
@ -343,7 +343,7 @@ StatsBase {
|
|||||||
backgroundRect: Qt.rect(chartView.plotArea.x + toolTip.x, chartView.plotArea.y + toolTip.y, toolTip.width, toolTip.height)
|
backgroundRect: Qt.rect(chartView.plotArea.x + toolTip.x, chartView.plotArea.y + toolTip.y, toolTip.width, toolTip.height)
|
||||||
|
|
||||||
property int idx: Math.floor(mouseArea.mouseX * categoryAxis.count / mouseArea.width)
|
property int idx: Math.floor(mouseArea.mouseX * categoryAxis.count / mouseArea.width)
|
||||||
visible: mouseArea.containsMouse
|
visible: mouseArea.containsMouse || mouseArea.preventStealing
|
||||||
|
|
||||||
x: Math.min(idx * mouseArea.width / categoryAxis.count, mouseArea.width - width)
|
x: Math.min(idx * mouseArea.width / categoryAxis.count, mouseArea.width - width)
|
||||||
property double setMaxValue: d.consumptionSet && d.productionSet && d.acquisitionSet && d.returnSet ?
|
property double setMaxValue: d.consumptionSet && d.productionSet && d.acquisitionSet && d.returnSet ?
|
||||||
|
|||||||
@ -260,13 +260,13 @@ Item {
|
|||||||
width: 1
|
width: 1
|
||||||
color: Style.foregroundColor
|
color: Style.foregroundColor
|
||||||
x: mouseArea.mouseX
|
x: mouseArea.mouseX
|
||||||
visible: mouseArea.containsMouse
|
visible: mouseArea.containsMouse || mouseArea.preventStealing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NymeaToolTip {
|
NymeaToolTip {
|
||||||
id: toolTip
|
id: toolTip
|
||||||
visible: mouseArea.containsMouse
|
visible: mouseArea.containsMouse || mouseArea.preventStealing
|
||||||
|
|
||||||
backgroundItem: chartView
|
backgroundItem: chartView
|
||||||
backgroundRect: Qt.rect(mouseArea.x + toolTip.x, mouseArea.y + toolTip.y, toolTip.width, toolTip.height)
|
backgroundRect: Qt.rect(mouseArea.x + toolTip.x, mouseArea.y + toolTip.y, toolTip.width, toolTip.height)
|
||||||
|
|||||||
@ -252,12 +252,12 @@ Item {
|
|||||||
width: 1
|
width: 1
|
||||||
color: Style.foregroundColor
|
color: Style.foregroundColor
|
||||||
x: mouseArea.mouseX
|
x: mouseArea.mouseX
|
||||||
visible: mouseArea.containsMouse
|
visible: mouseArea.containsMouse || mouseArea.preventStealing
|
||||||
}
|
}
|
||||||
|
|
||||||
NymeaToolTip {
|
NymeaToolTip {
|
||||||
id: toolTip
|
id: toolTip
|
||||||
visible: mouseArea.containsMouse
|
visible: mouseArea.containsMouse || mouseArea.preventStealing
|
||||||
|
|
||||||
backgroundItem: chartView
|
backgroundItem: chartView
|
||||||
backgroundRect: Qt.rect(mouseArea.x + toolTip.x, mouseArea.y + toolTip.y, toolTip.width, toolTip.height)
|
backgroundRect: Qt.rect(mouseArea.x + toolTip.x, mouseArea.y + toolTip.y, toolTip.width, toolTip.height)
|
||||||
|
|||||||
Reference in New Issue
Block a user