summary refs log tree commit diff
path: root/src/MainWindow.cc
diff options
context:
space:
mode:
authorJani Mustonen <janijohannes@kapsi.fi>2017-11-03 08:54:17 +0200
committermujx <mujx@users.noreply.github.com>2017-11-03 08:54:17 +0200
commit13cb0521fa4fd692f66a89c83ef17b7e3ea339bb (patch)
tree632e0721e88b301e2ed7b45a10e9f48bf18004f6 /src/MainWindow.cc
parentUpdate issue template (diff)
downloadnheko-13cb0521fa4fd692f66a89c83ef17b7e3ea339bb.tar.xz
Improvements to the quick switcher (#109)
- Ghetto disambiguation for the quick switcher
- Fix the Ctrl+K shortcut
- Fix keyboard focus when the quick switcher is closed

fixes #114
Diffstat (limited to 'src/MainWindow.cc')
-rw-r--r--src/MainWindow.cc14
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;