fix forwarding message #LINQT-1877
This commit is contained in:
parent
93418cb7c9
commit
90ad29c78e
3 changed files with 16 additions and 7 deletions
|
|
@ -19,7 +19,7 @@ ListView {
|
||||||
|
|
||||||
property ChatGui currentChatGui
|
property ChatGui currentChatGui
|
||||||
onCurrentIndexChanged: currentChatGui = model.getAt(currentIndex) || null
|
onCurrentIndexChanged: currentChatGui = model.getAt(currentIndex) || null
|
||||||
onCurrentChatGuiChanged: chatClicked(currentChatGui)
|
onChatClicked: (chat) => {currentChatGui = chat}
|
||||||
|
|
||||||
signal resultsReceived()
|
signal resultsReceived()
|
||||||
signal markAllAsRead()
|
signal markAllAsRead()
|
||||||
|
|
|
||||||
|
|
@ -679,7 +679,6 @@ FocusScope {
|
||||||
checkable: true
|
checkable: true
|
||||||
checked: true
|
checked: true
|
||||||
icon.source: checked ? AppIcons.upArrow : AppIcons.downArrow
|
icon.source: checked ? AppIcons.upArrow : AppIcons.downArrow
|
||||||
KeyNavigation.down: contentControl
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ChatListView {
|
ChatListView {
|
||||||
|
|
@ -694,7 +693,6 @@ FocusScope {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AllContactListView {
|
AllContactListView {
|
||||||
visible: expandContactButton.checked
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
itemsRightMargin: 0
|
itemsRightMargin: 0
|
||||||
showActions: false
|
showActions: false
|
||||||
|
|
@ -703,7 +701,7 @@ FocusScope {
|
||||||
searchBarText: forwardSearchBar.text
|
searchBarText: forwardSearchBar.text
|
||||||
Layout.preferredHeight: contentHeight
|
Layout.preferredHeight: contentHeight
|
||||||
onContactSelected: contact => selectedFriend = contact
|
onContactSelected: contact => selectedFriend = contact
|
||||||
property FriendGui selectedFriend
|
property FriendGui selectedFriend: null
|
||||||
property var chatForSelectedAddressObj: selectedFriend ? UtilsCpp.getChatForAddress(selectedFriend.core.defaultAddress) : null
|
property var chatForSelectedAddressObj: selectedFriend ? UtilsCpp.getChatForAddress(selectedFriend.core.defaultAddress) : null
|
||||||
property ChatGui chatForAddress: chatForSelectedAddressObj ? chatForSelectedAddressObj.value : null
|
property ChatGui chatForAddress: chatForSelectedAddressObj ? chatForSelectedAddressObj.value : null
|
||||||
onChatForAddressChanged: if(chatForAddress) {
|
onChatForAddressChanged: if(chatForAddress) {
|
||||||
|
|
|
||||||
|
|
@ -187,8 +187,8 @@ AbstractMainPage {
|
||||||
searchBar: searchBar
|
searchBar: searchBar
|
||||||
Control.ScrollBar.vertical: scrollbar
|
Control.ScrollBar.vertical: scrollbar
|
||||||
|
|
||||||
onChatClicked: (chat) => {
|
onCurrentChatGuiChanged: {
|
||||||
mainItem.selectedChatGui = chat
|
mainItem.selectedChatGui = currentChatGui
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
|
|
@ -331,10 +331,21 @@ AbstractMainPage {
|
||||||
id: currentChatComp
|
id: currentChatComp
|
||||||
FocusScope {
|
FocusScope {
|
||||||
SelectedChatView {
|
SelectedChatView {
|
||||||
|
id: selectedChatView
|
||||||
visible: chat != undefined && chat != null
|
visible: chat != undefined && chat != null
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onChatChanged: if (mainItem.selectedChatGui !== chat) mainItem.selectedChatGui = chat
|
|
||||||
chat: mainItem.selectedChatGui ? mainItem.selectedChatGui : null
|
chat: mainItem.selectedChatGui ? mainItem.selectedChatGui : null
|
||||||
|
onChatChanged: {
|
||||||
|
if (mainItem.selectedChatGui !== chat) mainItem.selectedChatGui = chat
|
||||||
|
}
|
||||||
|
// Binding is destroyed when forward message is done so
|
||||||
|
// we need this connection in addition
|
||||||
|
Connections {
|
||||||
|
target: mainItem
|
||||||
|
function onSelectedChatGuiChanged() {
|
||||||
|
selectedChatView.chat = mainItem.selectedChatGui
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue