Merge pull request #390 from monich/drawer

Don't have on-screen keyboard and drawer visible simultaneously
This commit is contained in:
Sebastian Wolf 2021-02-21 23:35:13 +01:00 committed by GitHub
commit 3957ec27e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 12 deletions

View file

@ -80,9 +80,11 @@ ListItem {
} }
Connections { Connections {
target: messageOptionsDrawer target: additionalOptionsOpened ? messageOptionsDrawer : null
onCloseRequested: { onOpenChanged: {
messageListItem.additionalOptionsOpened = false; if (!messageOptionsDrawer.open) {
additionalOptionsOpened = false
}
} }
} }

View file

@ -750,16 +750,10 @@ Page {
jointModel.push(messageOptionsModel[i]); jointModel.push(messageOptionsModel[i]);
} }
drawerListView.model = jointModel; drawerListView.model = jointModel;
focus = true // Take the focus away from the text field
} }
} }
signal closeRequested();
function closeDrawer() {
messageOptionsDrawer.closeRequested();
messageOptionsDrawer.open = false;
}
anchors.fill: parent anchors.fill: parent
dock: chatPage.isPortrait ? Dock.Bottom : Dock.Right dock: chatPage.isPortrait ? Dock.Bottom : Dock.Right
backgroundSize: chatPage.isPortrait ? height / 3 : width / 2 backgroundSize: chatPage.isPortrait ? height / 3 : width / 2
@ -793,7 +787,7 @@ Page {
icon.source: "image://theme/icon-m-clear" icon.source: "image://theme/icon-m-clear"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onClicked: { onClicked: {
messageOptionsDrawer.closeDrawer(); messageOptionsDrawer.open = false
} }
} }
} }
@ -808,7 +802,7 @@ Page {
} }
onClicked: { onClicked: {
modelData.action(); modelData.action();
messageOptionsDrawer.closeDrawer(); messageOptionsDrawer.open = false
} }
hidden: !modelData.visible hidden: !modelData.visible
} }
@ -1919,6 +1913,11 @@ Page {
controlSendButton(); controlSendButton();
textReplacementTimer.restart(); textReplacementTimer.restart();
} }
onActiveFocusChanged: {
if (activeFocus) {
messageOptionsDrawer.open = false
}
}
} }
IconButton { IconButton {