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();
|
emit copy();
|
||||||
} else if (keyEvent->key() == Qt::Key_X && keyEvent->modifiers() & Qt::ControlModifier) {
|
} else if (keyEvent->key() == Qt::Key_X && keyEvent->modifiers() & Qt::ControlModifier) {
|
||||||
emit cut();
|
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) {
|
} else if (keyEvent->key() == Qt::Key_V && keyEvent->modifiers() & Qt::ControlModifier) {
|
||||||
emit paste();
|
emit paste();
|
||||||
} else if (keyEvent->key() == Qt::Key_F2) {
|
} else if (keyEvent->key() == Qt::Key_F2) {
|
||||||
|
|
|
@ -46,6 +46,7 @@ signals:
|
||||||
void deleteFile();
|
void deleteFile();
|
||||||
void showHidden();
|
void showHidden();
|
||||||
void keyPressed(const QString &text);
|
void keyPressed(const QString &text);
|
||||||
|
void close();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *obj, QEvent *e) override;
|
bool eventFilter(QObject *obj, QEvent *e) override;
|
||||||
|
|
|
@ -423,6 +423,9 @@ Item {
|
||||||
onShowHidden: {
|
onShowHidden: {
|
||||||
dirModel.showHiddenFiles = !dirModel.showHiddenFiles
|
dirModel.showHiddenFiles = !dirModel.showHiddenFiles
|
||||||
}
|
}
|
||||||
|
onClose: {
|
||||||
|
root.close()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function openUrl(url) {
|
function openUrl(url) {
|
||||||
|
|
Loading…
Reference in a new issue