1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
//
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2014 Abhinav Gangwar <abhgang@gmail.com>
//
import QtQuick 2.0
import QtQuick.Controls 1.4
Rectangle {
property bool showInitialMenu: true
property bool showGameOptions: false
property int leftPanelWidth: 200
property int leftPanelHeight: 600
signal browseMapButtonClicked()
id: leftPanel
objectName: "leftPanel"
width: leftPanelWidth
height: leftPanelHeight
StackView {
id: stackContainer
anchors.fill: parent
initialItem: buttonArea
}
InitialMenu {
id: buttonArea
objectName: "buttonArea"
onGameMenuButtonClicked: {
stackContainer.push(gameOptions);
}
onBrowseButtonClicked: {
browseMapButtonClicked();
stackContainer.pop(gameOptions);
}
}
// This element contains the game menu
GameOptions {
id: gameOptions
objectName: "gameOptions"
onBackButtonClick: {
stackContainer.pop(buttonArea);
}
}
Component.onCompleted: {
stackContainer.push(buttonArea);
}
transitions: [
Transition {
to: "*"
NumberAnimation { target: buttonArea; properties: "height, width"; duration: 150 }
NumberAnimation { target: gameOptions; properties: "height, width"; duration: 150 }
}
]
function resizeWindow(windowHeight) {
leftPanelHeight = windowHeight;
}
}
|