diff options
Diffstat (limited to 'raveos-calamares-theme/etc/calamares/branding/raveos/welcomeq.qml')
| -rw-r--r-- | raveos-calamares-theme/etc/calamares/branding/raveos/welcomeq.qml | 257 |
1 files changed, 202 insertions, 55 deletions
diff --git a/raveos-calamares-theme/etc/calamares/branding/raveos/welcomeq.qml b/raveos-calamares-theme/etc/calamares/branding/raveos/welcomeq.qml index e38106b..bcf1eb5 100644 --- a/raveos-calamares-theme/etc/calamares/branding/raveos/welcomeq.qml +++ b/raveos-calamares-theme/etc/calamares/branding/raveos/welcomeq.qml @@ -1,71 +1,218 @@ -import QtQuick 2.10 -import QtQuick.Controls 2.3 -import QtQuick.Layouts 1.3 +import io.calamares.core 1.0 +import io.calamares.ui 1.0 -Item { - id: welcomeRoot - anchors.fill: parent +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.15 +import "RaveOS" - // Adaptive background image - Image { - anchors.fill: parent - source: "images/raveos-welcome.png" - fillMode: Image.Stretch - smooth: true - mipmap: true +Rectangle { + id: udvozles + color: Stilus.hatter + + property string firmware: "" + property var kovetelmenyek: [] + + function frissitFirmware() { + firmware = Global.value("firmwareType") || "" } - // Bottom overlay for language selector - Rectangle { - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.right: parent.right - height: 56 - gradient: Gradient { - GradientStop { position: 0.0; color: "#002B2B2B" } - GradientStop { position: 1.0; color: "#DD2B2B2B" } + function frissitKovetelmenyek() { + var m = config.requirementsModel + var lista = [] + for (var i = 0; i < m.rowCount(); ++i) { + var sor = m.index(i, 0) + lista.push({ + nev: m.data(sor, Qt.UserRole), + teljesul: m.data(sor, Qt.UserRole + 1), + kotelezo: m.data(sor, Qt.UserRole + 2), + negalt: m.data(sor, Qt.DisplayRole) + }) } + kovetelmenyek = lista + } - RowLayout { - anchors.centerIn: parent - spacing: 10 + function cimke(nev) { + switch (nev) { + case "storage": return qsTr("Free disk space") + case "ram": return qsTr("Memory") + case "power": return qsTr("Power supply") + case "internet": return qsTr("Network connection") + case "root": return qsTr("Administrator rights") + case "screen": return qsTr("Screen size") + case "partitions": return qsTr("Disk for installation") + } + return nev + } - Image { - source: "qrc:/welcome/language-icon-48px.png" - width: 22 - height: 22 - smooth: true - } + function allapot(nev, teljesul, kotelezo) { + if (teljesul) + return "OK" + if (kotelezo) + return qsTr("MISSING") + if (nev === "power") + return qsTr("BATTERY") + return qsTr("WARNING") + } - ComboBox { - id: languageCombo - currentIndex: config.localeIndex - onActivated: function(idx) { - console.log("QML: activating locale idx=" + idx); - config.localeIndex = idx; - console.log("QML: after set, localeIndex=" + config.localeIndex); + Component.onCompleted: { + frissitFirmware() + frissitKovetelmenyek() + } + + Connections { + target: config.requirementsModel + function onModelReset() { Qt.callLater(udvozles.frissitKovetelmenyek) } + function onRowsInserted() { Qt.callLater(udvozles.frissitKovetelmenyek) } + function onDataChanged() { Qt.callLater(udvozles.frissitKovetelmenyek) } + function onSatisfiedRequirementsChanged() { Qt.callLater(udvozles.frissitKovetelmenyek) } + } + + Connections { + target: Global + function onChanged() { + Qt.callLater(udvozles.frissitFirmware) + } + } + + component Sor: Rectangle { + property string felirat: "" + property string ertek: "" + property color ertekSzin: Stilus.zold + property string sugo: "" + Layout.fillWidth: true + Layout.preferredHeight: 44 + color: "transparent" + + Rectangle { + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + height: 1 + color: Stilus.aktiv + } + + Text { + anchors.left: parent.left + anchors.leftMargin: 16 + anchors.verticalCenter: parent.verticalCenter + text: parent.felirat + color: Stilus.szoveg + font.family: Stilus.font + font.pixelSize: 14 + } + + Text { + anchors.right: parent.right + anchors.rightMargin: 16 + anchors.verticalCenter: parent.verticalCenter + text: parent.ertek + color: parent.ertekSzin + font.family: Stilus.mono + font.pixelSize: 12 + font.weight: Font.Medium + } + + HoverHandler { + id: hover + } + + ToolTip.visible: hover.hovered && sugo !== "" + ToolTip.text: sugo + ToolTip.delay: 400 + } + + Flickable { + id: gorgeto + anchors.fill: parent + contentHeight: tartalom.implicitHeight + 96 + clip: true + boundsBehavior: Flickable.StopAtBounds + + ColumnLayout { + id: tartalom + x: 56 + y: 48 + width: gorgeto.width - 112 + spacing: 28 + + ColumnLayout { + spacing: 10 + + Text { + text: qsTr("WELCOME") + color: Stilus.zold + font.family: Stilus.mono + font.pixelSize: 12 + font.letterSpacing: 2 } - implicitWidth: 260 - implicitHeight: 36 - Component.onCompleted: { - var m = config.languagesModel; - var items = []; - for (var i = 0; i < m.rowCount(); i++) { - var idx = m.index(i, 0); - var val = m.data(idx, Qt.DisplayRole); - items.push(val !== undefined ? val : m.data(idx, Qt.UserRole)); - } - model = items; - currentIndex = config.localeIndex; + Text { + Layout.fillWidth: true + text: qsTr("TO THE RAVEOS INSTALLER") + wrapMode: Text.WordWrap + color: Stilus.szoveg + font.family: Stilus.cim + font.weight: Font.Bold + font.pixelSize: 44 + lineHeight: 0.95 + } + + Text { + Layout.preferredWidth: Math.min(520, tartalom.width) + text: qsTr("A few steps and you are done. The default settings work all the way through, and you can go back at any time.") + wrapMode: Text.WordWrap + color: Stilus.szovegMasodlagos + font.family: Stilus.font + font.pixelSize: 15 + lineHeight: 1.2 } } - Connections { - target: config - function onLocaleIndexChanged() { - console.log("QML: localeIndexChanged signal fired! new=" + config.localeIndex); - languageCombo.currentIndex = config.localeIndex; + ColumnLayout { + Layout.preferredWidth: Math.min(560, tartalom.width) + spacing: 10 + + Text { + text: qsTr("SYSTEM REQUIREMENTS") + color: Stilus.szovegHalvany + font.family: Stilus.font + font.pixelSize: 12 + font.weight: Font.Medium + font.letterSpacing: 1 + } + + Rectangle { + Layout.fillWidth: true + implicitHeight: lista.implicitHeight + 2 + color: Stilus.felulet + border.width: 1 + border.color: Stilus.keret + + ColumnLayout { + id: lista + x: 1 + y: 1 + width: parent.width - 2 + spacing: 0 + + Repeater { + model: udvozles.kovetelmenyek + + Sor { + felirat: udvozles.cimke(modelData.nev) + ertek: udvozles.allapot(modelData.nev, modelData.teljesul, modelData.kotelezo) + ertekSzin: modelData.teljesul ? Stilus.zold : Stilus.sarga + sugo: modelData.teljesul ? "" : modelData.negalt + } + } + + Sor { + visible: udvozles.firmware !== "" + felirat: qsTr("Boot mode") + ertek: udvozles.firmware === "efi" ? "UEFI" : "BIOS" + } + } } } } |