diff --git a/src/conversationsadapter.cpp b/src/conversationsadapter.cpp index 3c3efbb5732625ca2dd4dd286ad9c6cd6be16ce1..78fac053165ec820272dfc29a2be8b69cd00eb63 100644 --- a/src/conversationsadapter.cpp +++ b/src/conversationsadapter.cpp @@ -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, diff --git a/src/mainview/MainView.qml b/src/mainview/MainView.qml index f2478ef98d71d44224b4ed16a933dcc29ba4de08..774614bb2b1e1f35eb65c53d304a0f22243b6614 100644 --- a/src/mainview/MainView.qml +++ b/src/mainview/MainView.qml @@ -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 } diff --git a/src/mainview/components/MessageWebView.qml b/src/mainview/components/MessageWebView.qml index 0dff595fe223914ea4b4e9e1e6522d7dfa2a8ceb..41570b70e40c4f186a1f2588b031cce425403c8e 100644 --- a/src/mainview/components/MessageWebView.qml +++ b/src/mainview/components/MessageWebView.qml @@ -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