fix keyboard navigation

This commit is contained in:
Marco Martin 2013-11-08 10:01:24 +01:00
parent d6f38863fa
commit 2d66e7c8a0
2 changed files with 5 additions and 6 deletions

View file

@ -90,7 +90,7 @@ Item {
spacing: 5
highlightMoveDuration: 250
width: Math.min(parent.width - (anchors.leftMargin + anchors.rightMargin) - (hoverItem.margins.left + hoverItem.margins.right), thumbnailWidth * count + 5 * (count - 1))
clip: true
delegate: Item {
property alias data: thumbnailItem.data
@ -106,7 +106,6 @@ Item {
}
width: thumbnailListView.thumbnailWidth
height: thumbnailListView.thumbnailWidth*(1.0/screenFactor)
}
MouseArea {
anchors.fill: parent
@ -157,10 +156,10 @@ Item {
* @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) {
if (event.key == Qt.Key_Up) {
thumbnailListView.decrementCurrentIndex();
thumbnailListView.currentIndexChanged(thumbnailListView.currentIndex);
} else if (event.key == Qt.Key_Right) {
} else if (event.key == Qt.Key_Down) {
thumbnailListView.incrementCurrentIndex();
thumbnailListView.currentIndexChanged(thumbnailListView.currentIndex);
}

View file

@ -7,8 +7,8 @@ Icon=preferences-system-windows-switcher-thumbnails
X-Plasma-API=declarativeappletscript
X-Plasma-MainScript=ui/main.qml
X-KDE-PluginInfo-Author=Martin Gräßlin
X-KDE-PluginInfo-Email=mgraesslin@kde.org
X-KDE-PluginInfo-Author=Marco Martin
X-KDE-PluginInfo-Email=mart@kde.org
X-KDE-PluginInfo-Name=sidebar
X-KDE-PluginInfo-Version=1.0