summary refs log tree commit diff
path: root/resources/qml/QuickSwitcher.qml
blob: 317c96b34cde2dc8676024433b08b5428117e013 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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
    height: 100
    modal: true
    focus: true
    closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
    parent: Overlay.overlay

    TextInput {
        id: roomTextInput

        anchors.fill: parent
        focus: true

        onTextEdited: {
            completerPopup.completer.setSearchString(text)
        }
    }

    Completer {
        id: completerPopup

        x: roomTextInput.x + 100
        y: roomTextInput.y - 20
        completerName: "room"
        bottomToTop: true
    }

    onOpened: {
        completerPopup.open()
    }
}