Fix #3885: Clean up keys filter

This commit is contained in:
Igor Malinovskiy
2017-09-14 11:55:49 +03:00
parent 192f49dcbe
commit 3bb53b1cf1
2 changed files with 18 additions and 2 deletions
+6 -1
View File
@@ -10,6 +10,7 @@ TreeView {
id: root
alternatingRowColors: false
headerVisible: false
focus: true
TableViewColumn {
title: "item"
@@ -34,7 +35,7 @@ TreeView {
width: root.width - 20
}
itemDelegate: Item {
itemDelegate: FocusScope {
id: itemRoot
Item {
@@ -96,6 +97,10 @@ TreeView {
return ""
}
}
onLoaded: {
wrapper.forceActiveFocus()
}
}
MouseArea {
+12 -1
View File
@@ -6,6 +6,14 @@ import "."
RowLayout {
id: root
focus: true
Keys.onPressed: {
if (state == "filter" && event.key == Qt.Key_Escape) {
state = "menu"
}
}
property var shortcuts: {
'add': Qt.platform.os == "osx"? "Meta+N" : "Ctrl+N",
'reload': Qt.platform.os == "osx"? "Meta+R" : "Ctrl+R",
@@ -145,7 +153,10 @@ RowLayout {
return connectionsManager.getMetadata(styleData.index, "filter")
}
onAccepted: filterOk.setFilter()
onAccepted: {
filterOk.setFilter()
focus = false
}
}
ToolButton {