diff options
author | Yoann Lopes <yoann.lopes@nokia.com> | 2010-07-16 16:39:01 +0200 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@nokia.com> | 2010-07-16 16:39:01 +0200 |
commit | 7a1c75ceca2aa221693f3b75f7e201a16377a4e8 (patch) | |
tree | 076ffea665070bfd6daf0de22c53f5e4972b8bcb | |
parent | 4620eea8f0ff6a38f982b4cb6e55ff46e74f9495 (diff) |
Added toggle fullscreen button.
-rw-r--r-- | ogrewidget.cpp | 1 | ||||
-rw-r--r-- | resources/example.qml | 57 |
2 files changed, 53 insertions, 5 deletions
diff --git a/ogrewidget.cpp b/ogrewidget.cpp index c62dd40..2c43a26 100644 --- a/ogrewidget.cpp +++ b/ogrewidget.cpp @@ -113,6 +113,7 @@ void OgreWidget::initializeGL() m_QmlUI->setResizeMode(QDeclarativeView::SizeRootObjectToView); m_QmlUI->setSource(QUrl("resources/example.qml")); m_QmlUI->rootContext()->setContextProperty("Camera", m_cameraObject); + m_QmlUI->rootContext()->setContextProperty("Window", this); } void OgreWidget::resizeGL(int w, int h) diff --git a/resources/example.qml b/resources/example.qml index aaea028..fb10cda 100644 --- a/resources/example.qml +++ b/resources/example.qml @@ -28,19 +28,16 @@ Item { radius: 15 gradient: Gradient { GradientStop { - id: gradientstop3 position: 0 color: "#6f6f6f" } GradientStop { - id: gradientstop4 position: 0.27 color: "#141414" } GradientStop { - id: gradientstop5 position: 1 color: "#50000000" } @@ -254,13 +251,11 @@ Item { radius: 5 gradient: Gradient { GradientStop { - id: gradientstop1 position: 0 color: "#c83e3e3e" } GradientStop { - id: gradientstop2 position: 1 color: "#c8919191" } @@ -309,6 +304,58 @@ Item { border.width: 2 z: -1 } + + Rectangle { + id: rectangle12 + x: 132 + width: 25 + height: 25 + radius: 5 + gradient: Gradient { + GradientStop { + position: 0 + color: "#c83e3e3e" + } + + GradientStop { + position: 1 + color: "#c8919191" + } + } + anchors.top: rectangle2.top + anchors.right: rectangle1.right + anchors.rightMargin: 5 + border.color: "#1a1a1a" + + MouseArea { + anchors.fill: parent + onClicked: Window.fullScreen ? Window.showNormal() : Window.showFullScreen() + } + + Rectangle { + id: rectangle13 + color: "#28ffffff" + radius: 2 + border.width: 2 + border.color: "#000000" + anchors.rightMargin: 7 + anchors.leftMargin: 7 + anchors.topMargin: 7 + anchors.bottomMargin: 7 + anchors.fill: parent + + Rectangle { + id: rectangle14 + height: 3 + color: "#000000" + anchors.right: parent.right + anchors.left: parent.left + anchors.top: parent.top + } + } + border.width: 2 + z: -1 + } states: [ State { name: "State1" |