1 files changed, 5 insertions, 9 deletions
diff --git a/src/MainWindow.cc b/src/MainWindow.cc
index 04576d44..9c81ef85 100644
--- a/src/MainWindow.cc
+++ b/src/MainWindow.cc
@@ -114,6 +114,11 @@ MainWindow::MainWindow(QWidget *parent)
QShortcut *quitShortcut = new QShortcut(QKeySequence::Quit, this);
connect(quitShortcut, &QShortcut::activated, this, QApplication::quit);
+ QShortcut *quickSwitchShortcut = new QShortcut(QKeySequence("Ctrl+K"), this);
+ connect(quickSwitchShortcut, &QShortcut::activated, this, [=]() {
+ chat_page_->showQuickSwitcher();
+ });
+
QSettings settings;
trayIcon_->setVisible(userSettings_->isTrayEnabled());
@@ -128,15 +133,6 @@ MainWindow::MainWindow(QWidget *parent)
}
void
-MainWindow::keyPressEvent(QKeyEvent *e)
-{
- if ((e->key() == Qt::Key_K) && (e->modifiers().testFlag(Qt::ControlModifier)))
- chat_page_->showQuickSwitcher();
- else
- QMainWindow::keyPressEvent(e);
-}
-
-void
MainWindow::restoreWindowSize()
{
QSettings settings;
|