Warning, /education/gcompris/external/qml-box2d/examples/ui.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick 2.1;
0002 import QtQuick.Window 2.1;
0003 import Box2D 2.0;
0004 //import "shared"
0005 
0006 Window {
0007     id: window;
0008     width: 1000;
0009     height: 600;
0010     visible: true;
0011 
0012     property bool listVisible: true;
0013 
0014     ListModel {
0015         id: scenesList;
0016         ListElement {
0017             name: "accelerometer"
0018             path: "accelerometer/accelerometer.qml"
0019         }
0020         ListElement {
0021             name: "boxes"
0022             path: "boxes/boxes.qml"
0023         }
0024         ListElement {
0025             name: "cannon"
0026             path: "cannon/main.qml"
0027         }
0028         ListElement {
0029             name: "contacts"
0030             path: "contacts/main.qml"
0031         }
0032         ListElement {
0033             name: "demolition"
0034             path: "demolition/demolition.qml"
0035         }
0036         ListElement {
0037             name: "distance"
0038             path: "distance/distance.qml"
0039         }
0040         ListElement {
0041             name: "filtering"
0042             path: "filtering/filtering.qml"
0043         }
0044         ListElement {
0045             name: "fixtures"
0046             path: "fixtures/main.qml"
0047         }
0048         ListElement {
0049             name: "friction"
0050             path: "friction/main.qml"
0051         }
0052         ListElement {
0053             name: "gear"
0054             path: "gear/main.qml"
0055         }
0056         ListElement {
0057             name: "impulse"
0058             path: "impulse/impulse.qml"
0059         }
0060         ListElement {
0061             name: "monera"
0062             path: "monera/monera.qml"
0063         }
0064         ListElement {
0065             name: "motorjoint"
0066             path: "motorjoint/boat.qml"
0067         }
0068         ListElement {
0069             name: "mouse"
0070             path: "mouse/main.qml"
0071         }
0072         ListElement {
0073             name: "movingBox"
0074             path: "movingBox/movingBox.qml"
0075         }
0076         ListElement {
0077             name: "polygons"
0078             path: "polygons/polygons.qml"
0079         }
0080         ListElement {
0081             name: "prismatic"
0082             path: "prismatic/prismatic.qml"
0083         }
0084         ListElement {
0085             name: "pulley"
0086             path: "pulley/main.qml"
0087         }
0088         ListElement {
0089             name: "raycast"
0090             path: "raycast/main.qml"
0091         }
0092         ListElement {
0093             name: "revolute"
0094             path: "revolute/revolute.qml"
0095         }
0096         ListElement {
0097             name: "rope"
0098             path: "rope/main.qml"
0099         }
0100         ListElement {
0101             name: "weld"
0102             path: "weld/main.qml"
0103         }
0104         ListElement {
0105             name: "wheel"
0106             path: "wheel/main.qml"
0107         }
0108     }
0109 
0110     Loader {
0111         id: loader;
0112         anchors {
0113             left: parent.left;
0114             right: parent.right;
0115             top: parent.top;
0116             bottom: parent.bottom;
0117             topMargin: backButton.height;
0118         }
0119     }
0120 
0121     Rectangle {
0122         id: backButton;
0123         anchors.top: parent.top;
0124         anchors.left: parent.left;
0125         width: 300;
0126         height: 40;
0127         color: "grey";
0128         border.width: 1;
0129         border.color: "black";
0130         visible: !listVisible;
0131 
0132         Text {
0133             anchors.centerIn: parent;
0134             text: "Back";
0135         }
0136 
0137         MouseArea {
0138             anchors.fill: parent;
0139             onClicked: {
0140                 listVisible = true;
0141             }
0142         }
0143     }
0144 
0145     ListView {
0146         id: listView
0147         anchors.left: parent.left;
0148         anchors.top: parent.top;
0149         anchors.bottom: parent.bottom;
0150         anchors.leftMargin: listVisible ? 0 : -width;
0151         width: 200;
0152         model: scenesList;
0153         delegate: Rectangle {
0154             height: 50;
0155             width: 200;
0156             color: "lightgrey"
0157 
0158             Text {
0159                 anchors.centerIn: parent;
0160                 text: name;
0161             }
0162 
0163             MouseArea {
0164                 anchors.fill: parent;
0165                 onClicked: {
0166                     loader.source = path
0167                     listVisible = false;
0168                 }
0169             }
0170         }
0171 
0172 
0173     }
0174 }
0175