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 {
target: messageOptionsDrawer
onCloseRequested: {
messageListItem.additionalOptionsOpened = false;
target: additionalOptionsOpened ? messageOptionsDrawer : null
onOpenChanged: {
if (!messageOptionsDrawer.open) {
additionalOptionsOpened = false
}
}
}

View file

@ -750,16 +750,10 @@ Page {
jointModel.push(messageOptionsModel[i]);
}
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
dock: chatPage.isPortrait ? Dock.Bottom : Dock.Right
backgroundSize: chatPage.isPortrait ? height / 3 : width / 2
@ -793,7 +787,7 @@ Page {
icon.source: "image://theme/icon-m-clear"
anchors.verticalCenter: parent.verticalCenter
onClicked: {
messageOptionsDrawer.closeDrawer();
messageOptionsDrawer.open = false
}
}
}
@ -808,7 +802,7 @@ Page {
}
onClicked: {
modelData.action();
messageOptionsDrawer.closeDrawer();
messageOptionsDrawer.open = false
}
hidden: !modelData.visible
}
@ -1919,6 +1913,11 @@ Page {
controlSendButton();
textReplacementTimer.restart();
}
onActiveFocusChanged: {
if (activeFocus) {
messageOptionsDrawer.open = false
}
}
}
IconButton {