fixed bug with menu

This commit is contained in:
Dante Ruiz 2017-01-18 16:45:27 +00:00
parent baff07b0f9
commit fa3bea52cd
3 changed files with 14 additions and 7 deletions

View file

@ -108,12 +108,7 @@ FocusScope {
}
currentIndex = originalIndex;
}
function previousItem() { currentIndex = (currentIndex + count - 1) % count; }
function nextItem() { currentIndex = (currentIndex + count + 1) % count; }
function selectCurrentItem() { if (currentIndex != -1) root.selected(currentItem.source); }
function previousPage() { root.parent.pop(); }
Keys.onUpPressed: previousItem();
Keys.onDownPressed: nextItem();
Keys.onSpacePressed: selectCurrentItem();
@ -121,6 +116,13 @@ FocusScope {
Keys.onReturnPressed: selectCurrentItem();
Keys.onLeftPressed: previousPage();
}
function previousItem() { listView.currentIndex = (listView.currentIndex + listView.count - 1) % listView.count; }
function nextItem() { listView.currentIndex = (listView.currentIndex + listView.count + 1) % listView.count; }
function selectCurrentItem() { if (listView.currentIndex != -1) root.selected(currentItem.source); }
function previousPage() { root.parent.pop(); }
}

View file

@ -171,4 +171,9 @@ Item {
return false;
}
function previousItem() { d.topMenu.previousItem(); }
function nextItem() { d.topMenu.nextItem(); }
function selectCurrentItem() { d.topMenu.selectCurrentItem(); }
function previousPage() { d.topMenu.previousPage(); }
}

View file

@ -347,7 +347,7 @@ QQuickItem* TabletProxy::getQmlMenu() const {
return nullptr;
}
QQuickItem* menuList = VrMenu->findChild<QQuickItem*>("menuList");
QQuickItem* menuList = VrMenu->findChild<QQuickItem*>("tabletMenuHandlerItem");
if (!menuList) {
return nullptr;
}