feat(shortcut): ctrl+w to close window

https://github.com/cutefishos/filemanager/pull/33
This commit is contained in:
kateleet 2021-12-20 23:40:18 +08:00
parent f846b4690e
commit c3f32210ec
3 changed files with 6 additions and 0 deletions

View file

@ -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) {

View file

@ -46,6 +46,7 @@ signals:
void deleteFile();
void showHidden();
void keyPressed(const QString &text);
void close();
protected:
bool eventFilter(QObject *obj, QEvent *e) override;

View file

@ -423,6 +423,9 @@ Item {
onShowHidden: {
dirModel.showHiddenFiles = !dirModel.showHiddenFiles
}
onClose: {
root.close()
}
}
function openUrl(url) {