added application icon and menubar
This commit is contained in:
parent
4495dc56ff
commit
e49b346e63
@ -11,3 +11,7 @@ QML_IMPORT_PATH =
|
||||
|
||||
# Default rules for deployment.
|
||||
include(deployment.pri)
|
||||
|
||||
# Setting the application icon
|
||||
RC_ICONS = 2048.ico # On Windows
|
||||
ICON = 2048.ico # On Mac OSX
|
||||
|
BIN
2048.ico
Normal file
BIN
2048.ico
Normal file
Binary file not shown.
After (image error) Size: 4.2 KiB |
@ -45,10 +45,6 @@ function startupFunction() {
|
||||
}
|
||||
|
||||
function moveKey(event) {
|
||||
if ((event.key == Qt.Key_Q) && (event.modifiers & Qt.ControlModifier)) {
|
||||
Qt.quit();
|
||||
}
|
||||
|
||||
var isMoved = false;
|
||||
var i, j, v, v2;
|
||||
var oldScore = score;
|
||||
|
22
qml/main.qml
22
qml/main.qml
@ -7,13 +7,31 @@ import "2048.js" as MyScript
|
||||
|
||||
ApplicationWindow {
|
||||
visible: true
|
||||
width: 560
|
||||
height: 730
|
||||
width: 550
|
||||
height: 740
|
||||
title: qsTr("2048 Game");
|
||||
flags: Qt.Window | Qt.MSWindowsFixedSizeDialogHint
|
||||
|
||||
x: (Screen.width - width) / 2
|
||||
y: (Screen.height - height) / 2
|
||||
|
||||
menuBar: MenuBar {
|
||||
Menu {
|
||||
title: qsTr("File")
|
||||
MenuItem {
|
||||
text: qsTr("New Game")
|
||||
shortcut: "Ctrl+N"
|
||||
onTriggered: MyScript.startupFunction();
|
||||
}
|
||||
MenuItem {
|
||||
text: qsTr("Exit")
|
||||
shortcut: "Ctrl+Q"
|
||||
onTriggered: Qt.quit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Item {
|
||||
id: helper
|
||||
property var myColors: {"bglight": "#FAF8EF",
|
||||
|
Loading…
x
Reference in New Issue
Block a user