From e2f90d95d2304d3d4add59d49753999df67ed528 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 11 Oct 2012 11:47:58 +0200 Subject: [PATCH] make the current tab cycle under wheel --- .../plasmacomponents/qml/private/TabBarLayout.qml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/declarativeimports/plasmacomponents/qml/private/TabBarLayout.qml b/declarativeimports/plasmacomponents/qml/private/TabBarLayout.qml index c1b1c21ee..bac4043ac 100644 --- a/declarativeimports/plasmacomponents/qml/private/TabBarLayout.qml +++ b/declarativeimports/plasmacomponents/qml/private/TabBarLayout.qml @@ -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