Add support for back key on desktop keyboard

This commit is contained in:
Angela Mazzurco 2017-07-04 15:35:45 +02:00
parent 0a17cbefec
commit d19950f0df

View File

@ -193,6 +193,25 @@ ApplicationWindow
anchors.fill: parent
focus: true
onCurrentItemChanged:
{
if (currentItem)
{
currentItem.forceActiveFocus()
setStatus (currentItem)
}
}
Keys.onReleased:
{
if ((event.key === Qt.Key_Back || Qt.Key_Backspace) && stackView.depth > 1)
{
stackView.pop();
event.accepted = true;
setStatus (stackView.currentItem)
}
}
function setStatus (currentItem)
{
if (currentItem)
{