summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Gottfried <sebastian.gottfried@posteo.de>2016-11-15 09:23:30 (GMT)
committerSebastian Gottfried <sebastian.gottfried@posteo.de>2016-11-15 09:23:30 (GMT)
commitd9fdabbee3ea36e604540a0410bb90f2111bf04f (patch)
tree5ae41517b85195292bc3d9206aeb4670b6699ea4
parent01a6ed83821e0af7b7b27e6f67898ae67785424c (diff)
Training Screen: Set Initial Keyboard Focus
Depending on whether there is a next lesson or not, the button to advance to the next lesson or to repeat the current lesson receives the focus.
-rw-r--r--src/qml/ScoreScreen.qml11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/qml/ScoreScreen.qml b/src/qml/ScoreScreen.qml
index bf66ec9..ab58539 100644
--- a/src/qml/ScoreScreen.qml
+++ b/src/qml/ScoreScreen.qml
@@ -74,6 +74,15 @@ FocusScope {
learningProgressModel.update()
}
+ function forceActiveFocus() {
+ if (internal.nextLesson) {
+ nextLessonButton.forceActiveFocus()
+ }
+ else {
+ repeatLessonButton.forceActiveFocus()
+ }
+ }
+
property Profile profile
property Lesson lesson
property Course course
@@ -266,7 +275,7 @@ FocusScope {
id: nextLessonButton
iconName: "go-next-view"
text: i18n("Next Lesson")
- enabled: !!internal.nextLesson
+ enabled: internal.nextLesson
onClicked: screen.nextLessonRequested(internal.nextLesson)
}
}