2021-02-21 18:40:21 +01:00
|
|
|
import QtQuick 2.9
|
|
|
|
import QtQuick.Controls 2.3
|
|
|
|
import im.nheko 1.0
|
|
|
|
|
|
|
|
Popup {
|
|
|
|
x: parent.width / 2 - width / 2
|
|
|
|
y: parent.height / 4 - height / 2
|
|
|
|
width: parent.width / 2
|
|
|
|
modal: true
|
|
|
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
|
|
|
parent: Overlay.overlay
|
|
|
|
|
|
|
|
TextInput {
|
|
|
|
id: roomTextInput
|
|
|
|
|
|
|
|
focus: true
|
2021-02-21 19:31:50 +01:00
|
|
|
anchors.fill: parent
|
|
|
|
color: colors.text
|
2021-02-21 18:40:21 +01:00
|
|
|
|
|
|
|
onTextEdited: {
|
|
|
|
completerPopup.completer.setSearchString(text)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Completer {
|
|
|
|
id: completerPopup
|
|
|
|
|
2021-02-21 19:31:50 +01:00
|
|
|
x: roomTextInput.x
|
|
|
|
y: roomTextInput.y + parent.height
|
|
|
|
width: parent.width
|
2021-02-21 18:40:21 +01:00
|
|
|
completerName: "room"
|
|
|
|
bottomToTop: true
|
2021-02-21 19:31:50 +01:00
|
|
|
fullWidth: true
|
|
|
|
|
|
|
|
closePolicy: Popup.NoAutoClose
|
2021-02-21 18:40:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
onOpened: {
|
|
|
|
completerPopup.open()
|
2021-02-21 19:31:50 +01:00
|
|
|
roomTextInput.forceActiveFocus()
|
|
|
|
}
|
|
|
|
|
|
|
|
onClosed: {
|
|
|
|
completerPopup.close()
|
2021-02-21 18:40:21 +01:00
|
|
|
}
|
|
|
|
}
|