summaryrefslogtreecommitdiff
path: root/raveos-calamares-theme/etc/calamares/branding/raveos/summaryq.qml
blob: cb003020e7319ab51b7c6fb86701a50fcd4a4096 (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
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 "RaveOS"

Rectangle {
    id: osszegzes
    color: Stilus.hatter

    property bool lemezTorles: false

    function frissit() {
        var valasztas = Global.value("partitionChoices")
        lemezTorles = valasztas !== undefined && valasztas !== null && valasztas.install === "erase"
    }

    function lepesIndex(cim) {
        for (var i = 0; i < ViewManager.rowCount(); ++i) {
            if (ViewManager.data(ViewManager.index(i, 0), Qt.DisplayRole) === cim)
                return i
        }
        return -1
    }

    function modosit(cim) {
        var cel = lepesIndex(cim)
        if (cel >= 0)
            ViewManager.goBackTo(cel)
    }

    function onActivate() {
        frissit()
    }

    Component.onCompleted: frissit()

    Flickable {
        id: gorgeto
        anchors.fill: parent
        contentHeight: tartalom.implicitHeight + 80
        clip: true
        boundsBehavior: Flickable.StopAtBounds

        ColumnLayout {
            id: tartalom
            x: 56
            y: 48
            width: gorgeto.width - 112
            spacing: 22

            Fejlec {
                Layout.fillWidth: true
                felirat: qsTr("SUMMARY")
                cim: qsTr("IS EVERYTHING RIGHT?")
            }

            GridLayout {
                Layout.fillWidth: true
                columns: 3
                columnSpacing: 12
                rowSpacing: 12

                Repeater {
                    model: config.summaryModel

                    Rectangle {
                        Layout.fillWidth: true
                        Layout.preferredWidth: 1
                        Layout.fillHeight: true
                        implicitHeight: blokk.implicitHeight + 32
                        color: Stilus.felulet
                        border.width: 1
                        border.color: Stilus.keret

                        ColumnLayout {
                            id: blokk
                            x: 18
                            y: 16
                            width: parent.width - 36
                            spacing: 10

                            RowLayout {
                                Layout.fillWidth: true
                                spacing: 12

                                Text {
                                    Layout.fillWidth: true
                                    text: model.title
                                    elide: Text.ElideRight
                                    color: Stilus.szovegHalvany
                                    font.family: Stilus.font
                                    font.pixelSize: 12
                                    font.weight: Font.Medium
                                    font.letterSpacing: 1
                                    font.capitalization: Font.AllUppercase
                                }

                                Text {
                                    text: qsTr("Change")
                                    color: valtHover.hovered ? Stilus.zoldHover : Stilus.zold
                                    font.family: Stilus.font
                                    font.pixelSize: 13
                                    font.weight: Font.DemiBold

                                    HoverHandler {
                                        id: valtHover
                                        cursorShape: Qt.PointingHandCursor
                                    }

                                    TapHandler {
                                        onTapped: osszegzes.modosit(model.title)
                                    }
                                }
                            }

                            Text {
                                Layout.fillWidth: true
                                text: model.message
                                textFormat: Text.RichText
                                wrapMode: Text.WordWrap
                                color: Stilus.szoveg
                                font.family: Stilus.font
                                font.pixelSize: 13
                                lineHeight: 1.2
                            }
                        }
                    }
                }
            }

            Rectangle {
                visible: osszegzes.lemezTorles
                Layout.fillWidth: true
                implicitHeight: figyelmeztetes.implicitHeight + 28
                color: Stilus.sargaPanel
                border.width: 1
                border.color: Stilus.sarga

                RowLayout {
                    id: figyelmeztetes
                    x: 18
                    y: 14
                    width: parent.width - 36
                    spacing: 12

                    Canvas {
                        Layout.preferredWidth: 20
                        Layout.preferredHeight: 20
                        Layout.alignment: Qt.AlignTop
                        onPaint: {
                            var c = getContext("2d")
                            c.reset()
                            c.strokeStyle = Stilus.sarga
                            c.lineWidth = 2
                            c.beginPath()
                            c.moveTo(10, 2)
                            c.lineTo(19, 18)
                            c.lineTo(1, 18)
                            c.closePath()
                            c.moveTo(10, 8)
                            c.lineTo(10, 12)
                            c.moveTo(10, 14.5)
                            c.lineTo(10, 15.5)
                            c.stroke()
                        }
                    }

                    Text {
                        Layout.fillWidth: true
                        text: qsTr("All data on the selected disk will be permanently erased. This cannot be undone after you press Install.")
                        wrapMode: Text.WordWrap
                        color: Stilus.sargaSzoveg
                        font.family: Stilus.font
                        font.pixelSize: 14
                        lineHeight: 1.2
                    }
                }
            }
        }
    }
}