Commit b03a72d2 authored by eekkelund's avatar eekkelund

[Keyboard] Make Maliit to respect ApplicationWindow.allowedOrientations

parent e38bf17b
...@@ -46,6 +46,7 @@ import QtQuick.Controls.Styles.Nemo 1.0 ...@@ -46,6 +46,7 @@ import QtQuick.Controls.Styles.Nemo 1.0
Page { Page {
id: root id: root
allowedOrientations:Qt.PortraitOrientation | Qt.LandscapeOrientation
property real progress: 0 property real progress: 0
SequentialAnimation on progress { SequentialAnimation on progress {
loops: Animation.Infinite loops: Animation.Infinite
......
...@@ -51,6 +51,7 @@ ApplicationWindow { ...@@ -51,6 +51,7 @@ ApplicationWindow {
id: appWindow id: appWindow
contentOrientation: Screen.orientation contentOrientation: Screen.orientation
allowedOrientations: Qt.PortraitOrientation | Qt.LandscapeOrientation | Qt.InvertedLandscapeOrientation | Qt.InvertedPortraitOrientation
// Implements back key navigation // Implements back key navigation
Keys.onReleased: { Keys.onReleased: {
......
...@@ -41,15 +41,25 @@ ...@@ -41,15 +41,25 @@
#include <QtGui/QGuiApplication> #include <QtGui/QGuiApplication>
#include <QQmlApplicationEngine> #include <QQmlApplicationEngine>
#include <QtQuick/QQuickView> #include <QtQuick/QQuickView>
#include <QScreen>
#include <glacierapp.h> #include <glacierapp.h>
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
setenv("QT_QUICK_CONTROLS_STYLE", "Nemo", 1); setenv("QT_QUICK_CONTROLS_STYLE", "Nemo", 1);
QGuiApplication *app = GlacierApp::app(argc, argv); QGuiApplication *app = GlacierApp::app(argc, argv);
app->setOrganizationName("NemoMobile"); app->setOrganizationName("NemoMobile");
QScreen* sc = app->primaryScreen();
if(sc){
sc->setOrientationUpdateMask(Qt::LandscapeOrientation
| Qt::PortraitOrientation
| Qt::InvertedLandscapeOrientation
| Qt::InvertedPortraitOrientation);
}
QQuickWindow *window = GlacierApp::showWindow(); QQuickWindow *window = GlacierApp::showWindow();
window->setTitle(QObject::tr("Glacier components")); window->setTitle(QObject::tr("Glacier components"));
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
import QtQuick.Window 2.0 import QtQuick.Window 2.2
import QtQuick 2.6 import QtQuick 2.6
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Layouts 1.0 import QtQuick.Layouts 1.0
...@@ -47,6 +47,12 @@ NemoWindow { ...@@ -47,6 +47,12 @@ NemoWindow {
readonly property var _bgColor: Theme.backgroundColor readonly property var _bgColor: Theme.backgroundColor
color: _bgColor color: _bgColor
//Handles orientation of keyboard, MInputMethodQuick.appOrientation.
contentOrientation: orientation
onOrientationChanged: {
contentOrientation=orientation
}
//README: allowedOrientations' default value is set in NemoWindow's c++ implementation //README: allowedOrientations' default value is set in NemoWindow's c++ implementation
//The app developer can overwrite it from QML //The app developer can overwrite it from QML
......
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