mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
milou: make possible to use keyboard and fix scrolling
This commit is contained in:
parent
2da1bb150f
commit
afd8f59b89
1 changed files with 23 additions and 3 deletions
|
|
@ -79,6 +79,12 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
Keys.onPressed: event => {
|
||||
if (event.key === Qt.Key_Down) {
|
||||
listView.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
Flickable {
|
||||
id: flickable
|
||||
|
||||
|
|
@ -186,16 +192,24 @@ Item {
|
|||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.fillHeight: listView.contentHeight > availableHeight
|
||||
|
||||
Milou.ResultsListView {
|
||||
id: listView
|
||||
queryString: queryField.text
|
||||
highlight: null
|
||||
clip: true
|
||||
PlasmaCore.ColorScope.colorGroup: PlasmaCore.Theme.NormalColorGroup
|
||||
|
||||
onActivated: queryField.text = "";
|
||||
highlight: activeFocus ? highlightComponent : null
|
||||
Component{
|
||||
id: highlightComponent
|
||||
|
||||
PlasmaExtras.Highlight {}
|
||||
}
|
||||
|
||||
onActivated: {
|
||||
root.close();
|
||||
}
|
||||
onUpdateQueryString: {
|
||||
queryField.text = text
|
||||
queryField.cursorPosition = cursorPosition
|
||||
|
|
@ -214,6 +228,12 @@ Item {
|
|||
}
|
||||
hoverEnabled: true
|
||||
|
||||
function activateNextAction() {
|
||||
queryField.forceActiveFocus();
|
||||
queryField.selectAll();
|
||||
listView.currentIndex = -1;
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: delegate.pressed ? Qt.rgba(255, 255, 255, 0.2) : (delegate.containsMouse ? Qt.rgba(255, 255, 255, 0.05) : "transparent")
|
||||
|
|
|
|||
Loading…
Reference in a new issue