summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamian Jansen <damian.jansen@nokia.com>2011-05-09 12:28:18 +1000
committerDamian Jansen <damian.jansen@nokia.com>2011-05-09 12:28:18 +1000
commitc610798aecc76f374c54ed7e7c41119600b858b9 (patch)
tree4b6c704b564dc298b1b981b90cb1227642c18b1f
parent9dffdfe646f4e30d481e9f146810ae0838fb3936 (diff)
Force applications to be used only in landscape
-rw-r--r--Qt/examples/declarative/textedit/textedit.qml16
-rw-r--r--Qt/examples/declarative/textinput/textinput.qml15
2 files changed, 31 insertions, 0 deletions
diff --git a/Qt/examples/declarative/textedit/textedit.qml b/Qt/examples/declarative/textedit/textedit.qml
index 771250d..91d1ee2 100644
--- a/Qt/examples/declarative/textedit/textedit.qml
+++ b/Qt/examples/declarative/textedit/textedit.qml
@@ -42,6 +42,7 @@
import QtQuick 1.1
Rectangle {
+
height: 360; width: 640; color: "gray"
Rectangle { id: textedit1box; width: 200; height: 30; color: "green"
@@ -229,4 +230,19 @@ Rectangle {
}
}
}
+
+ Item {
+ height: runtime.orientation != 2 ? parent.height : 0
+ Behavior on height { NumberAnimation { duration: 200 } }
+ width: runtime.orientation != 2 ? parent.width : 0
+ Behavior on width { NumberAnimation { duration: 200 } }
+ anchors.centerIn: parent
+ Rectangle {
+ height: parent.height - 15; width: parent.width - 15; color: "green"; radius: 10; anchors.centerIn: parent; border.color: "blue"
+ Text { visible: runtime.orientation != 2; width: parent.width - 30; anchors.centerIn: parent; horizontalAlignment: Text.AlignHCenter
+ text: "Please change to landscape orientation\nvia the Settings menu, or\nrotating the device"
+ }
+ }
+ MouseArea { anchors.fill: parent }
+ }
} \ No newline at end of file
diff --git a/Qt/examples/declarative/textinput/textinput.qml b/Qt/examples/declarative/textinput/textinput.qml
index 999f1af..916dedb 100644
--- a/Qt/examples/declarative/textinput/textinput.qml
+++ b/Qt/examples/declarative/textinput/textinput.qml
@@ -266,4 +266,19 @@ Rectangle {
}
}
}
+
+ Item {
+ height: runtime.orientation != 2 ? parent.height : 0
+ Behavior on height { NumberAnimation { duration: 200 } }
+ width: runtime.orientation != 2 ? parent.width : 0
+ Behavior on width { NumberAnimation { duration: 200 } }
+ anchors.centerIn: parent
+ Rectangle {
+ height: parent.height - 15; width: parent.width - 15; color: "green"; radius: 10; anchors.centerIn: parent; border.color: "blue"
+ Text { visible: runtime.orientation != 2; width: parent.width - 30; anchors.centerIn: parent; horizontalAlignment: Text.AlignHCenter
+ text: "Please change to landscape orientation\nvia the Settings menu"
+ }
+ }
+ MouseArea { anchors.fill: parent }
+ }
} \ No newline at end of file