summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Gottfried <sebastian.gottfried@posteo.de>2016-10-25 14:46:04 (GMT)
committerSebastian Gottfried <sebastian.gottfried@posteo.de>2016-10-25 14:46:04 (GMT)
commit3c9193c969cbcc4b8e58f1a25e3007e19f760df0 (patch)
tree8bc44f6fd4c4813d8c89fd42113a6ffbfb754c8e
parent6c65872ee25eb7082723d6280f451b8d75a0597b (diff)
Home Screen: Fix Course Switchingrefs/backups/branch-frameworks-1478023228
The visibility of the switch buttons must be set imperatively because C++ models have no notifiable row count property.
-rw-r--r--src/qml/CourseSelector.qml4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/CourseSelector.qml b/src/qml/CourseSelector.qml
index bc25127..a8d6761 100644
--- a/src/qml/CourseSelector.qml
+++ b/src/qml/CourseSelector.qml
@@ -88,11 +88,13 @@ Item {
Connections {
target: courseModel
onRowsRemoved: {
+ nextButton.visible = previousButton.visible = courseModel.rowCount() > 1
priv.currentIndex = -1
selectLastUsedCourse()
}
onRowsInserted: {
+ nextButton.visible = previousButton.visible = courseModel.rowCount() > 1
priv.currentIndex = -1
selectLastUsedCourse()
}
@@ -157,7 +159,6 @@ Item {
anchors.verticalCenter: parent.verticalCenter
iconName: "arrow-left"
enabled: priv.currentIndex > 0
- visible: courseModel.rowCount() > 0
onClicked: {
var newIndex = priv.currentIndex - 1
root.selectCourse(newIndex, false)
@@ -168,7 +169,6 @@ Item {
id: nextButton
iconName: "arrow-right"
enabled: priv.currentIndex < courseModel.rowCount()
- visible: courseModel.rowCount() > 0
onClicked: {
var newIndex = (priv.currentIndex + 1) % (courseModel.rowCount() + 1)
root.selectCourse(newIndex, false)