feat(shortcut): ctrl+w to close window
https://github.com/cutefishos/filemanager/pull/33
This commit is contained in:
parent
f846b4690e
commit
c3f32210ec
3 changed files with 6 additions and 0 deletions
|
@ -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) {
|
||||
|
|
|
@ -46,6 +46,7 @@ signals:
|
|||
void deleteFile();
|
||||
void showHidden();
|
||||
void keyPressed(const QString &text);
|
||||
void close();
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *e) override;
|
||||
|
|
|
@ -423,6 +423,9 @@ Item {
|
|||
onShowHidden: {
|
||||
dirModel.showHiddenFiles = !dirModel.showHiddenFiles
|
||||
}
|
||||
onClose: {
|
||||
root.close()
|
||||
}
|
||||
}
|
||||
|
||||
function openUrl(url) {
|
||||
|
|
Loading…
Reference in a new issue