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) : ...@@ -26,8 +26,8 @@ NemoWindow::NemoWindow(QWindow *parent) :
m_defaultAllowedOrientations(Qt::PortraitOrientation | Qt::LandscapeOrientation) m_defaultAllowedOrientations(Qt::PortraitOrientation | Qt::LandscapeOrientation)
{ {
m_allowedOrientations = m_defaultAllowedOrientations; m_allowedOrientations = m_defaultAllowedOrientations;
m_filter = new EditFilter(); //m_filter = new EditFilter();
this->installEventFilter(m_filter); //this->installEventFilter(m_filter);
} }
Qt::ScreenOrientations NemoWindow::allowedOrientations() const Qt::ScreenOrientations NemoWindow::allowedOrientations() const
......
...@@ -26,7 +26,7 @@ import QtQuick.Layouts 1.0 ...@@ -26,7 +26,7 @@ import QtQuick.Layouts 1.0
import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Nemo 1.0 import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0 import QtQuick.Controls.Styles.Nemo 1.0
import QtQuick.VirtualKeyboard 2.1
NemoWindow { NemoWindow {
id: root id: root
...@@ -206,6 +206,14 @@ NemoWindow { ...@@ -206,6 +206,14 @@ NemoWindow {
Item { Item {
id: contentArea id: contentArea
anchors.centerIn: parent 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 { transform: Scale {
id: contentScale id: contentScale
...@@ -240,20 +248,6 @@ NemoWindow { ...@@ -240,20 +248,6 @@ NemoWindow {
: Qt.inputMethod.keyboardRectangle.height) : Qt.inputMethod.keyboardRectangle.height)
: (root._transpose ? Qt.inputMethod.keyboardRectangle.height : (root._transpose ? Qt.inputMethod.keyboardRectangle.height
: Qt.inputMethod.keyboardRectangle.width)) : 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 clip: true
Component.onCompleted: { Component.onCompleted: {
......
...@@ -35,9 +35,5 @@ import QtQuick.Controls.Nemo 1.0 ...@@ -35,9 +35,5 @@ import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0 import QtQuick.Controls.Styles.Nemo 1.0
TextField { TextField {
onActiveFocusChanged: {
if(activeFocus) NemoFocus.nemoregister(this)
else NemoFocus.nemoregister(null)
}
style: TextFieldStyle { } 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