Skip to content
Snippets Groups Projects
Commit 8a064c3a authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

chatview: acquire message input focus when selecting conversation

Change-Id: I0f4ad161f0f05959c4f5a312e92f256b56c9fd57
Gitlab: #107
parent ac3b8b82
No related branches found
No related tags found
No related merge requests found
......@@ -269,22 +269,22 @@ ConversationsAdapter::connectConversationModel(bool updateFilter)
emit updateListViewRequested();
});
filterChangedConnection_
= QObject::connect(currentConversationModel,
&lrc::api::ConversationModel::filterChanged,
[this]() {
conversationSmartListModel_->fillConversationsList();
updateConversationsFilterWidget();
emit updateListViewRequested();
});
newConversationConnection_
= QObject::connect(currentConversationModel,
&lrc::api::ConversationModel::newConversation,
[this](const QString& convUid) {
conversationSmartListModel_->fillConversationsList();
updateConversationForNewContact(convUid);
});
filterChangedConnection_ = QObject::connect(currentConversationModel,
&lrc::api::ConversationModel::filterChanged,
[this]() {
conversationSmartListModel_
->fillConversationsList();
updateConversationsFilterWidget();
emit updateListViewRequested();
});
newConversationConnection_ = QObject::connect(currentConversationModel,
&lrc::api::ConversationModel::newConversation,
[this](const QString& convUid) {
conversationSmartListModel_
->fillConversationsList();
updateConversationForNewContact(convUid);
});
conversationRemovedConnection_
= QObject::connect(currentConversationModel,
......
......@@ -442,6 +442,7 @@ Window {
SidePanel {
id: mainViewWindowSidePanel
// TODO: remove the evil in this slot
onConversationSmartListNeedToAccessMessageWebView: {
communicationPageMessageWebView.headerUserAliasLabelText = currentUserAlias
communicationPageMessageWebView.headerUserUserNameLabelText = currentUserDisplayName
......@@ -507,6 +508,10 @@ Window {
sidePanelViewStack.push(communicationPageMessageWebView)
}
}
if (!callStackViewShouldShow) {
communicationPageMessageWebView.focusMessageWebView()
}
}
Connections {
......@@ -527,6 +532,7 @@ Window {
WelcomePage {
id: welcomePage
visible: false
}
......
......@@ -39,6 +39,9 @@ Rectangle {
signal messagesCleared
signal messagesLoaded
function focusMessageWebView() {
messageWebView.forceActiveFocus()
}
function webViewRunJavaScript(arg) {
messageWebView.runJavaScript(arg)
......@@ -189,7 +192,6 @@ Rectangle {
}
WebEngineView {
id: messageWebView
anchors.top: messageWebViewHeader.bottom
......@@ -270,7 +272,6 @@ Rectangle {
}
}
// Provide WebEngineProfile.
WebEngineProfile {
id: messageWebViewProfile
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment