Don't have on-screen keyboard and drawer visible simultaneously

Also, removed unnecessary closeRequested() signal.
This commit is contained in:
Slava Monich 2021-02-21 01:26:39 +02:00
parent 15f33145a7
commit 4050f41ce2
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 {