mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
Move ctrl-k callback to the MainWindow
This commit is contained in:
parent
9b60fdd620
commit
8a9a513ecd
4 changed files with 11 additions and 13 deletions
|
@ -48,6 +48,7 @@ public:
|
|||
|
||||
// Initialize all the components of the UI.
|
||||
void bootstrap(QString userid, QString homeserver, QString token);
|
||||
void showQuickSwitcher();
|
||||
|
||||
signals:
|
||||
void contentLoaded();
|
||||
|
@ -69,14 +70,10 @@ private slots:
|
|||
void addRoom(const QString &room_id);
|
||||
void removeRoom(const QString &room_id);
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
private:
|
||||
void updateTypingUsers(const QString &roomid, const QList<QString> &user_ids);
|
||||
void updateDisplayNames(const RoomState &state);
|
||||
void loadStateFromCache();
|
||||
void showQuickSwitcher();
|
||||
|
||||
QHBoxLayout *topLayout_;
|
||||
Splitter *splitter;
|
||||
|
|
|
@ -43,6 +43,7 @@ public:
|
|||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
|
||||
private slots:
|
||||
// Handle interaction with the tray icon.
|
||||
|
|
|
@ -576,15 +576,6 @@ ChatPage::loadStateFromCache()
|
|||
client_->sync();
|
||||
}
|
||||
|
||||
void
|
||||
ChatPage::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (event->key() == Qt::Key_K) {
|
||||
if (event->modifiers() == Qt::ControlModifier)
|
||||
showQuickSwitcher();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ChatPage::showQuickSwitcher()
|
||||
{
|
||||
|
|
|
@ -100,6 +100,15 @@ 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()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue