forked from sboehmann/minesweeper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.qml
37 lines (31 loc) · 747 Bytes
/
main.qml
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
import QtQuick 2.5
import QtQuick.Window 2.2
import "minesweeper.js" as Minesweeper
Window {
id: window
visible: true
width: 680
height: 480
title: qsTr("Minesweeper")
Image {
id: background
anchors.fill: parent
asynchronous: true
smooth: true
source: "qrc:/bg.png"
}
Grid {
id: table
columns: Minesweeper.dimension
rows: columns
anchors.centerIn: parent
Repeater {
model: table.rows * table.columns
Button {
width: Math.max(16, (Math.min(window.width, window.height) / table.columns) - 8)
height: width
position: modelData
}
}
}
}