Uncheck messages before clearing event list

This commit is contained in:
miruka 2020-06-26 06:09:20 -04:00
parent 7f66ebb786
commit d058926902
5 changed files with 13 additions and 2 deletions

View File

@ -6,7 +6,6 @@
- device list keyboard navigation
- device IP geolocation
- field/area focus line in popups weird
- clear listview checked on message clear
- unregister popup/menu when destroyed without being closed
- menu click-through padding to close it easily
- show scrollbars for a few secs if there's content to scroll on beginning

View File

@ -96,6 +96,11 @@ ListView {
checkedIndiceChanged()
}
function uncheckAll() {
checked = {}
checkedIndice = new Set()
}
function toggleCheck(...indices) {
const checkedNow = []

View File

@ -280,7 +280,11 @@ HColumnLayout {
popup: "Popups/ClearMessagesPopup.qml"
popupParent: chat
properties: ({userId: chat.userId, roomId: chat.roomId})
properties: ({
userId: chat.userId,
roomId: chat.roomId,
preClearCallback: eventList.uncheckAll,
})
}
}
}

View File

@ -170,6 +170,7 @@ Rectangle {
{
userId: window.uiState.pageProperties.userId,
roomId: window.uiState.pageProperties.roomId,
preClearCallback: eventList.uncheckAll,
}
)
}

View File

@ -9,6 +9,7 @@ HFlickableColumnPopup {
property string userId: ""
property string roomId: ""
property var preClearCallback: null
page.footer: ButtonLayout {
@ -17,6 +18,7 @@ HFlickableColumnPopup {
text: qsTr("Clear")
icon.name: "clear-messages"
onClicked: {
if (preClearCallback) preClearCallback()
py.callClientCoro(userId, "clear_events", [roomId])
popup.close()
}