summaryrefslogtreecommitdiff
path: root/raveos-calamares-theme/etc/calamares/branding/raveos/finishedq.qml
blob: b72a368e7abe9cff20858466c58b3763d7c4a7cc (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
/* RaveOS - Calamares finished (Done) oldal
 *
 * "Restart now" gomb: config.doRestart(true) -> azonnal ujrainditja a gepet.
 * A tamogatok kulon keretben, alul, soronkent 3 nev, kozepre igazitva.
 * Sok nev eseten automatikusan lapoz (4s). A lista: supporters.js (import).
 * Ha nincs nev, a teljes tamogatoi panel el van rejtve.
 *
 * Nyelvek: hu / de / en. A desktop selector mintaja szerint: a lap
 * aktivalasakor (onActivate) frissitjuk a nyelvet, es minden szoveg
 * property bindinggel koveti (uiLang).
 */

import io.calamares.core 1.0
import io.calamares.ui 1.0

import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15

import "supporters.js" as Supporters

Item {
    id: finishedRoot
    anchors.fill: parent

    readonly property int supportersPerPage: 30
    readonly property int supportersColumns: 3
    readonly property bool hasSupporters: Supporters.names.length > 0
    readonly property int supportersPageCount: Math.max(1, Math.ceil(Supporters.names.length / supportersPerPage))

    // Szovegek a branding .qm fordításokbol; a lap aktivalasakor frissulnek
    // (a QQuickWidget nem forditja ujra a qsTr bindingeket nyelvvaltaskor)
    property string titleText: ""
    property string descText: ""
    property string restartText: ""
    property string supportersHeadText: ""
    property string thanksText: ""

    function updateTexts() {
        titleText = qsTr("Installation complete");
        descText = qsTr("Restart the system to start using %1.").arg(Branding.string(Branding.ProductName));
        restartText = qsTr("Restart now");
        supportersHeadText = qsTr("RaveOS Supporters");
        thanksText = qsTr("Thank you for your support, from every member of the team!");
    }

    Component.onCompleted: updateTexts()

    property int supportersPage: 0

    // Az aktualis oldal szovege: soronkent 3 nev, kozepre igazitva
    property string supportersText: {
        var start = supportersPage * supportersPerPage;
        var slice = Supporters.names.slice(start, start + supportersPerPage);
        var lines = [];
        for (var j = 0; j < slice.length; j += supportersColumns) {
            lines.push(slice.slice(j, j + supportersColumns).join("      "));
        }
        return lines.join("\n");
    }

    // RaveOS finish hatter
    Image {
        anchors.fill: parent
        source: "images/raveos-finish.png"
        fillMode: Image.Stretch
        smooth: true
        mipmap: true
    }

    // Fo keret: cim + leiras + Restart gomb
    Rectangle {
        id: panel
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.top: parent.top
        anchors.topMargin: Math.round(parent.height * 0.06)
        width: Math.min(parent.width * 0.75, 780)
        height: contentColumn.implicitHeight + 56
        color: "#CC1F1F1F"
        radius: 12

        ColumnLayout {
            id: contentColumn
            anchors.centerIn: parent
            width: parent.width - 64
            spacing: 18

            Text {
                Layout.fillWidth: true
                horizontalAlignment: Text.AlignHCenter
                color: "#FFFFFF"
                font.family: "Ubuntu"
                font.pixelSize: 26
                font.bold: true
                text: finishedRoot.titleText
            }

            Text {
                Layout.fillWidth: true
                horizontalAlignment: Text.AlignHCenter
                color: "#E8E8E8"
                font.family: "Ubuntu"
                font.pixelSize: 15
                wrapMode: Text.WordWrap
                text: finishedRoot.descText
            }

            Button {
                id: restartButton
                Layout.alignment: Qt.AlignHCenter
                text: finishedRoot.restartText
                hoverEnabled: true
                onClicked: config.doRestart(true)

                contentItem: Text {
                    text: restartButton.text
                    font.family: "Ubuntu"
                    font.pixelSize: 14
                    font.bold: true
                    color: "#FFFFFF"
                    horizontalAlignment: Text.AlignHCenter
                    verticalAlignment: Text.AlignVCenter
                }

                background: Rectangle {
                    implicitWidth: 180
                    implicitHeight: 40
                    radius: 4
                    color: (restartButton.down || restartButton.hovered) ? "#285226" : "#3d7839"
                }
            }
        }
    }

    // Kulon keret: tamogatok (alul) - csak akkor latszik, ha van nev
    Rectangle {
        id: supportersPanel
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.top: panel.bottom
        anchors.topMargin: 16
        width: Math.min(parent.width * 0.75, 780)
        height: supportersColumn.implicitHeight + 40
        color: "#CC1F1F1F"
        radius: 12
        visible: finishedRoot.hasSupporters

        ColumnLayout {
            id: supportersColumn
            anchors.centerIn: parent
            width: parent.width - 48
            spacing: 10

            Text {
                Layout.fillWidth: true
                horizontalAlignment: Text.AlignHCenter
                color: "#B9B9B9"
                font.family: "Ubuntu"
                font.pixelSize: 15
                font.bold: true
                text: finishedRoot.supportersHeadText
            }

            Text {
                id: supportersNames
                Layout.fillWidth: true
                horizontalAlignment: Text.AlignHCenter
                color: "#DADADA"
                font.family: "Ubuntu"
                font.pixelSize: 15
                lineHeight: 1.4
                text: finishedRoot.supportersText
                Behavior on opacity { NumberAnimation { duration: 250 } }
            }

            Text {
                Layout.fillWidth: true
                horizontalAlignment: Text.AlignHCenter
                color: "#8F8F8F"
                font.family: "Ubuntu"
                font.pixelSize: 12
                visible: finishedRoot.supportersPageCount > 1
                text: (finishedRoot.supportersPage + 1) + " / " + finishedRoot.supportersPageCount
            }

            // Koszonet a tamogatasert
            Text {
                Layout.fillWidth: true
                Layout.topMargin: 2
                horizontalAlignment: Text.AlignHCenter
                color: "#B9B9B9"
                font.family: "Ubuntu"
                font.pixelSize: 13
                font.italic: true
                wrapMode: Text.WordWrap
                text: finishedRoot.thanksText
            }
        }
    }

    // Automatikus lapozas, ha tobb oldal van
    Timer {
        id: pageTimer
        interval: 4000
        repeat: true
        running: finishedRoot.hasSupporters && finishedRoot.supportersPageCount > 1
        onTriggered: {
            supportersNames.opacity = 0;
            fadeTimer.start();
        }
    }

    Timer {
        id: fadeTimer
        interval: 260
        onTriggered: {
            finishedRoot.supportersPage = (finishedRoot.supportersPage + 1) % finishedRoot.supportersPageCount;
            supportersNames.opacity = 1;
        }
    }

    function onActivate()
    {
        updateTexts();
    }

    function onLeave()
    {
    }
}