Commit 2bcbdf3b authored by Andrew Flegg's avatar Andrew Flegg

Add moire effect and lock to landscape on all platforms

parent 02b2448a
...@@ -28,18 +28,17 @@ int main(int argc, char *argv[]) ...@@ -28,18 +28,17 @@ int main(int argc, char *argv[])
* ActiveMonitor object that has an "active" property to the QML * ActiveMonitor object that has an "active" property to the QML
* context. Inside QML, use "activeMonitor.active" as boolean. * context. Inside QML, use "activeMonitor.active" as boolean.
**/ **/
// TODO With Qt Quick Components, we can http://library.developer.nokia.com/topic/MeeGo_1.2_Harmattan_API/html/guide/html/Developer_Library_Application_development_framework_Application_lifecycle_a92f.html
ActiveMonitor *monitor = new ActiveMonitor(&viewer); ActiveMonitor *monitor = new ActiveMonitor(&viewer);
QObject::connect(&viewer, SIGNAL(activeChanged(bool)), QObject::connect(&viewer, SIGNAL(activeChanged(bool)),
monitor, SLOT(activeChanged(bool))); monitor, SLOT(activeChanged(bool)));
viewer.rootContext()->setContextProperty("activeMonitor", monitor); viewer.rootContext()->setContextProperty("activeMonitor", monitor);
viewer.engine()->rootContext()->setContextProperty("portraitDevice", portrait); viewer.engine()->rootContext()->setContextProperty("portraitDevice", false); //portrait);
viewer.setMainQmlFile("qml/attitude/qtc-root.qml"); viewer.setMainQmlFile("qml/attitude/qtc-root.qml");
if (viewer.status() != QDeclarativeView::Ready || viewer.errors().length() != 0) if (viewer.status() != QDeclarativeView::Ready || viewer.errors().length() != 0)
viewer.setMainQmlFile("qml/attitude/Main.qml"); viewer.setMainQmlFile("qml/attitude/Main.qml");
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape); // viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockLandscape);
if (fullscreen) { if (fullscreen) {
viewer.showFullScreen(); viewer.showFullScreen();
......
File added
...@@ -82,14 +82,14 @@ Item { ...@@ -82,14 +82,14 @@ Item {
x: (world.width / 2) - parent.barWidth x: (world.width / 2) - parent.barWidth
y: (world.height / 2) - (parent.barHeight / 2) y: (world.height / 2) - (parent.barHeight / 2)
width: parent.barWidth width: parent.barWidth
height: 1 height: 2
color: "#ffffff" color: "#ffffff"
} }
Rectangle { Rectangle {
id: heightBarMain id: heightBarMain
x: world.width / 2 x: world.width / 2
y: heightBarTop.y y: heightBarTop.y
width: 1 width: 2
height: parent.barHeight height: parent.barHeight
color: "#ffffff" color: "#ffffff"
} }
...@@ -98,7 +98,7 @@ Item { ...@@ -98,7 +98,7 @@ Item {
x: heightBarMain.x x: heightBarMain.x
y: heightBarMain.y + parent.barHeight y: heightBarMain.y + parent.barHeight
width: parent.barWidth width: parent.barWidth
height: 1 height: 2
color: "#ffffff" color: "#ffffff"
} }
Repeater { Repeater {
...@@ -112,13 +112,17 @@ Item { ...@@ -112,13 +112,17 @@ Item {
x: heightBarMain.x - parent.barWidth / _divisor x: heightBarMain.x - parent.barWidth / _divisor
y: heightBarMain.y + parent.barHeight * (index + 1)/10 y: heightBarMain.y + parent.barHeight * (index + 1)/10
width: parent.barWidth / (_divisor / 2) width: parent.barWidth / (_divisor / 2)
height: 1 height: 2
color: "#ffffff" color: "#ffffff"
} }
} }
} }
} }
Image {
source: "moire.png"
}
/** /**
* The angle meter in the top-right. * The angle meter in the top-right.
......
import QtQuick 1.0 import QtQuick 1.0
import com.meego 1.0 import com.meego 1.0
PageStackWindow { //PageStackWindow {
Main {
id: window id: window
anchors.fill: parent anchors.fill: parent
showStatusBar: true /* showStatusBar: true
showToolBar: false # showToolBar: false
initialPage: Page { # initialPage: Page {
orientationLock: PageOrientation.LockLandscape # orientationLock: PageOrientation.LockLandscape
Main {} Main {}
} }
*/
Component.onCompleted: { Component.onCompleted: {
activeMonitor.external = true if (platformWindow)
activeMonitor.external = true
console.log("Set activeMonitor external modification = " + activeMonitor.external) console.log("Set activeMonitor external modification = " + activeMonitor.external)
} }
......
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