diff --git a/helper/shortcut.cpp b/helper/shortcut.cpp index 0e62b65..5edaf79 100644 --- a/helper/shortcut.cpp +++ b/helper/shortcut.cpp @@ -54,6 +54,8 @@ bool ShortCut::eventFilter(QObject *obj, QEvent *e) emit copy(); } else if (keyEvent->key() == Qt::Key_X && keyEvent->modifiers() & Qt::ControlModifier) { emit cut(); + } else if (keyEvent->key() == Qt::Key_W && keyEvent->modifiers() & Qt::ControlModifier) { + emit close(); } else if (keyEvent->key() == Qt::Key_V && keyEvent->modifiers() & Qt::ControlModifier) { emit paste(); } else if (keyEvent->key() == Qt::Key_F2) { diff --git a/helper/shortcut.h b/helper/shortcut.h index 6a24b96..2efb7d5 100644 --- a/helper/shortcut.h +++ b/helper/shortcut.h @@ -46,6 +46,7 @@ signals: void deleteFile(); void showHidden(); void keyPressed(const QString &text); + void close(); protected: bool eventFilter(QObject *obj, QEvent *e) override; diff --git a/qml/FolderPage.qml b/qml/FolderPage.qml index 31486a0..0c5b117 100644 --- a/qml/FolderPage.qml +++ b/qml/FolderPage.qml @@ -423,6 +423,9 @@ Item { onShowHidden: { dirModel.showHiddenFiles = !dirModel.showHiddenFiles } + onClose: { + root.close() + } } function openUrl(url) {