cool-retro-term
133 строки · 4.9 Кб
1/*******************************************************************************
2* Copyright (c) 2013-2021 "Filippo Scognamiglio"
3* https://github.com/Swordfish90/cool-retro-term
4*
5* This file is part of cool-retro-term.
6*
7* cool-retro-term is free software: you can redistribute it and/or modify
8* it under the terms of the GNU General Public License as published by
9* the Free Software Foundation, either version 3 of the License, or
10* (at your option) any later version.
11*
12* This program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU General Public License for more details.
16*
17* You should have received a copy of the GNU General Public License
18* along with this program. If not, see <http://www.gnu.org/licenses/>.
19*******************************************************************************/
20import QtQuick 2.2
21import QtQuick.Controls 2.2
22import QtQuick.Layouts 1.1
23import QtQuick.Window 2.0
24
25Window {
26id: dialogwindow
27title: qsTr("About")
28width: 600
29height: 400
30
31modality: Qt.ApplicationModal
32
33ColumnLayout {
34anchors.fill: parent
35anchors.margins: 15
36spacing: 15
37Text {
38Layout.alignment: Qt.AlignHCenter
39text: "cool-retro-term"
40font {
41bold: true
42pointSize: 18
43}
44}
45Loader {
46id: mainContent
47Layout.fillHeight: true
48Layout.fillWidth: true
49
50states: [
51State {
52name: "Default"
53PropertyChanges {
54target: mainContent
55sourceComponent: defaultComponent
56}
57},
58State {
59name: "License"
60PropertyChanges {
61target: mainContent
62sourceComponent: licenseComponent
63}
64}
65]
66Component.onCompleted: mainContent.state = "Default"
67}
68Item {
69Layout.fillWidth: true
70height: childrenRect.height
71Button {
72anchors.left: parent.left
73text: qsTr("License")
74onClicked: {
75mainContent.state == "Default" ? mainContent.state
76= "License" : mainContent.state = "Default"
77}
78}
79Button {
80anchors.right: parent.right
81text: qsTr("Close")
82onClicked: dialogwindow.close()
83}
84}
85}
86// MAIN COMPONENTS ////////////////////////////////////////////////////////
87Component {
88id: defaultComponent
89ColumnLayout {
90anchors.fill: parent
91spacing: 10
92Image {
93Layout.fillWidth: true
94Layout.fillHeight: true
95Layout.alignment: Qt.AlignHCenter
96fillMode: Image.PreserveAspectFit
97source: "images/crt256.png"
98smooth: true
99}
100Text {
101Layout.alignment: Qt.AlignCenter
102horizontalAlignment: Text.AlignHCenter
103text: appSettings.version + "\n" + qsTr(
104"Author: ") + "Filippo Scognamiglio\n" + qsTr(
105"Email: ") + "flscogna@gmail.com\n" + qsTr(
106"Source: ") + "https://github.com/Swordfish90/cool-retro-term\n"
107}
108}
109}
110Component {
111id: licenseComponent
112ScrollView {
113anchors.fill: parent
114clip: true
115TextArea {
116readOnly: true
117wrapMode: TextEdit.Wrap
118text: "Copyright (c) 2013-2021 Filippo Scognamiglio <flscogna@gmail.com>\n\n"
119+ "https://github.com/Swordfish90/cool-retro-term\n\n" +
120"cool-retro-term is free software: you can redistribute it and/or modify "
121+ "it under the terms of the GNU General Public License as published by "
122+ "the Free Software Foundation, either version 3 of the License, or "
123+ "(at your option) any later version.\n\n" +
124"This program is distributed in the hope that it will be useful, "
125+ "but WITHOUT ANY WARRANTY; without even the implied warranty of "
126+ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the "
127+ "GNU General Public License for more details.\n\n" +
128"You should have received a copy of the GNU General Public License "
129+ "along with this program. If not, see <http://www.gnu.org/licenses/>."
130}
131}
132}
133}
134