[tabbox] Fix key navigation in icons based tabbox
This commit is contained in:
parent
d1798202e8
commit
f747f370b3
3 changed files with 30 additions and 12 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue