Added primary toolbar to qt quick prototype

This commit is contained in:
Michaël Lemaire 2014-08-19 17:01:42 +02:00
parent 9f438a3f84
commit f7d84afb79
11 changed files with 99 additions and 4 deletions

View file

@ -39,6 +39,8 @@ void OpenGLView::paint()
initialized = true; initialized = true;
} }
renderer.resize(window()->width(), window()->height()); renderer.resize(width(), height());
renderer.paint(); renderer.paint();
window()->resetOpenGLState();
} }

View file

@ -0,0 +1,10 @@
<RCC>
<qresource prefix="/toolbar/primary">
<file>images/tab_atmosphere.png</file>
<file>images/tab_terrain.png</file>
<file>images/tab_textures.png</file>
<file>images/tab_water.png</file>
<file>images/tab_clouds.png</file>
<file>images/tab_render.png</file>
</qresource>
</RCC>

View file

@ -0,0 +1,10 @@
<RCC>
<qresource prefix="/toolbar/primary">
<file>tab_water.png</file>
<file>tab_atmosphere.png</file>
<file>tab_clouds.png</file>
<file>tab_render.png</file>
<file>tab_terrain.png</file>
<file>tab_textures.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -1,11 +1,83 @@
import QtQuick 2.2 import QtQuick 2.2
import Paysages 1.0 import Paysages 1.0
Item { OpenGLView {
width: 640 width: 640
height: 480 height: 480
OpenGLView { Item {
id: primary_toolbar
x: 0
y: 0
width: 70
height: parent.height
Rectangle {
width: parent.height
height: parent.width
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
transformOrigin: Item.Center
rotation: -90
gradient: Gradient {
GradientStop { position: 0.0; color: "#605055FF" }
GradientStop { position: 1.0; color: "#005055FF" }
} }
}
Column {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
spacing: (parent.height - 6 * tool_terrain.height) / 7
Image {
id: tool_terrain
opacity: 0.5
source: "qrc:///toolbar/primary/tab_terrain.png"
}
Image {
id: tool_textures
opacity: 0.5
source: "qrc:///toolbar/primary/tab_textures.png"
}
Image {
id: tool_water
opacity: 0.5
source: "qrc:///toolbar/primary/tab_water.png"
}
Image {
id: tool_atmosphere
opacity: 0.5
source: "qrc:///toolbar/primary/tab_atmosphere.png"
}
Image {
id: tool_clouds
opacity: 0.5
source: "qrc:///toolbar/primary/tab_clouds.png"
}
Image {
id: tool_render
opacity: 0.5
source: "qrc:///toolbar/primary/tab_render.png"
}
}
}
Rectangle {
id: toolbar_render
anchors.top: primary_toolbar.top
anchors.left: primary_toolbar.right
width: primary_toolbar.width
height: primary_toolbar.height
color: "green"
SequentialAnimation on width {
loops: Animation.Infinite
PropertyAnimation { to: 0; duration: 1000 }
PropertyAnimation { to: primary_toolbar.width; duration: 1000 }
}
}
} }

View file

@ -7,7 +7,8 @@ include(../../common.pri)
SOURCES += main.cpp \ SOURCES += main.cpp \
OpenGLView.cpp OpenGLView.cpp
RESOURCES += qml.qrc RESOURCES += qml.qrc \
images/images.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model # Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH = QML_IMPORT_PATH =