mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
add shortcut Ctrl+Alt+S for creating subfolder
This commit is contained in:
parent
14df9e6e90
commit
cd8f148946
@ -229,6 +229,8 @@ copy_targets=WithoutBackground$s:b(mark):c:i:x,OneNote$s:b(mark):c:i:m:a:x,Micro
|
||||
CaptainMode=Ctrl+E
|
||||
; Create a note in current folder
|
||||
NewNote=Ctrl+Alt+N
|
||||
; Create a subfolder in current folder
|
||||
NewSubfolder=Ctrl+Alt+S
|
||||
; Save current note
|
||||
SaveNote=Ctrl+S
|
||||
; Save changes and enter read mode
|
||||
|
@ -74,6 +74,16 @@ void VDirectoryTree::initShortcuts()
|
||||
this, [this](){
|
||||
pasteDirectoriesFromClipboard();
|
||||
});
|
||||
|
||||
QKeySequence seq = QKeySequence(g_config->getShortcutKeySequence("NewSubfolder"));
|
||||
if (!seq.isEmpty()) {
|
||||
QShortcut *newSubDirShortcut = new QShortcut(seq, this);
|
||||
newSubDirShortcut->setContext(Qt::ApplicationShortcut);
|
||||
connect(newSubDirShortcut, &QShortcut::activated,
|
||||
this, [this](){
|
||||
newSubDirectory();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void VDirectoryTree::initActions()
|
||||
@ -87,6 +97,11 @@ void VDirectoryTree::initActions()
|
||||
newSubDirAct = new QAction(VIconUtils::menuIcon(":/resources/icons/create_subdir.svg"),
|
||||
tr("&New Subfolder"), this);
|
||||
newSubDirAct->setToolTip(tr("Create a subfolder"));
|
||||
QString shortcutStr = VUtils::getShortcutText(g_config->getShortcutKeySequence("NewSubfolder"));
|
||||
if (!shortcutStr.isEmpty()) {
|
||||
newSubDirAct->setText(tr("&New Subfolder\t%1").arg(shortcutStr));
|
||||
}
|
||||
|
||||
connect(newSubDirAct, &QAction::triggered,
|
||||
this, &VDirectoryTree::newSubDirectory);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user