mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-23 03:18:49 +03:00
Focus on the text input when switching rooms
This commit is contained in:
parent
9c28ba28a8
commit
69036967ff
2 changed files with 7 additions and 0 deletions
|
@ -46,6 +46,7 @@ public:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void onSendButtonClicked();
|
void onSendButtonClicked();
|
||||||
|
inline void focusLineEdit();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void addSelectedEmoji(const QString &emoji);
|
void addSelectedEmoji(const QString &emoji);
|
||||||
|
@ -64,3 +65,8 @@ private:
|
||||||
FlatButton *send_message_button_;
|
FlatButton *send_message_button_;
|
||||||
EmojiPickButton *emoji_button_;
|
EmojiPickButton *emoji_button_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline void TextInputWidget::focusLineEdit()
|
||||||
|
{
|
||||||
|
input_->setFocus();
|
||||||
|
}
|
||||||
|
|
|
@ -125,6 +125,7 @@ ChatPage::ChatPage(QSharedPointer<MatrixClient> client, QWidget *parent)
|
||||||
connect(client_.data(), SIGNAL(loggedOut()), this, SLOT(logout()));
|
connect(client_.data(), SIGNAL(loggedOut()), this, SLOT(logout()));
|
||||||
|
|
||||||
connect(room_list_, &RoomList::roomChanged, this, &ChatPage::changeTopRoomInfo);
|
connect(room_list_, &RoomList::roomChanged, this, &ChatPage::changeTopRoomInfo);
|
||||||
|
connect(room_list_, &RoomList::roomChanged, text_input_, &TextInputWidget::focusLineEdit);
|
||||||
connect(room_list_, &RoomList::roomChanged, view_manager_, &TimelineViewManager::setHistoryView);
|
connect(room_list_, &RoomList::roomChanged, view_manager_, &TimelineViewManager::setHistoryView);
|
||||||
|
|
||||||
connect(view_manager_, &TimelineViewManager::unreadMessages, this, [=](const QString &roomid, int count) {
|
connect(view_manager_, &TimelineViewManager::unreadMessages, this, [=](const QString &roomid, int count) {
|
||||||
|
|
Loading…
Reference in a new issue