Handle more cases when the drawer should be closed

1. Other item is pressed
2. Any item is long-pressed, including the selected one
3. ChatPage is getting deactivated
This commit is contained in:
Slava Monich 2021-03-27 01:17:49 +02:00
parent 4f65b3b666
commit 9a2b2b0ca8
2 changed files with 7 additions and 1 deletions

View file

@ -55,6 +55,9 @@ ListItem {
if(messageListItem.precalculatedValues.pageIsSelecting) { if(messageListItem.precalculatedValues.pageIsSelecting) {
page.toggleMessageSelection(myMessage); page.toggleMessageSelection(myMessage);
} else { } else {
if (messageOptionsDrawer.sourceItem !== messageListItem) {
messageOptionsDrawer.open = false
}
// Allow extra context to react to click // Allow extra context to react to click
var extraContent = extraContentLoader.item var extraContent = extraContentLoader.item
if (extraContent && extraContentLoader.contains(mapToItem(extraContentLoader, mouse.x, mouse.y))) { if (extraContent && extraContentLoader.contains(mapToItem(extraContentLoader, mouse.x, mouse.y))) {
@ -70,6 +73,7 @@ ListItem {
page.selectedMessages = []; page.selectedMessages = [];
page.state = "" page.state = ""
} else { } else {
messageOptionsDrawer.open = false
contextMenuLoader.active = true; contextMenuLoader.active = true;
} }
} }

View file

@ -449,7 +449,9 @@ Page {
} }
} }
} }
break;
case PageStatus.Deactivating:
messageOptionsDrawer.open = false
break; break;
case PageStatus.Active: case PageStatus.Active:
if (!chatPage.isInitialized) { if (!chatPage.isInitialized) {