Commit 85681154 authored by Aleksi Suomalainen's avatar Aleksi Suomalainen Committed by eekkelund

Add in support for Qt virtual keyboard.

parent 6a9017c0
......@@ -26,8 +26,8 @@ NemoWindow::NemoWindow(QWindow *parent) :
m_defaultAllowedOrientations(Qt::PortraitOrientation | Qt::LandscapeOrientation)
{
m_allowedOrientations = m_defaultAllowedOrientations;
m_filter = new EditFilter();
this->installEventFilter(m_filter);
//m_filter = new EditFilter();
//this->installEventFilter(m_filter);
}
Qt::ScreenOrientations NemoWindow::allowedOrientations() const
......
......@@ -26,7 +26,7 @@ import QtQuick.Layouts 1.0
import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
import QtQuick.VirtualKeyboard 2.1
NemoWindow {
id: root
......@@ -206,6 +206,14 @@ NemoWindow {
Item {
id: contentArea
anchors.centerIn: parent
InputPanel {
z:99
id: inputPanel
visible: Qt.inputMethod.visible
y: Qt.inputMethod.visible ? parent.height - inputPanel.height : parent.height
anchors.left: parent.left
anchors.right: parent.right
}
transform: Scale {
id: contentScale
......@@ -240,20 +248,6 @@ NemoWindow {
: Qt.inputMethod.keyboardRectangle.height)
: (root._transpose ? Qt.inputMethod.keyboardRectangle.height
: Qt.inputMethod.keyboardRectangle.width))
onImSizeChanged: {
if (imSize <= 0 && previousImSize > 0) {
imShowAnimation.stop()
imHideAnimation.start()
} else if (imSize > 0 && previousImSize <= 0) {
imHideAnimation.stop()
imShowAnimation.to = imSize
imShowAnimation.start()
} else {
panelSize = imSize
}
previousImSize = imSize
}
clip: true
Component.onCompleted: {
......
......@@ -35,9 +35,5 @@ import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
TextField {
onActiveFocusChanged: {
if(activeFocus) NemoFocus.nemoregister(this)
else NemoFocus.nemoregister(null)
}
style: TextFieldStyle { }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment