diff --git a/tabbox/qml/IconTabBox.qml b/tabbox/qml/IconTabBox.qml index c56bc241ba..589d3da7e2 100644 --- a/tabbox/qml/IconTabBox.qml +++ b/tabbox/qml/IconTabBox.qml @@ -23,6 +23,12 @@ import org.kde.kquickcontrolsaddons 2.0 Item { id: iconsTabBox + function decrementCurrentIndex() { + iconsListView.decrementCurrentIndex(); + } + function incrementCurrentIndex() { + iconsListView.incrementCurrentIndex(); + } property int iconSize property alias count: iconsListView.count property alias margins: hoverItem.margins @@ -92,16 +98,4 @@ Item { highlightMoveDuration: 250 boundsBehavior: Flickable.StopAtBounds } - /* - * Key navigation on outer item for two reasons: - * @li we have to emit the change signal - * @li on multiple invocation it does not work on the list view. Focus seems to be lost. - **/ - Keys.onPressed: { - if (event.key == Qt.Key_Left) { - iconsListView.decrementCurrentIndex(); - } else if (event.key == Qt.Key_Right) { - iconsListView.incrementCurrentIndex(); - } - } } diff --git a/tabbox/qml/clients/big_icons/contents/ui/main.qml b/tabbox/qml/clients/big_icons/contents/ui/main.qml index 241c9f208b..74cef21ae0 100644 --- a/tabbox/qml/clients/big_icons/contents/ui/main.qml +++ b/tabbox/qml/clients/big_icons/contents/ui/main.qml @@ -102,6 +102,18 @@ KWin.Switcher { } } } + /* + * Key navigation on outer item for two reasons: + * @li we have to emit the change signal + * @li on multiple invocation it does not work on the list view. Focus seems to be lost. + **/ + Keys.onPressed: { + if (event.key == Qt.Key_Left) { + icons.decrementCurrentIndex(); + } else if (event.key == Qt.Key_Right) { + icons.incrementCurrentIndex(); + } + } } } } diff --git a/tabbox/qml/clients/small_icons/contents/ui/main.qml b/tabbox/qml/clients/small_icons/contents/ui/main.qml index 03e2b617f0..ec4a4d769e 100644 --- a/tabbox/qml/clients/small_icons/contents/ui/main.qml +++ b/tabbox/qml/clients/small_icons/contents/ui/main.qml @@ -83,6 +83,18 @@ KWin.Switcher { } } } + /* + * Key navigation on outer item for two reasons: + * @li we have to emit the change signal + * @li on multiple invocation it does not work on the list view. Focus seems to be lost. + **/ + Keys.onPressed: { + if (event.key == Qt.Key_Left) { + icons.decrementCurrentIndex(); + } else if (event.key == Qt.Key_Right) { + icons.incrementCurrentIndex(); + } + } } } }