Move CTRL+T hotkey handling to Notebook

CTRL+T Can now be called anywhere in the window
This commit is contained in:
Rasmus Karlsson
2018-04-07 12:27:08 +02:00
parent 84c577c0dc
commit 179cd5552d
3 changed files with 12 additions and 4 deletions
+11
View File
@@ -4,6 +4,7 @@
#include "singletons/windowmanager.hpp"
#include "widgets/helper/notebookbutton.hpp"
#include "widgets/helper/notebooktab.hpp"
#include "widgets/helper/shortcut.hpp"
#include "widgets/settingsdialog.hpp"
#include "widgets/splitcontainer.hpp"
#include "widgets/window.hpp"
@@ -51,6 +52,16 @@ Notebook::Notebook(Window *parent, bool _showButtons)
closeConfirmDialog.setDefaultButton(QMessageBox::Yes);
this->scaleChangedEvent(this->getScale());
// Window-wide hotkeys
// CTRL+T: Create new split in selected notebook page
CreateWindowShortcut(this, "CTRL+T", [this]() {
if (this->selectedPage == nullptr) {
return;
}
this->selectedPage->addChat(true);
});
}
SplitContainer *Notebook::addNewPage(bool select)