mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +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.
|
// Initialize all the components of the UI.
|
||||||
void bootstrap(QString userid, QString homeserver, QString token);
|
void bootstrap(QString userid, QString homeserver, QString token);
|
||||||
|
void showQuickSwitcher();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void contentLoaded();
|
void contentLoaded();
|
||||||
|
@ -69,14 +70,10 @@ private slots:
|
||||||
void addRoom(const QString &room_id);
|
void addRoom(const QString &room_id);
|
||||||
void removeRoom(const QString &room_id);
|
void removeRoom(const QString &room_id);
|
||||||
|
|
||||||
protected:
|
|
||||||
void keyPressEvent(QKeyEvent *event) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateTypingUsers(const QString &roomid, const QList<QString> &user_ids);
|
void updateTypingUsers(const QString &roomid, const QList<QString> &user_ids);
|
||||||
void updateDisplayNames(const RoomState &state);
|
void updateDisplayNames(const RoomState &state);
|
||||||
void loadStateFromCache();
|
void loadStateFromCache();
|
||||||
void showQuickSwitcher();
|
|
||||||
|
|
||||||
QHBoxLayout *topLayout_;
|
QHBoxLayout *topLayout_;
|
||||||
Splitter *splitter;
|
Splitter *splitter;
|
||||||
|
|
|
@ -43,6 +43,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
|
void keyPressEvent(QKeyEvent *event);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
// Handle interaction with the tray icon.
|
// Handle interaction with the tray icon.
|
||||||
|
|
|
@ -576,15 +576,6 @@ ChatPage::loadStateFromCache()
|
||||||
client_->sync();
|
client_->sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
ChatPage::keyPressEvent(QKeyEvent *event)
|
|
||||||
{
|
|
||||||
if (event->key() == Qt::Key_K) {
|
|
||||||
if (event->modifiers() == Qt::ControlModifier)
|
|
||||||
showQuickSwitcher();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ChatPage::showQuickSwitcher()
|
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
|
void
|
||||||
MainWindow::restoreWindowSize()
|
MainWindow::restoreWindowSize()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue