blob: f7cdf7274bf82e577db891b6afbd4a2bd8dea58c (
plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
import QtQuick 2.15
import SimpleKeyboard 1.0
import QtQuick.VirtualKeyboard 2.15
import QtQuick.Window 2.2
Window {
id: window
width: Constants.width
height: Constants.height
Item {
id: cornerItem
x: 0
y: 0
}
property int activeFocusItemBottom : activeFocusItem == null ? 0 : Math.min(height, cornerItem.mapFromItem(activeFocusItem, 0, activeFocusItem.height).y + 50)
Swiper {
id: view
width: window.width
height: window.height
y: !inputPanel.active ? 0 : Math.min(0, window.height - inputPanel.height - activeFocusItemBottom)
Behavior on y {
NumberAnimation {
duration: 250
easing.type: Easing.InOutQuad
}
}
}
Rectangle {
id: inputPanelBackground
anchors.left: parent.left
anchors.right: parent.right
anchors.top: inputPanel.top
anchors.bottom: inputPanel.bottom
color: "black"
}
InputPanel {
id: inputPanel
x: window.width/2 - width/2
y: window.height
width: Math.min(window.width, window.height)
states: State {
name: "visible"
when: inputPanel.active
PropertyChanges {
target: inputPanel
y: window.height - inputPanel.height
}
}
transitions: Transition {
from: ""
to: "visible"
reversible: true
ParallelAnimation {
NumberAnimation {
properties: "y"
duration: 250
easing.type: Easing.InOutQuad
}
}
}
}
}
|