@ -7,6 +7,9 @@
*
* /
import io . calamares . core 1.0
import io . calamares . ui 1.0
import QtQuick 2.10
import QtQuick . Controls 2.10
import QtQuick . Window 2.14
@ -14,43 +17,200 @@ import QtQuick.Layouts 1.3
import org . kde . kirigami 2.7 as Kirigami
Column {
width: parent . width
Page {
width: 800 / / p a r e n t . w i d t h
height: 500
/ / N e e d s t o c o m e f r o m l o c a l e q . c o n f
property var configTimezone: "America/New York"
StackView {
id: stack
anchors.fill: parent
clip: true
Rectangle {
width: parent . width
height: parent . height / 1.28
initialItem: Item {
Image {
id: image
anchors.fill: parent
source: "img/worldmap.png"
width: parent . width
Label {
id: region
anchors.horizontalCenter: parent . horizontalCenter
color: Kirigami . Theme . textColor
horizontalAlignment: Text . AlignCenter
text: qsTr ( "Select your preferred Region, or use the default one based on your current location." )
}
ListView {
id: list
ScrollBar.vertical: ScrollBar {
active: true
}
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
}
/ / m o d e l l o a d s , d o z e n s o f v a r i a t i o n s t r i e d f o r c u r r e n t I n d e x a l l f a i l
model: config . regionModel
currentIndex: config . currentIndex
delegate: ItemDelegate {
hoverEnabled: true
width: parent . width
highlighted: ListView . isCurrentItem
Label {
text: name
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" / / K i r i g a m i . T h e m e . b a c k g r o u n d C o l o r
opacity: highlighted || hovered ? 0.5 : 0.3
}
}
onClicked: {
list . model . currentIndex = index
/ / c o r r e c t t o u s e c o n f i g . c u r r e n t T i m e z o n e N a m e w h e n i n d e x i s u p d a t e d ?
tztext . text = qsTr ( "Timezone: %1" ) . arg ( config . currentTimezoneName )
stack . push ( zoneView )
}
}
}
}
Component {
id: zoneView
Item {
Label {
id: zone
anchors.horizontalCenter: parent . horizontalCenter
color: Kirigami . Theme . textColor
text: qsTr ( "Select your preferred Zone within your Region." )
}
ListView {
id: list2
ScrollBar.vertical: ScrollBar {
active: true
}
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
}
/ / m o d e l l o a d s , d o z e n s o f v a r i a t i o n s t r i e d f o r c u r r e n t I n d e x a l l f a i l
model: config . regionalZonesModel
currentIndex: config . currentIndex
delegate: ItemDelegate {
hoverEnabled: true
width: parent . width
highlighted: ListView . isCurrentItem
Label {
text: name
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" / / K i r i g a m i . T h e m e . b a c k g r o u n d C o l o r
opacity: highlighted || hovered ? 0.5 : 0.3
}
}
onClicked: {
list2 . model . currentIndex = index
list2 . positionViewAtIndex ( index , ListView . Center )
/ / c o r r e c t t o u s e c o n f i g . c u r r e n t T i m e z o n e N a m e w h e n i n d e x i s u p d a t e d ?
tztext . text = qsTr ( "Timezone: %1" ) . arg ( config . currentTimezoneName )
}
}
}
Button {
Layout.fillWidth: true
anchors.verticalCenter: parent . verticalCenter
anchors.verticalCenterOffset: - 30
anchors.left: parent . left
anchors.leftMargin: parent . width / 15
icon.name: "go-previous"
text: qsTr ( "Zones" )
onClicked: stack . pop ( )
}
}
}
}
Rectangle {
width: parent . width
height: 100
height: 6 0
anchors.horizontalCenter: parent . horizontalCenter
anchors.bottom: parent . bottom
Item {
id: location
Kirigami.Theme.inherit: false
Kirigami.Theme.colorSet: Kirigami . Theme . Complementary
anchors.horizontalCenter: parent . horizontalCenter
Rectangle {
anchors.centerIn: parent
width: 300
height: 30
color: Kirigami . Theme . backgroundColor
Text {
text: qsTr ( "Timezone: %1" ) . arg ( configTimezone )
id: tztext
text: qsTr ( "Timezone: %1" ) . arg ( config . currentTimezoneName )
color: Kirigami . Theme . textColor
anchors.centerIn: parent
}
@ -58,6 +218,7 @@ Column {
}
Text {
anchors.top: location . bottom
anchors.topMargin: 20
padding: 10
@ -65,7 +226,7 @@ Column {
wrapMode: Text . WordWrap
horizontalAlignment: Text . AlignHCenter
Kirigami.Theme.backgroundColor: Kirigami . Theme . backgroundColor
text: qsTr ( " To be able to select a timezone, make sure you are connected to the internet. Restart the installer after connecting. You can fine-tune Language and Locale settings below.")
text: qsTr ( " You can fine-tune Language and Locale settings below.")
}
}
}