Implement Ctrl+Tab (Move to next tab) and Ctrl+Shift+Tab (Move to previous tab)

This commit is contained in:
Rasmus Karlsson
2017-08-13 15:24:41 +02:00
parent c9df6ddaab
commit d9f87c0824
3 changed files with 46 additions and 0 deletions
+17
View File
@@ -3,6 +3,7 @@
#include "colorscheme.hpp"
#include "completionmanager.hpp"
#include "ircmanager.hpp"
#include "notebook.hpp"
#include "notebookpage.hpp"
#include "settingsmanager.hpp"
@@ -128,6 +129,22 @@ ChatWidgetInput::ChatWidgetInput(ChatWidget *_chatWidget)
page->requestFocus(reqX, reqY);
}
} else if (event->key() == Qt::Key_Tab) {
if (event->modifiers() == Qt::ControlModifier) {
NotebookPage *page = static_cast<NotebookPage *>(this->chatWidget->parentWidget());
Notebook *notebook = static_cast<Notebook *>(page->parentWidget());
notebook->nextTab();
}
} else if (event->key() == Qt::Key_Backtab) {
if (event->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier)) {
NotebookPage *page = static_cast<NotebookPage *>(this->chatWidget->parentWidget());
Notebook *notebook = static_cast<Notebook *>(page->parentWidget());
notebook->previousTab();
}
}
});