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
This commit is contained in:
Jani Mustonen 2017-11-03 08:54:17 +02:00 committed by mujx
parent beda0db543
commit 13cb0521fa
6 changed files with 31 additions and 13 deletions

View file

@ -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());
@ -127,15 +132,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()
{