Merge PR #840: Improve energy tooltips a little more
This commit is contained in:
commit
295f9af81a
@ -8,10 +8,31 @@ Item {
|
|||||||
property alias backgroundItem: blurEffectSource.sourceItem
|
property alias backgroundItem: blurEffectSource.sourceItem
|
||||||
property alias backgroundRect: blurEffectSource.sourceRect
|
property alias backgroundRect: blurEffectSource.sourceRect
|
||||||
|
|
||||||
Behavior on x { NumberAnimation { duration: Style.animationDuration } }
|
Behavior on x { enabled: d.animationsEnabled; NumberAnimation { duration: Style.animationDuration } }
|
||||||
Behavior on y { NumberAnimation { duration: Style.animationDuration } }
|
Behavior on y { enabled: d.animationsEnabled; NumberAnimation { duration: Style.animationDuration } }
|
||||||
Behavior on width { NumberAnimation { duration: Style.animationDuration } }
|
Behavior on width { enabled: d.animationsEnabled; NumberAnimation { duration: Style.animationDuration } }
|
||||||
Behavior on height { NumberAnimation { duration: Style.animationDuration } }
|
Behavior on height { enabled: d.animationsEnabled; NumberAnimation { duration: Style.animationDuration } }
|
||||||
|
|
||||||
|
readonly property alias animationsEnabled: d.animationsEnabled
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
running: visible
|
||||||
|
repeat: false
|
||||||
|
interval: 1
|
||||||
|
onTriggered: {
|
||||||
|
d.animationsEnabled = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onVisibleChanged: {
|
||||||
|
if (!visible) {
|
||||||
|
d.animationsEnabled = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: d
|
||||||
|
property bool animationsEnabled: false
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: blurSource
|
id: blurSource
|
||||||
|
|||||||
@ -378,7 +378,7 @@ StatsBase {
|
|||||||
visible: toolTip.visible
|
visible: toolTip.visible
|
||||||
|
|
||||||
x: idx * parent.width / categoryAxis.count
|
x: idx * parent.width / categoryAxis.count
|
||||||
Behavior on x { NumberAnimation { duration: Style.animationDuration } }
|
Behavior on x { enabled: toolTip.animationsEnabled; NumberAnimation { duration: Style.animationDuration } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -379,7 +379,7 @@ StatsBase {
|
|||||||
visible: toolTip.visible
|
visible: toolTip.visible
|
||||||
|
|
||||||
x: idx * parent.width / categoryAxis.count
|
x: idx * parent.width / categoryAxis.count
|
||||||
Behavior on x { NumberAnimation { duration: Style.animationDuration } }
|
Behavior on x { enabled: toolTip.animationsEnabled; NumberAnimation { duration: Style.animationDuration } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -415,9 +415,10 @@ StatsBase {
|
|||||||
x: chartWidth - (idx * barWidth + barWidth + Style.smallMargins) > width ?
|
x: chartWidth - (idx * barWidth + barWidth + Style.smallMargins) > width ?
|
||||||
idx * barWidth + barWidth + Style.smallMargins
|
idx * barWidth + barWidth + Style.smallMargins
|
||||||
: idx * barWidth - Style.smallMargins - width
|
: idx * barWidth - Style.smallMargins - width
|
||||||
property double setMaxValue: d.consumptionSet && d.productionSet && d.acquisitionSet && d.returnSet ?
|
property double setMaxValue: Math.max(d.consumptionSet ? d.consumptionSet.at(idx) : 0,
|
||||||
Math.max(d.consumptionSet.at(idx), Math.max(d.productionSet.at(idx), Math.max(d.acquisitionSet.at(idx), d.returnSet.at(idx))))
|
d.productionSet ? d.productionSet.at(idx) : 0,
|
||||||
: 0
|
d.acquisitionSet ? d.acquisitionSet.at(idx) : 0,
|
||||||
|
d.returnSet ? d.returnSet.at(idx) : 0)
|
||||||
y: Math.min(Math.max(mouseArea.height - (setMaxValue * mouseArea.height / valueAxis.max) - height - Style.smallMargins, 0), mouseArea.height - height)
|
y: Math.min(Math.max(mouseArea.height - (setMaxValue * mouseArea.height / valueAxis.max) - height - Style.smallMargins, 0), mouseArea.height - height)
|
||||||
width: tooltipLayout.implicitWidth + Style.smallMargins * 2
|
width: tooltipLayout.implicitWidth + Style.smallMargins * 2
|
||||||
height: tooltipLayout.implicitHeight + Style.smallMargins * 2
|
height: tooltipLayout.implicitHeight + Style.smallMargins * 2
|
||||||
|
|||||||
Reference in New Issue
Block a user