make the current tab cycle under wheel

This commit is contained in:
Marco Martin 2012-10-11 11:47:58 +02:00
parent e7a5a5fbcf
commit e2f90d95d2

View File

@ -103,8 +103,11 @@ Item {
function goNextTab() {
var oldIndex = priv.currentButtonIndex();
while (oldIndex < root.children.length - 1) {
while (oldIndex < root.children.length) {
++oldIndex
if (oldIndex > root.children.length - 1) {
oldIndex = 1
}
if (root.children[oldIndex].visible) {
priv.setCurrentButtonIndex(oldIndex)
break
@ -116,6 +119,9 @@ Item {
var oldIndex = priv.currentButtonIndex();
while (oldIndex > 0) {
--oldIndex
if (oldIndex <= 0) {
oldIndex = root.children.length - 1
}
if (root.children[oldIndex].visible) {
priv.setCurrentButtonIndex(oldIndex)
break