diff options
Diffstat (limited to 'raveos-calamares-theme/etc/calamares/branding/raveos/finishedq.qml')
| -rw-r--r-- | raveos-calamares-theme/etc/calamares/branding/raveos/finishedq.qml | 424 |
1 files changed, 231 insertions, 193 deletions
diff --git a/raveos-calamares-theme/etc/calamares/branding/raveos/finishedq.qml b/raveos-calamares-theme/etc/calamares/branding/raveos/finishedq.qml index 2f2ce56..d89d4a9 100644 --- a/raveos-calamares-theme/etc/calamares/branding/raveos/finishedq.qml +++ b/raveos-calamares-theme/etc/calamares/branding/raveos/finishedq.qml @@ -1,15 +1,3 @@ -/* 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 @@ -17,234 +5,284 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 +import "RaveOS" 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 bool hasHighlighted: (Supporters.highlighted || []).length > 0 - readonly property var regularNames: { - var h = Supporters.highlighted || []; - var out = []; - for (var i = 0; i < Supporters.names.length; i++) { - if (h.indexOf(Supporters.names[i]) === -1) - out.push(Supporters.names[i]); - } - return out; - } - readonly property int supportersPageCount: Math.max(1, Math.ceil(regularNames.length / supportersPerPage)) +Rectangle { + id: kesz + color: Stilus.hatter - // 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: "" + readonly property int nevekOldalankent: 18 + readonly property var kiemeltek: Supporters.highlighted || [] + readonly property var tobbiek: Supporters.names.filter(function(n) { return kiemeltek.indexOf(n) === -1 }) + readonly property int oldalakSzama: Math.max(1, Math.ceil(tobbiek.length / nevekOldalankent)) + property int oldal: 0 + readonly property bool hibas: config.failed - 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!"); + function onActivate() { + oldal = 0 } - 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 = regularNames.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"); + function onLeave() { } - // RaveOS finish hatter Image { anchors.fill: parent source: "images/raveos-finish.png" - fillMode: Image.Stretch + fillMode: Image.PreserveAspectCrop + horizontalAlignment: Image.AlignLeft + verticalAlignment: Image.AlignBottom smooth: true mipmap: true + asynchronous: 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 + component Jelolo: CheckBox { + id: jelolo + Layout.fillWidth: true + implicitHeight: 40 + spacing: 10 + indicator: Rectangle { + x: jelolo.leftPadding + y: (jelolo.height - height) / 2 + width: 18 + height: 18 + color: jelolo.checked ? Stilus.zold : Stilus.felulet + border.width: 1 + border.color: jelolo.checked ? Stilus.zold : Stilus.keretErosebb - Text { - Layout.fillWidth: true - horizontalAlignment: Text.AlignHCenter - color: "#FFFFFF" - font.family: "Ubuntu" - font.pixelSize: 26 - font.bold: true - text: finishedRoot.titleText + Canvas { + anchors.fill: parent + visible: jelolo.checked + onVisibleChanged: if (visible) requestPaint() + onPaint: { + var c = getContext("2d") + c.reset() + c.strokeStyle = Stilus.zoldonSzoveg + c.lineWidth = 2 + c.beginPath() + c.moveTo(4, 9) + c.lineTo(8, 13) + c.lineTo(14, 5) + c.stroke() + } } + } + contentItem: Text { + leftPadding: jelolo.indicator.width + jelolo.spacing + text: jelolo.text + color: Stilus.szoveg + font.family: Stilus.font + font.pixelSize: 14 + verticalAlignment: Text.AlignVCenter + } + } - Text { - Layout.fillWidth: true - horizontalAlignment: Text.AlignHCenter - color: "#E8E8E8" - font.family: "Ubuntu" - font.pixelSize: 15 - wrapMode: Text.WordWrap - text: finishedRoot.descText - } + ColumnLayout { + id: panelek + x: (kesz.width - width) / 2 + y: Math.max(32, (kesz.height - implicitHeight) / 2 - 40) + width: Math.min(560, kesz.width - 64) + spacing: 16 - Button { - id: restartButton - Layout.alignment: Qt.AlignHCenter - text: finishedRoot.restartText - hoverEnabled: true - onClicked: config.doRestart(true) + Rectangle { + Layout.fillWidth: true + implicitHeight: panel.implicitHeight + 48 + color: Qt.rgba(26 / 255, 27 / 255, 29 / 255, 0.9) + border.width: 1 + border.color: Stilus.keret - contentItem: Text { - text: restartButton.text - font.family: "Ubuntu" - font.pixelSize: 14 - font.bold: true - color: "#FFFFFF" + ColumnLayout { + id: panel + x: 26 + y: 24 + width: parent.width - 52 + spacing: 14 + + RowLayout { + Layout.alignment: Qt.AlignHCenter + spacing: 12 + + Rectangle { + width: 32 + height: 32 + color: kesz.hibas ? Stilus.sarga : Stilus.zold + + Canvas { + id: ikon + anchors.fill: parent + Connections { + target: kesz + function onHibasChanged() { ikon.requestPaint() } + } + onPaint: { + var c = getContext("2d") + c.reset() + c.strokeStyle = Stilus.zoldonSzoveg + c.lineWidth = 3 + c.beginPath() + if (kesz.hibas) { + c.moveTo(10, 10) + c.lineTo(22, 22) + c.moveTo(22, 10) + c.lineTo(10, 22) + } else { + c.moveTo(9, 16.5) + c.lineTo(13.5, 21) + c.lineTo(23, 11.5) + } + c.stroke() + } + } + } + + Text { + text: (ViewManager.currentStepIndex < 10 ? "0" : "") + ViewManager.currentStepIndex + " · " + (kesz.hibas ? qsTr("ERROR") : qsTr("DONE")) + color: kesz.hibas ? Stilus.sarga : Stilus.zold + font.family: Stilus.mono + font.pixelSize: 12 + font.letterSpacing: 2 + } + } + + Text { + Layout.fillWidth: true + horizontalAlignment: Text.AlignHCenter + text: kesz.hibas ? qsTr("THE INSTALLATION FAILED") : qsTr("RAVEOS IS INSTALLED") + wrapMode: Text.WordWrap + color: Stilus.szoveg + font.family: Stilus.cim + font.weight: Font.Bold + font.pixelSize: 36 + lineHeight: 0.95 + } + + Text { + Layout.fillWidth: true horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter + text: kesz.hibas ? config.failureMessage : qsTr("Restart the computer and remove the installer USB drive.") + wrapMode: Text.WordWrap + color: Stilus.szovegMasodlagos + font.family: Stilus.font + font.pixelSize: 14 + lineHeight: 1.2 + } + + ColumnLayout { + Layout.alignment: Qt.AlignHCenter + spacing: 0 + + Jelolo { + Layout.fillWidth: false + Layout.alignment: Qt.AlignHCenter + visible: !kesz.hibas && (config.restartNowMode === 1 || config.restartNowMode === 2) + text: qsTr("Restart now") + checked: config.restartNowWanted + onToggled: config.restartNowWanted = checked + } } - background: Rectangle { - implicitWidth: 180 - implicitHeight: 40 - radius: 4 - color: (restartButton.down || restartButton.hovered) ? "#285226" : "#3d7839" + Text { + Layout.fillWidth: true + horizontalAlignment: Text.AlignHCenter + visible: !kesz.hibas + text: qsTr("The installation log is saved on the new system: %1").arg("/var/log/Calamares.log") + wrapMode: Text.WordWrap + color: Stilus.szovegHalvany + font.family: Stilus.font + font.pixelSize: 12 } } } - } - // 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 + Rectangle { + visible: Supporters.names.length > 0 + Layout.fillWidth: true + implicitHeight: tamogatok.implicitHeight + 36 + color: Qt.rgba(26 / 255, 27 / 255, 29 / 255, 0.9) + border.width: 1 + border.color: Stilus.keret - ColumnLayout { - id: supportersColumn - anchors.centerIn: parent - width: parent.width - 48 - spacing: 10 + ColumnLayout { + id: tamogatok + x: 26 + y: 18 + width: parent.width - 52 + spacing: 8 - Text { - Layout.fillWidth: true - horizontalAlignment: Text.AlignHCenter - color: "#B9B9B9" - font.family: "Ubuntu" - font.pixelSize: 15 - font.bold: true - text: finishedRoot.supportersHeadText - } + Text { + Layout.alignment: Qt.AlignHCenter + text: qsTr("RAVEOS SUPPORTERS") + color: Stilus.szovegHalvany + font.family: Stilus.font + font.pixelSize: 12 + font.weight: Font.Medium + font.letterSpacing: 1 + } - Text { - Layout.fillWidth: true - horizontalAlignment: Text.AlignHCenter - visible: finishedRoot.hasHighlighted - color: "#4ade80" - font.family: "Ubuntu" - font.pixelSize: 17 - font.bold: true - text: finishedRoot.hasHighlighted ? ("★ " + Supporters.highlighted.join(" ")) : "" - } + Text { + Layout.fillWidth: true + horizontalAlignment: Text.AlignHCenter + visible: kesz.kiemeltek.length > 0 + text: kesz.kiemeltek.join(" ") + wrapMode: Text.WordWrap + color: Stilus.zold + font.family: Stilus.font + font.pixelSize: 15 + font.weight: Font.DemiBold + } - 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 { + id: nevek + Layout.fillWidth: true + horizontalAlignment: Text.AlignHCenter + text: kesz.tobbiek.slice(kesz.oldal * kesz.nevekOldalankent, (kesz.oldal + 1) * kesz.nevekOldalankent).join(" ") + wrapMode: Text.WordWrap + color: Stilus.szoveg + font.family: Stilus.font + font.pixelSize: 14 + lineHeight: 1.3 + 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 - } + Text { + Layout.alignment: Qt.AlignHCenter + visible: kesz.oldalakSzama > 1 + text: (kesz.oldal + 1) + " / " + kesz.oldalakSzama + color: Stilus.szovegHalvany + font.family: Stilus.mono + font.pixelSize: 12 + } - // 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 + Text { + Layout.fillWidth: true + horizontalAlignment: Text.AlignHCenter + text: qsTr("Thank you for your support, from every member of the team!") + wrapMode: Text.WordWrap + color: Stilus.szovegMasodlagos + font.family: Stilus.font + font.pixelSize: 12 + } } } } - // Automatikus lapozas, ha tobb oldal van Timer { - id: pageTimer interval: 4000 repeat: true - running: finishedRoot.hasSupporters && finishedRoot.supportersPageCount > 1 + running: kesz.oldalakSzama > 1 onTriggered: { - supportersNames.opacity = 0; - fadeTimer.start(); + nevek.opacity = 0 + lapozas.start() } } Timer { - id: fadeTimer + id: lapozas interval: 260 onTriggered: { - finishedRoot.supportersPage = (finishedRoot.supportersPage + 1) % finishedRoot.supportersPageCount; - supportersNames.opacity = 1; + kesz.oldal = (kesz.oldal + 1) % kesz.oldalakSzama + nevek.opacity = 1 } } - - function onActivate() - { - updateTexts(); - } - - function onLeave() - { - } } |