Add shortcut key for ShowHiddenFiles

This commit is contained in:
reionwong 2021-10-22 22:25:16 +08:00
parent d091f6f9a2
commit 08e58c66b6
4 changed files with 9 additions and 0 deletions

View file

@ -68,6 +68,8 @@ bool ShortCut::eventFilter(QObject *obj, QEvent *e)
emit deleteFile();
} else if (keyEvent->key() == Qt::Key_F5) {
emit refresh();
} else if (keyEvent->key() == Qt::Key_H && keyEvent->modifiers() & Qt::ControlModifier) {
emit showHidden();
} else if (keyEvent->key() >= Qt::Key_A && keyEvent->key() <= Qt::Key_Z) {
// Handle select
// KeyboardSearchManager::self()->addKeys(keyEvent->text());

View file

@ -44,6 +44,7 @@ signals:
void selectAll();
void backspace();
void deleteFile();
void showHidden();
void keyPressed(const QString &text);
protected:

View file

@ -137,6 +137,9 @@ Item {
onKeyPressed: {
dirModel.keyboardSearch(text)
}
onShowHidden: {
dirModel.showHiddenFiles = !dirModel.showHiddenFiles
}
}
Component {

View file

@ -397,6 +397,9 @@ Item {
onKeyPressed: {
dirModel.keyboardSearch(text)
}
onShowHidden: {
dirModel.showHiddenFiles = !dirModel.showHiddenFiles
}
}
function openUrl(url) {