New folder dialog editor supports the enter shortcut

This commit is contained in:
reven 2021-04-17 00:17:18 +08:00
parent ce2a66656f
commit 8dc6426b7e
2 changed files with 5 additions and 1 deletions

View file

@ -38,6 +38,11 @@ Window {
text: qsTr("New folder") text: qsTr("New folder")
focus: true focus: true
onAccepted: {
main.newFolder(_textField.text)
control.close()
}
Component.onCompleted: { Component.onCompleted: {
_textField.selectAll() _textField.selectAll()
} }

View file

@ -42,7 +42,6 @@ Item {
id: dirModel id: dirModel
viewAdapter: viewAdapter viewAdapter: viewAdapter
Component.onCompleted: { Component.onCompleted: {
if (arg) if (arg)
dirModel.url = arg dirModel.url = arg