[ui] tab to focus search bar + click on empty area to loose focus

This commit is contained in:
Loïc Vital 2022-11-07 14:43:26 +01:00
parent e24310d1a1
commit b829a2d9f4
4 changed files with 53 additions and 10 deletions

View file

@ -108,7 +108,7 @@ Panel {
headerBar: RowLayout {
SearchBar {
id: searchBar
width: 100
width: 150
}
MaterialToolButton {
@ -249,8 +249,6 @@ Panel {
onPressed: {
grid.currentIndex = DelegateModel.filteredIndex
if(mouse.button == Qt.LeftButton)
grid.forceActiveFocus()
}
function sendRemoveRequest()
@ -357,6 +355,11 @@ Panel {
grid.moveCurrentIndexDown()
event.accepted = true
}
else if (event.key == Qt.Key_Tab)
{
searchBar.forceActiveFocus()
event.accepted = true
}
}
}
@ -452,6 +455,15 @@ Panel {
}
}
}
MouseArea {
anchors.fill: parent
onPressed: {
if(mouse.button == Qt.LeftButton)
grid.forceActiveFocus()
mouse.accepted = false
}
}
}
Item {