cool-retro-term

Форк
0
/
AboutDialog.qml 
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
*******************************************************************************/
20
import QtQuick 2.2
21
import QtQuick.Controls 2.2
22
import QtQuick.Layouts 1.1
23
import QtQuick.Window 2.0
24

25
Window {
26
    id: dialogwindow
27
    title: qsTr("About")
28
    width: 600
29
    height: 400
30

31
    modality: Qt.ApplicationModal
32

33
    ColumnLayout {
34
        anchors.fill: parent
35
        anchors.margins: 15
36
        spacing: 15
37
        Text {
38
            Layout.alignment: Qt.AlignHCenter
39
            text: "cool-retro-term"
40
            font {
41
                bold: true
42
                pointSize: 18
43
            }
44
        }
45
        Loader {
46
            id: mainContent
47
            Layout.fillHeight: true
48
            Layout.fillWidth: true
49

50
            states: [
51
                State {
52
                    name: "Default"
53
                    PropertyChanges {
54
                        target: mainContent
55
                        sourceComponent: defaultComponent
56
                    }
57
                },
58
                State {
59
                    name: "License"
60
                    PropertyChanges {
61
                        target: mainContent
62
                        sourceComponent: licenseComponent
63
                    }
64
                }
65
            ]
66
            Component.onCompleted: mainContent.state = "Default"
67
        }
68
        Item {
69
            Layout.fillWidth: true
70
            height: childrenRect.height
71
            Button {
72
                anchors.left: parent.left
73
                text: qsTr("License")
74
                onClicked: {
75
                    mainContent.state == "Default" ? mainContent.state
76
                                                     = "License" : mainContent.state = "Default"
77
                }
78
            }
79
            Button {
80
                anchors.right: parent.right
81
                text: qsTr("Close")
82
                onClicked: dialogwindow.close()
83
            }
84
        }
85
    }
86
    // MAIN COMPONENTS ////////////////////////////////////////////////////////
87
    Component {
88
        id: defaultComponent
89
        ColumnLayout {
90
            anchors.fill: parent
91
            spacing: 10
92
            Image {
93
                Layout.fillWidth: true
94
                Layout.fillHeight: true
95
                Layout.alignment: Qt.AlignHCenter
96
                fillMode: Image.PreserveAspectFit
97
                source: "images/crt256.png"
98
                smooth: true
99
            }
100
            Text {
101
                Layout.alignment: Qt.AlignCenter
102
                horizontalAlignment: Text.AlignHCenter
103
                text: 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
    }
110
    Component {
111
        id: licenseComponent
112
        ScrollView {
113
            anchors.fill: parent
114
            clip: true
115
            TextArea {
116
                readOnly: true
117
                wrapMode: TextEdit.Wrap
118
                text: "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

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.