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

smartlist: always refocus to chatview when showing a conversation

Gitlab: #116
Change-Id: Ibf2fdf3eeeb2e36c08450ef99ac42ca48913a0ed
parent 5f272b33
No related branches found
No related tags found
No related merge requests found
...@@ -442,6 +442,10 @@ Window { ...@@ -442,6 +442,10 @@ Window {
SidePanel { SidePanel {
id: mainViewWindowSidePanel id: mainViewWindowSidePanel
onFocusMessageWebViewRequested: {
communicationPageMessageWebView.focusMessageWebView()
}
// TODO: remove the evil in this slot // TODO: remove the evil in this slot
onConversationSmartListNeedToAccessMessageWebView: { onConversationSmartListNeedToAccessMessageWebView: {
communicationPageMessageWebView.headerUserAliasLabelText = currentUserAlias communicationPageMessageWebView.headerUserAliasLabelText = currentUserAlias
...@@ -475,12 +479,14 @@ Window { ...@@ -475,12 +479,14 @@ Window {
callStackView.setLinkedWebview(communicationPageMessageWebView) callStackView.setLinkedWebview(communicationPageMessageWebView)
if (mainViewStack.find(function (item, index) { if (mainViewStack.find(function (item, index) {
return item.objectName === "communicationPageMessageWebView" return item.objectName === "communicationPageMessageWebView"
}) || sidePanelViewStack.find(function (item, index) { }) || sidePanelViewStack.find(function (item, index) {
return item.objectName === "communicationPageMessageWebView" return item.objectName === "communicationPageMessageWebView"
})) { })) {
if (!callStackViewShouldShow) if (!callStackViewShouldShow) {
communicationPageMessageWebView.focusMessageWebView()
return return
}
} }
// Push messageWebView or callStackView onto the correct stackview // Push messageWebView or callStackView onto the correct stackview
...@@ -509,9 +515,8 @@ Window { ...@@ -509,9 +515,8 @@ Window {
} }
} }
if (!callStackViewShouldShow) { if (!callStackViewShouldShow)
communicationPageMessageWebView.focusMessageWebView() communicationPageMessageWebView.focusMessageWebView()
}
} }
Connections { Connections {
......
...@@ -34,6 +34,7 @@ Rectangle { ...@@ -34,6 +34,7 @@ Rectangle {
property int totalUnreadMessagesCount: 0 property int totalUnreadMessagesCount: 0
signal conversationSmartListNeedToAccessMessageWebView(string currentUserDisplayName, string currentUserAlias, string currentUID, bool callStackViewShouldShow, bool isAudioOnly, int callState) signal conversationSmartListNeedToAccessMessageWebView(string currentUserDisplayName, string currentUserAlias, string currentUID, bool callStackViewShouldShow, bool isAudioOnly, int callState)
signal focusMessageWebViewRequested
// Hack -> force redraw. // Hack -> force redraw.
function forceReselectConversationSmartListCurrentIndex() { function forceReselectConversationSmartListCurrentIndex() {
...@@ -175,6 +176,8 @@ Rectangle { ...@@ -175,6 +176,8 @@ Rectangle {
height: tabBarVisible ? sidePanelRect.height - sidePanelTabBar.height - contactSearchBar.height - 20 : height: tabBarVisible ? sidePanelRect.height - sidePanelTabBar.height - contactSearchBar.height - 20 :
sidePanelRect.height - contactSearchBar.height - 20 sidePanelRect.height - contactSearchBar.height - 20
onCurrentIndexChanged: focusMessageWebViewRequested()
Connections { Connections {
target: ConversationsAdapter target: ConversationsAdapter
......
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