Skip to content

Commit 7709a08

Browse files
committed
Add AboutDialog component
1 parent c493c0e commit 7709a08

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

src/app/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ qt_add_qml_module(${APP_TARGET}
1313
VERSION 1.0
1414
QML_FILES
1515
qml/main.qml
16+
qml/dialogs/AboutDialog.qml
1617
)
1718

1819
set(QML_IMPORT_PATH "${QML_IMPORT_PATH};${CMAKE_CURRENT_LIST_DIR}"
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later
2+
3+
import QtQuick
4+
import QtQuick.Controls
5+
import QtQuick.Layouts
6+
import ScratchCPP.Ui
7+
import ScratchCPP.UiComponents
8+
9+
CustomDialog {
10+
//: For example "About ScratchCPP" (%1 is the app name)
11+
title: qsTr("About %1").arg(Qt.application.displayName)
12+
standardButtons: Dialog.Ok
13+
14+
contentItem: RowLayout {
15+
spacing: 25
16+
17+
/*Image {
18+
source: "qrc:/res/images/icon.ico"
19+
sourceSize.width: 60
20+
sourceSize.height: 60
21+
Layout.alignment: Qt.AlignTop
22+
}*/
23+
24+
ColumnLayout {
25+
Label {
26+
text: Qt.application.displayName
27+
font.bold: true
28+
}
29+
30+
Label {}
31+
32+
Label {
33+
text: qsTr("Version: %1").arg(Qt.application.version)
34+
}
35+
36+
Label {
37+
text: qsTr("Revision: %1").arg(AppInfo.revision())
38+
}
39+
40+
Label {
41+
readonly property string src: "https://github.com/scratchcpp/scratchcpp-player"
42+
text: qsTr("Source code: %1").arg("<a href=\"" + src + "\">" + src + "</a>")
43+
onLinkActivated: (link)=> Qt.openUrlExternally(link)
44+
}
45+
46+
Label {}
47+
48+
Label {
49+
readonly property int startYear: 2024
50+
readonly property string startStr: AppInfo.buildYear() === startYear ? "" : startYear + "-"
51+
text: "Copyright © " + startStr + AppInfo.buildYear() + " adazem009"
52+
}
53+
54+
Label {
55+
text: qsTr("Published with the GNU General Public License.")
56+
}
57+
}
58+
}
59+
}

0 commit comments

Comments
 (0)