add notebooknodeexplorer shortcut cut (#2100)

This commit is contained in:
chendapao 2022-04-16 10:09:15 +08:00 committed by GitHub
parent cf0146050e
commit dfa4e59737
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View File

@ -71,6 +71,7 @@ namespace vnotex
UnitedEntry,
Copy,
Paste,
Cut,
Properties,
Global_WakeUp,
MaxShortcut

View File

@ -62,6 +62,7 @@
"OpenLastClosedFile" : "Ctrl+Shift+T",
"UnitedEntry" : "Ctrl+G, G",
"Copy" : "Ctrl+C",
"Cut" : "Ctrl+X",
"Paste" : "Ctrl+V",
"Properties" : "F2",
"Global_WakeUp" : "Ctrl+Alt+U"

View File

@ -1173,6 +1173,7 @@ QAction *NotebookNodeExplorer::createAction(Action p_act, QObject *p_parent, boo
this, [this, p_master]() {
copySelectedNodes(true, p_master);
});
WidgetUtils::addActionShortcutText(act, coreConfig.getShortcut(CoreConfig::Cut));
break;
case Action::Paste:
@ -2186,6 +2187,17 @@ void NotebookNodeExplorer::setupShortcuts()
}
}
// Cut
{
auto shortcut = WidgetUtils::createShortcut(coreConfig.getShortcut(CoreConfig::Cut), this);
if (shortcut) {
connect(shortcut, &QShortcut::activated,
this, [this]() {
copySelectedNodes(true, isActionFromMaster());
});
}
}
// Paste
{
auto shortcut = WidgetUtils::createShortcut(coreConfig.getShortcut(CoreConfig::Paste), this);