2020-08-26 13:32:56 +02:00
|
|
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
|
|
|
*
|
|
|
|
* SPDX-FileCopyrightText: 2020 Anke Boersma <demm@kaosx.us>
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*
|
|
|
|
* Calamares is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Calamares is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import io.calamares.core 1.0
|
2020-03-25 16:08:12 +01:00
|
|
|
import io.calamares.ui 1.0
|
|
|
|
|
|
|
|
import QtQuick 2.10
|
|
|
|
import QtQuick.Controls 2.10
|
2020-08-26 13:32:56 +02:00
|
|
|
import QtQuick.Window 2.14
|
2020-03-25 16:08:12 +01:00
|
|
|
import QtQuick.Layouts 1.3
|
2020-08-26 13:32:56 +02:00
|
|
|
|
2020-03-25 16:08:12 +01:00
|
|
|
import org.kde.kirigami 2.7 as Kirigami
|
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
Page {
|
|
|
|
width: 800 //parent.width
|
|
|
|
height: 500
|
2020-03-25 16:08:12 +01:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
StackView {
|
|
|
|
id: stack
|
|
|
|
anchors.fill: parent
|
|
|
|
clip: true
|
2020-03-25 16:08:12 +01:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
initialItem: Item {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
Label {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
id: header
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
text: qsTr("Keyboard Model")
|
|
|
|
color: Kirigami.Theme.textColor
|
|
|
|
font.bold: true
|
|
|
|
font.weight: Font.Bold
|
|
|
|
font.pointSize: 24
|
|
|
|
}
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
Label {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.top: header.bottom
|
|
|
|
color: Kirigami.Theme.textColor
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
width: parent.width / 1.5
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
text: qsTr("Click your preferred keyboard model to select layout and variant, or use the default one based on the detected hardware.")
|
|
|
|
}
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
ListView {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
id: list1
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
ScrollBar.vertical: ScrollBar {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
active: true
|
|
|
|
}
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
width: parent.width / 2
|
|
|
|
height: 250
|
|
|
|
anchors.centerIn: parent
|
|
|
|
anchors.verticalCenterOffset: -30
|
|
|
|
focus: true
|
|
|
|
clip: true
|
|
|
|
boundsBehavior: Flickable.StopAtBounds
|
|
|
|
spacing: 2
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
Rectangle {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
z: parent.z - 1
|
|
|
|
anchors.fill: parent
|
|
|
|
color: "#BDC3C7"
|
|
|
|
radius: 5
|
|
|
|
opacity: 0.7
|
2020-06-19 17:05:29 +02:00
|
|
|
}
|
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
model: config.keyboardModelsModel
|
|
|
|
//model: ["Africa", "America", "Antarctica", "Arctic", "Asia", "Atlantic", "Australia", "Europe", "Indian", "Pacific"]
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
currentIndex: model.currentIndex
|
|
|
|
delegate: ItemDelegate {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
hoverEnabled: true
|
|
|
|
width: parent.width
|
|
|
|
highlighted: ListView.isCurrentItem
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
RowLayout {
|
|
|
|
anchors.fill: parent
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
Label {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
text: model.label // modelData
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
width: parent.width
|
|
|
|
height: 32
|
|
|
|
color: highlighted ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
|
|
|
|
color: highlighted || hovered ? Kirigami.Theme.highlightColor : "white" //Kirigami.Theme.backgroundColor
|
|
|
|
opacity: highlighted || hovered ? 0.5 : 0.3
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Kirigami.Icon {
|
|
|
|
|
|
|
|
source: "checkmark"
|
|
|
|
Layout.preferredWidth: 22
|
|
|
|
Layout.preferredHeight: 22
|
|
|
|
color: Kirigami.Theme.highlightedTextColor
|
|
|
|
visible: highlighted
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
|
|
|
list1.model.currentIndex = index
|
|
|
|
stack.push(layoutsList)
|
|
|
|
list1.positionViewAtIndex(index, ListView.Center)
|
|
|
|
}
|
|
|
|
}
|
2020-06-19 17:05:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
Component {
|
|
|
|
id: layoutsList
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
Item {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
Label {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
id: header
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
text: qsTr("Keyboard Layout")
|
|
|
|
color: Kirigami.Theme.textColor
|
|
|
|
font.bold: true
|
|
|
|
font.weight: Font.Bold
|
|
|
|
font.pointSize: 24
|
|
|
|
}
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
Label {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.top: header.bottom
|
|
|
|
color: Kirigami.Theme.textColor
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
width: parent.width / 1.5
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
text: config.prettyStatus
|
|
|
|
//text: qsTr("Set keyboard model or use the default one based on the detected hardware.")
|
|
|
|
}
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
ListView {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
id: list2
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
ScrollBar.vertical: ScrollBar {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
active: true
|
|
|
|
}
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
width: parent.width / 2
|
|
|
|
height: 250
|
|
|
|
anchors.centerIn: parent
|
|
|
|
anchors.verticalCenterOffset: -30
|
|
|
|
focus: true
|
|
|
|
clip: true
|
|
|
|
boundsBehavior: Flickable.StopAtBounds
|
|
|
|
spacing: 2
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
|
|
|
z: parent.z - 1
|
|
|
|
anchors.fill: parent
|
|
|
|
color: "#BDC3C7"
|
|
|
|
radius: 5
|
|
|
|
opacity: 0.7
|
|
|
|
}
|
|
|
|
|
|
|
|
model: config.keyboardLayoutsModel
|
|
|
|
//model: ["Brussels", "London", "Madrid", "New York", "Melbourne", "London", "Madrid", "New York", "Brussels", "London", "Madrid", "New York", "Brussels", "London", "Madrid", "New York"]
|
|
|
|
|
|
|
|
currentIndex: model.currentIndex
|
|
|
|
delegate: ItemDelegate {
|
|
|
|
|
|
|
|
hoverEnabled: true
|
|
|
|
width: parent.width
|
|
|
|
highlighted: ListView.isCurrentItem
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
|
|
|
text: model.label // modelData
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
width: parent.width
|
|
|
|
height: 30
|
|
|
|
color: highlighted ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
|
|
|
|
color: highlighted || hovered ? Kirigami.Theme.highlightColor : "white" //Kirigami.Theme.backgroundColor
|
|
|
|
opacity: highlighted || hovered ? 0.5 : 0.3
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Kirigami.Icon {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
source: "checkmark"
|
|
|
|
Layout.preferredWidth: 22
|
|
|
|
Layout.preferredHeight: 22
|
|
|
|
color: Kirigami.Theme.highlightedTextColor
|
|
|
|
visible: highlighted
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
|
|
|
list2.model.currentIndex = index
|
|
|
|
stack.push(variantsList)
|
|
|
|
list2.positionViewAtIndex(index, ListView.Center)
|
|
|
|
}
|
2020-06-19 17:05:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
ColumnLayout {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
spacing: 2
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.verticalCenterOffset: -30
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: parent.width / 15
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
Button {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
icon.name: "go-previous"
|
|
|
|
text: qsTr("Models")
|
|
|
|
onClicked: stack.pop()
|
|
|
|
}
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
Button {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
icon.name: "go-next"
|
|
|
|
text: qsTr("Variants")
|
|
|
|
onClicked: stack.push(variantsList)
|
|
|
|
}
|
2020-06-19 17:05:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
Component {
|
|
|
|
id: variantsList
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
Item {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
Label {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
id: header
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
text: qsTr("Keyboard Variant")
|
|
|
|
color: Kirigami.Theme.textColor
|
|
|
|
font.bold: true
|
|
|
|
font.weight: Font.Bold
|
|
|
|
font.pointSize: 24
|
|
|
|
}
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
Label {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.top: header.bottom
|
|
|
|
color: Kirigami.Theme.textColor
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
width: parent.width / 1.5
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
text: config.prettyStatus
|
|
|
|
//text: qsTr("Variant keyboard model or use the default one based on the detected hardware.")
|
|
|
|
}
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
ListView {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
id: list3
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
ScrollBar.vertical: ScrollBar {
|
|
|
|
|
|
|
|
active: true
|
|
|
|
}
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
width: parent.width / 2
|
|
|
|
height: 250
|
|
|
|
anchors.centerIn: parent
|
|
|
|
anchors.verticalCenterOffset: -30
|
|
|
|
focus: true
|
|
|
|
clip: true
|
|
|
|
boundsBehavior: Flickable.StopAtBounds
|
|
|
|
spacing: 2
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
|
|
|
z: parent.z - 1
|
|
|
|
anchors.fill: parent
|
|
|
|
color: "#BDC3C7"
|
|
|
|
radius: 5
|
|
|
|
opacity: 0.7
|
|
|
|
}
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
model: config.keyboardVariantsModel
|
|
|
|
//model: ["Brussels", "London", "Madrid", "New York", "Melbourne", "London", "Madrid", "New York", "Brussels", "London", "Madrid", "New York", "Brussels", "London", "Madrid", "New York"]
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
currentIndex: model.currentIndex
|
|
|
|
delegate: ItemDelegate {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
hoverEnabled: true
|
|
|
|
width: parent.width
|
|
|
|
highlighted: ListView.isCurrentItem
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
|
|
|
text: model.label //modelData
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
width: parent.width
|
|
|
|
height: 30
|
|
|
|
color: highlighted ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
background: Rectangle {
|
2020-06-19 17:05:29 +02:00
|
|
|
|
2020-08-26 13:32:56 +02:00
|
|
|
color: highlighted || hovered ? Kirigami.Theme.highlightColor : "white" //Kirigami.Theme.backgroundColor
|
|
|
|
opacity: highlighted || hovered ? 0.5 : 0.3
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Kirigami.Icon {
|
|
|
|
|
|
|
|
source: "checkmark"
|
|
|
|
Layout.preferredWidth: 22
|
|
|
|
Layout.preferredHeight: 22
|
|
|
|
color: Kirigami.Theme.highlightedTextColor
|
|
|
|
visible: highlighted
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
|
|
|
list3.model.currentIndex = index
|
|
|
|
list3.positionViewAtIndex(index, ListView.Center)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-19 17:05:29 +02:00
|
|
|
Button {
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
2020-08-26 13:32:56 +02:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.verticalCenterOffset: -30
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: parent.width / 15
|
2020-06-19 17:05:29 +02:00
|
|
|
icon.name: "go-previous"
|
2020-08-26 13:32:56 +02:00
|
|
|
text: qsTr("Layouts")
|
|
|
|
onClicked: stack.pop()
|
2020-06-19 17:05:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
TextField {
|
|
|
|
|
|
|
|
placeholderText: qsTr("Test your keyboard")
|
2020-08-26 13:32:56 +02:00
|
|
|
height: 48
|
|
|
|
width: parent.width / 1.5
|
|
|
|
horizontalAlignment: TextInput.AlignHCenter
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: parent.height / 10
|
|
|
|
color: "#1F1F1F"
|
2020-06-19 17:05:29 +02:00
|
|
|
|
|
|
|
background:Rectangle {
|
|
|
|
|
|
|
|
z: parent.z - 1
|
|
|
|
anchors.fill: parent
|
2020-07-25 17:18:28 +02:00
|
|
|
color: "#BDC3C7"
|
2020-08-26 13:32:56 +02:00
|
|
|
radius: 2
|
2020-07-25 17:18:28 +02:00
|
|
|
opacity: 0.3
|
2020-06-19 17:05:29 +02:00
|
|
|
}
|
|
|
|
}
|
2020-03-25 16:08:12 +01:00
|
|
|
}
|