aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Gottfried <sebastian.gottfried@posteo.de>2016-11-22 09:13:24 (GMT)
committerSebastian Gottfried <sebastian.gottfried@posteo.de>2016-11-22 09:13:24 (GMT)
commit4cb4b32d869acd6ca95b4dd833c996d6998d2444 (patch)
treefd7f223303b0f9ada72cef176043a5a283aad4c9
parent92441518d6f5a1e58fd880e3633da72d006fde9f (diff)
Score Screen: Resurrect Learning Progress Legend
Without it the learning progress chart is quite difficult to make sense of. Its code got deleted accidentally removed during the KF5 port.
-rw-r--r--src/qml/ScoreScreen.qml26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/qml/ScoreScreen.qml b/src/qml/ScoreScreen.qml
index ab58539..6cc11e2 100644
--- a/src/qml/ScoreScreen.qml
+++ b/src/qml/ScoreScreen.qml
@@ -431,9 +431,24 @@ FocusScope {
Item {
Layout.fillHeight: true
Layout.fillWidth: true
-
}
+ Charts.LegendItem {
+ id: accuracyLegend
+ anchors.verticalCenter: parent.verticalCenter
+ opacity: tabGroup.currentTab === learningProgressTab? 1: 0
+ Behavior on opacity {
+ NumberAnimation {duration: 150}
+ }
+ }
+ Charts.LegendItem {
+ id: charactersPerMinuteLegend
+ anchors.verticalCenter: parent.verticalCenter
+ opacity: tabGroup.currentTab === learningProgressTab? 1: 0
+ Behavior on opacity {
+ NumberAnimation {duration: 150}
+ }
+ }
}
TabView {
@@ -464,6 +479,15 @@ FocusScope {
onElemExited: {
learningProgressPointTooltip.close()
}
+
+ Component.onCompleted: {
+ accuracyLegend.dimension = learningProgressChart.accuracy
+ charactersPerMinuteLegend.dimension = learningProgressChart.charactersPerMinute
+ }
+ Component.onDestruction: {
+ accuracyLegend.dimension = 0
+ charactersPerMinuteLegend.dimension = 0
+ }
}
}