qmlFrontend/qml/qmlFrontend/GameConfig.qml
author unc0rr
Wed, 01 Oct 2014 01:20:05 +0400
branchqmlfrontend
changeset 10436 084e046f6bd5
parent 10434 1614b13ad35e
child 10442 c58db813240b
permissions -rw-r--r--
flib provides theme icons, qmlFrontend shows them
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10422
4cf23d4c7624 - Pages
unc0rr
parents:
diff changeset
     1
import QtQuick 2.0
4cf23d4c7624 - Pages
unc0rr
parents:
diff changeset
     2
import Hedgewars.Engine 1.0
4cf23d4c7624 - Pages
unc0rr
parents:
diff changeset
     3
4cf23d4c7624 - Pages
unc0rr
parents:
diff changeset
     4
Rectangle {
4cf23d4c7624 - Pages
unc0rr
parents:
diff changeset
     5
    HWButton {
4cf23d4c7624 - Pages
unc0rr
parents:
diff changeset
     6
        id: btnPreview
4cf23d4c7624 - Pages
unc0rr
parents:
diff changeset
     7
        x: 50
10434
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
     8
        y: 16
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
     9
        width: 256
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    10
        height: 128
10422
4cf23d4c7624 - Pages
unc0rr
parents:
diff changeset
    11
10432
b0abef0ee78c Quick Game PoC
unc0rr
parents: 10428
diff changeset
    12
        onClicked: HWEngine.getPreview()
10422
4cf23d4c7624 - Pages
unc0rr
parents:
diff changeset
    13
4cf23d4c7624 - Pages
unc0rr
parents:
diff changeset
    14
        Connections {
4cf23d4c7624 - Pages
unc0rr
parents:
diff changeset
    15
            target: HWEngine
10424
4be6cd55f1cf - Get rid of engine's PathPrefix and UserPathPrefix
unc0rr
parents: 10422
diff changeset
    16
            onPreviewImageChanged: previewImage.source = "image://preview/" + HWEngine.currentSeed()
10422
4cf23d4c7624 - Pages
unc0rr
parents:
diff changeset
    17
        }
10434
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    18
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    19
        Image {
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    20
            id: previewImage
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    21
            x: 0
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    22
            y: 0
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    23
            width: 256
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    24
            height: 128
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    25
            cache: false
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    26
        }
10422
4cf23d4c7624 - Pages
unc0rr
parents:
diff changeset
    27
    }
4cf23d4c7624 - Pages
unc0rr
parents:
diff changeset
    28
10436
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    29
    Rectangle {
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    30
        x: 320
10434
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    31
        y: 16
10436
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    32
        width: 100
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    33
        height: 256
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    34
        color: "#15193a"
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    35
        radius: 8
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    36
        border.width: 4
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    37
        border.color: "#eaea00"
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    38
        Image {
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    39
            id: themeImage
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    40
            x: 0
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    41
            y: 0
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    42
            width: 64
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    43
            height: 64
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    44
            fillMode: Image.Pad
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    45
        }
10434
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    46
10436
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    47
        ListView {
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    48
            id: themesList
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    49
            x: 0
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    50
            y: 64
10434
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    51
            width: 100
10436
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    52
            height: 192
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    53
            highlight: Rectangle { color: "#eaea00"; radius: 4 }
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    54
            focus: true
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    55
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    56
            model: themesModel
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    57
            delegate: Rectangle {
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    58
                height: 25
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    59
                width: 100
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    60
                color: "transparent"
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    61
                Text {id: themeName; text: modelData }
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    62
                MouseArea {
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    63
                     z: 1
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    64
                     anchors.fill: parent
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    65
                     onClicked: {
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    66
                         themeImage.source = "image://theme/" + themeName.text
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    67
                         themesList.currentIndex = index
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    68
                     }
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    69
                }
084e046f6bd5 flib provides theme icons, qmlFrontend shows them
unc0rr
parents: 10434
diff changeset
    70
            }
10434
1614b13ad35e Themes model, also add some files I forgot to add previously
unc0rr
parents: 10432
diff changeset
    71
        }
10422
4cf23d4c7624 - Pages
unc0rr
parents:
diff changeset
    72
    }
4cf23d4c7624 - Pages
unc0rr
parents:
diff changeset
    73
}