Add keyboard navigation for printer carousel

This commit is contained in:
Ian Paschal 2018-12-19 11:26:38 +01:00
parent f1c28498a6
commit 142ac56d78
2 changed files with 12 additions and 1 deletions

View File

@ -18,6 +18,10 @@ Item
height: centerSection.height height: centerSection.height
width: maximumWidth width: maximumWidth
// Enable keyboard navigation
Keys.onLeftPressed: navigateTo(currentIndex - 1)
Keys.onRightPressed: navigateTo(currentIndex + 1)
Item Item
{ {

View File

@ -24,6 +24,11 @@ Component
} }
} }
width: maximumWidth width: maximumWidth
// Enable keyboard navigation. NOTE: This is done here so that we can also potentially
// forward to the queue items in the future. (Deleting selected print job, etc.)
Keys.forwardTo: carousel
Component.onCompleted: forceActiveFocus()
UM.I18nCatalog UM.I18nCatalog
{ {
@ -59,7 +64,9 @@ Component
} }
width: parent.width width: parent.width
height: 264 * screenScaleFactor // TODO: Theme! height: 264 * screenScaleFactor // TODO: Theme!
MonitorCarousel {} MonitorCarousel {
id: carousel
}
} }
MonitorQueue MonitorQueue