File: Window.qml

package info (click to toggle)
marble 4%3A16.08.3-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 76,596 kB
  • ctags: 22,881
  • sloc: cpp: 177,552; xml: 39,363; ansic: 7,204; python: 2,209; sh: 1,140; makefile: 230; perl: 222; ruby: 97; java: 66
file content (72 lines) | stat: -rw-r--r-- 1,688 bytes parent folder | download | duplicates (3)
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;
    }
}