summaryrefslogtreecommitdiff
path: root/raveos-calamares-theme/etc/calamares/branding/raveos/calamares-navigation.qml
diff options
context:
space:
mode:
Diffstat (limited to 'raveos-calamares-theme/etc/calamares/branding/raveos/calamares-navigation.qml')
-rw-r--r--raveos-calamares-theme/etc/calamares/branding/raveos/calamares-navigation.qml163
1 files changed, 163 insertions, 0 deletions
diff --git a/raveos-calamares-theme/etc/calamares/branding/raveos/calamares-navigation.qml b/raveos-calamares-theme/etc/calamares/branding/raveos/calamares-navigation.qml
new file mode 100644
index 0000000..d17de20
--- /dev/null
+++ b/raveos-calamares-theme/etc/calamares/branding/raveos/calamares-navigation.qml
@@ -0,0 +1,163 @@
+import io.calamares.ui 1.0
+import io.calamares.core 1.0
+
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Layouts 1.15
+import "RaveOS"
+
+Rectangle {
+ id: lablec
+ color: Stilus.hatter
+ height: 73
+
+ readonly property int lepesekSzama: Math.max(lepesek.count - 1, 0)
+ readonly property int aktualis: ViewManager.currentStepIndex
+ readonly property bool utolso: aktualis === lepesekSzama
+ readonly property bool telepites: telepitesElindult && !utolso
+ property bool telepitesElindult: false
+ property bool naploLatszik: false
+
+ function frissitAllapot() {
+ naploLatszik = Global.value("raveosNaplo") === true
+ telepitesElindult = Global.contains("raveosHaladas")
+ }
+
+ function cimke(szoveg) {
+ return szoveg.replace("&", "")
+ }
+
+ Connections {
+ target: Global
+ function onChanged() {
+ Qt.callLater(lablec.frissitAllapot)
+ }
+ }
+
+ Repeater {
+ id: lepesek
+ model: ViewManager
+ Item {}
+ }
+
+ Rectangle {
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: 1
+ color: Stilus.keret
+ }
+
+ component SzovegGomb: Button {
+ id: gomb
+ Layout.preferredHeight: 44
+ leftPadding: 16
+ rightPadding: 16
+ background: Rectangle { color: "transparent" }
+ contentItem: Text {
+ text: gomb.text
+ color: gomb.hovered ? Stilus.szoveg : Stilus.szovegMasodlagos
+ font.family: Stilus.font
+ font.pixelSize: 14
+ font.weight: Font.Medium
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+
+ component KeretesGomb: Button {
+ id: gomb
+ Layout.preferredHeight: 44
+ leftPadding: 20
+ rightPadding: 20
+ background: Rectangle {
+ color: gomb.hovered && gomb.enabled ? Stilus.aktiv : "transparent"
+ border.width: 1
+ border.color: gomb.enabled ? Stilus.keretErosebb : Stilus.keret
+ }
+ contentItem: Text {
+ text: gomb.text
+ color: gomb.enabled ? Stilus.szoveg : Stilus.szovegHalvany
+ font.family: Stilus.font
+ font.pixelSize: 14
+ font.weight: Font.Medium
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+
+ component ZoldGomb: Button {
+ id: gomb
+ Layout.preferredHeight: 44
+ leftPadding: 24
+ rightPadding: 24
+ background: Rectangle {
+ color: !gomb.enabled ? "transparent" : (gomb.hovered ? Stilus.zoldHover : Stilus.zold)
+ border.width: gomb.enabled ? 0 : 1
+ border.color: Stilus.keret
+ }
+ contentItem: Text {
+ text: gomb.text
+ color: gomb.enabled ? Stilus.zoldonSzoveg : Stilus.szovegHalvany
+ font.family: Stilus.font
+ font.pixelSize: 14
+ font.weight: Font.DemiBold
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+
+ RowLayout {
+ anchors.fill: parent
+ anchors.topMargin: 15
+ anchors.bottomMargin: 14
+ anchors.leftMargin: 56
+ anchors.rightMargin: 56
+ spacing: 12
+
+ Text {
+ text: qsTr("STEP %1 / %2").arg(lablec.aktualis).arg(lablec.lepesekSzama)
+ + (lablec.telepites ? " · " + qsTr("DO NOT TURN OFF THE COMPUTER") : "")
+ color: Stilus.szovegHalvany
+ font.family: Stilus.mono
+ font.pixelSize: 12
+ }
+
+ Item {
+ Layout.fillWidth: true
+ }
+
+ SzovegGomb {
+ visible: !lablec.telepites && !lablec.utolso && ViewManager.quitVisible
+ enabled: ViewManager.quitEnabled
+ text: qsTr("Quit")
+ onClicked: ViewManager.quit()
+ }
+
+ SzovegGomb {
+ visible: lablec.telepites
+ text: lablec.naploLatszik ? qsTr("Show slideshow") : qsTr("Open log")
+ onClicked: Global.insert("raveosNaplo", !lablec.naploLatszik)
+ }
+
+ KeretesGomb {
+ visible: !lablec.telepites && !lablec.utolso && ViewManager.backAndNextVisible
+ enabled: ViewManager.backEnabled || lablec.aktualis === 1
+ text: qsTr("Back")
+ onClicked: lablec.aktualis === 1 ? ViewManager.goBackTo(0) : ViewManager.back()
+ }
+
+ ZoldGomb {
+ visible: !lablec.utolso && ViewManager.backAndNextVisible
+ enabled: ViewManager.nextEnabled && !lablec.telepites
+ text: ViewManager.nextIcon === "run-install" ? lablec.cimke(ViewManager.nextLabel) : qsTr("Next")
+ onClicked: ViewManager.next()
+ }
+
+ ZoldGomb {
+ visible: lablec.utolso
+ enabled: ViewManager.quitEnabled
+ leftPadding: 28
+ rightPadding: 28
+ text: lablec.cimke(ViewManager.quitLabel)
+ onClicked: ViewManager.quit()
+ }
+ }
+}