[tabbox] Fix key navigation in icons based tabbox

icc-effect-5.14.5
Martin Gräßlin 2014-06-03 14:16:05 +02:00
parent d1798202e8
commit f747f370b3
3 changed files with 30 additions and 12 deletions

View File

@ -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();
}
}
}

View File

@ -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();
}
}
}
}
}

View File

@ -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();
}
}
}
}
}