Commit 07297bc6 authored by Sebastian Gottfried's avatar Sebastian Gottfried
Browse files

allow selection confirmation in lists per double click

Now it's possible to start training on a lesson or selecting a different
user profile with a simple double click on the list item if one doesn't
like to do the extra click on the confirmation buttons in these forms.

CCBUG: 316044
parent 89f8b32e
......@@ -103,7 +103,12 @@ Item {
property Lesson lesson: index < course.lessonCount? course.lesson(index): null
property bool locked: index > lessonList.lastUnlockedIndex
width: lessonList.width - scrollBar.width
onSelected: lessonList.currentIndex = index
onClicked: lessonList.currentIndex = index
onDoubleClicked: {
if (!locked) {
lessonSelected(course, lessonList.currentIndex)
}
}
iconSource: locked? "object-locked": ""
label.opacity: locked? 0.5: 1.0
title: lesson? lesson.title: ""
......
......@@ -25,7 +25,8 @@ Item {
property alias title: label.text
property string iconSource
property alias label: label
signal selected
signal clicked
signal doubleClicked
height: padding.height + bg.margins.top + bg.margins.bottom
state: ListView.isCurrentItem? "selected": mouseArea.containsMouse? "hover": "normal"
......@@ -79,7 +80,8 @@ Item {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
onClicked: root.selected()
onClicked: root.clicked()
onDoubleClicked: root.doubleClicked()
}
states: [
......
......@@ -62,7 +62,7 @@ FocusScope {
index < profileDataAccess.profileCount? profileDataAccess.profile(index).name: null
label.font.italic: isNewButton
iconSource: isNewButton? "list-add": "user-identity"
onSelected: {
onClicked: {
list.currentIndex = index
if (isNewButton) {
createNewProfile()
......@@ -71,6 +71,11 @@ FocusScope {
selectProfile(index)
}
}
onDoubleClicked: {
if (!isNewButton) {
root.profileChosen(profileDataAccess.profile(list.currentIndex))
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment