Warning, /education/marble/examples/cpp/marble-game/Window.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2014 Abhinav Gangwar <abhgang@gmail.com> 0004 // 0005 0006 0007 import QtQuick 2.0 0008 import QtQuick.Controls 1.4 0009 0010 Rectangle { 0011 property bool showInitialMenu: true 0012 property bool showGameOptions: false 0013 0014 property int leftPanelWidth: 200 0015 property int leftPanelHeight: 600 0016 signal browseMapButtonClicked() 0017 0018 id: leftPanel 0019 objectName: "leftPanel" 0020 width: leftPanelWidth 0021 height: leftPanelHeight 0022 0023 StackView { 0024 id: stackContainer 0025 anchors.fill: parent 0026 initialItem: buttonArea 0027 } 0028 0029 InitialMenu { 0030 id: buttonArea 0031 objectName: "buttonArea" 0032 0033 onGameMenuButtonClicked: { 0034 stackContainer.push(gameOptions); 0035 } 0036 onBrowseButtonClicked: { 0037 browseMapButtonClicked(); 0038 stackContainer.pop(gameOptions); 0039 } 0040 } 0041 0042 // This element contains the game menu 0043 GameOptions { 0044 id: gameOptions 0045 objectName: "gameOptions" 0046 0047 onBackButtonClick: { 0048 stackContainer.pop(buttonArea); 0049 } 0050 } 0051 0052 Component.onCompleted: { 0053 stackContainer.push(buttonArea); 0054 } 0055 0056 transitions: [ 0057 Transition { 0058 to: "*" 0059 NumberAnimation { target: buttonArea; properties: "height, width"; duration: 150 } 0060 NumberAnimation { target: gameOptions; properties: "height, width"; duration: 150 } 0061 } 0062 ] 0063 0064 function resizeWindow(windowHeight) { 0065 leftPanelHeight = windowHeight; 0066 } 0067 }