Added primary toolbar to qt quick prototype
This commit is contained in:
parent
9f438a3f84
commit
f7d84afb79
11 changed files with 99 additions and 4 deletions
|
@ -39,6 +39,8 @@ void OpenGLView::paint()
|
|||
initialized = true;
|
||||
}
|
||||
|
||||
renderer.resize(window()->width(), window()->height());
|
||||
renderer.resize(width(), height());
|
||||
renderer.paint();
|
||||
|
||||
window()->resetOpenGLState();
|
||||
}
|
||||
|
|
10
src/interface/quick/images.qrc
Normal file
10
src/interface/quick/images.qrc
Normal 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>
|
10
src/interface/quick/images/images.qrc
Normal file
10
src/interface/quick/images/images.qrc
Normal 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>
|
BIN
src/interface/quick/images/tab_atmosphere.png
Normal file
BIN
src/interface/quick/images/tab_atmosphere.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
BIN
src/interface/quick/images/tab_clouds.png
Normal file
BIN
src/interface/quick/images/tab_clouds.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
BIN
src/interface/quick/images/tab_render.png
Normal file
BIN
src/interface/quick/images/tab_render.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
BIN
src/interface/quick/images/tab_terrain.png
Normal file
BIN
src/interface/quick/images/tab_terrain.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
src/interface/quick/images/tab_textures.png
Normal file
BIN
src/interface/quick/images/tab_textures.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
BIN
src/interface/quick/images/tab_water.png
Normal file
BIN
src/interface/quick/images/tab_water.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
|
@ -1,11 +1,83 @@
|
|||
import QtQuick 2.2
|
||||
import Paysages 1.0
|
||||
|
||||
Item {
|
||||
OpenGLView {
|
||||
|
||||
width: 640
|
||||
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 }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,7 +7,8 @@ include(../../common.pri)
|
|||
SOURCES += main.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
|
||||
QML_IMPORT_PATH =
|
||||
|
|
Loading…
Reference in a new issue