Warning, /plasma-bigscreen/calamares-bigscreen-branding/bigscreen/localeq.qml is written in an unsupported language. File is not indexed.

0001 /* === This file is part of Calamares - <https://calamares.io> ===
0002  *
0003  *   SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
0004  *   SPDX-FileCopyrightText: 2020 Anke Boersma <demm@kaosx.us>
0005  *   SPDX-FileCopyrightText: 2022 Aditya Mehra <aix.m@outlook.com>
0006  *   SPDX-License-Identifier: GPL-3.0-or-later
0007  *
0008  *   Calamares is Free Software: see the License-Identifier above.
0009  *
0010  */
0011 
0012 import io.calamares.core 1.0
0013 import io.calamares.ui 1.0
0014 
0015 import QtQuick 2.10
0016 import QtQuick.Controls 2.10
0017 import QtQuick.Layouts 1.3
0018 import org.kde.kirigami 2.7 as Kirigami
0019 import QtQuick.Window 2.3
0020 
0021 import Libfakeqevents 1.0
0022 
0023 import Libfakeqevents 1.0 as LQ
0024 
0025 Page {
0026     id: localPage
0027     readonly property color backgroundColor: Branding.styleString(Branding.SidebarBackground)
0028     readonly property color listBackgroundColor: Branding.styleString(Branding.SidebarBackground)
0029     readonly property color textFieldColor: Branding.styleString(Branding.SidebarText)
0030     readonly property color textFieldBackgroundColor: Branding.styleString(Branding.SidebarBackground)
0031     readonly property color textColor: Branding.styleString(Branding.SidebarText)
0032     readonly property color highlightedTextColor: Branding.styleString(Branding.SidebarText)
0033     readonly property color highlightColor: Kirigami.Theme.highlightColor
0034     readonly property color accentColor: Branding.styleString(Branding.SidebarTextHighlight)
0035 
0036     function onActivate(){
0037         navigationHelper.activePage = "localPage"
0038         fakeCursor.moveMouseEvent(mainContentArea.x + 10, 400)
0039         delay(1000, function() {
0040             console.log("LocaleQ: I'm printed after 1 second!")
0041             fakeCursor.mouseClickEvent()
0042         })
0043     }
0044 
0045     // Helper Items For Fake Focus Event
0046     LQ.EmulatedMouse {
0047         id: fakeCursor
0048     }
0049 
0050     Timer {
0051         id: timer
0052     }
0053 
0054     function delay(delayTime, cb) {
0055         timer.interval = delayTime;
0056         timer.repeat = false;
0057         timer.triggered.connect(cb);
0058         timer.start();
0059     }
0060 
0061 
0062     Item {
0063         id: leftSideBar
0064         width: parent.width * 0.15
0065         anchors.top: parent.top
0066         anchors.bottom: navigationBarArea.top
0067 
0068         Kirigami.Separator {
0069             id: leftSideBarLine
0070             anchors.right: parent.right
0071             height: parent.height
0072             width: 1
0073         }
0074 
0075         ProgressionBarVertical {
0076             id: installProgressBar
0077             anchors.left: parent.left
0078             anchors.right: leftSideBarLine.left
0079             anchors.top: parent.top
0080             anchors.bottom: parent.bottom
0081         }
0082     }
0083 
0084     MouseArea {
0085         id: mainContentArea
0086         anchors.left: leftSideBar.right
0087         anchors.right: rightSideBar.left
0088         anchors.leftMargin: Kirigami.Units.smallSpacing
0089         anchors.rightMargin: Kirigami.Units.smallSpacing
0090 
0091         anchors.top: parent.top
0092         anchors.bottom: navigationBarArea.top
0093 
0094         onClicked: {
0095             localStackContainer.forceActiveFocus()
0096         }
0097 
0098         ColumnLayout {
0099             id: mainContentColumnLayout
0100             width: parent.width
0101             height: parent.height
0102 
0103             Rectangle {
0104                 id: localStackContainer
0105                 objectName: "localStackContainer"
0106                 Layout.fillWidth: true
0107                 Layout.fillHeight: true
0108                 focus: true
0109 
0110                 radius: 4
0111                 border.width: localStackContainer.activeFocus ? 3 : 1
0112                 border.color: localStackContainer.activeFocus ? accentColor : Qt.lighter(Kirigami.Theme.backgroundColor, 1.5)
0113                 color: Kirigami.Theme.backgroundColor
0114 
0115                 Keys.onReturnPressed: {
0116                     offlineView.forceActiveFocus()
0117                 }
0118 
0119                 Keys.onDownPressed: {
0120                     console.log("down pressed")
0121                     adjustSettingsButton.forceActiveFocus()
0122                 }
0123 
0124                 onActiveFocusChanged: {
0125                     if(activeFocus) {
0126                         navigationHelper.activeFocusedElement = objectName
0127                     }
0128                 }
0129 
0130                 Offline {
0131                     id: offlineView
0132                     anchors.fill: parent
0133                     anchors.margins: 8
0134                 }
0135             }
0136 
0137             Rectangle {
0138                 Layout.fillWidth: true
0139                 Layout.preferredHeight: Kirigami.Units.gridUnit * 3
0140                 color: "#ff212121"
0141                 radius: 4
0142 
0143                 RowLayout {
0144                     anchors.fill: parent
0145                     anchors.margins: Kirigami.Units.largeSpacing
0146                     spacing: Kirigami.Units.largeSpacing
0147 
0148                     Rectangle {
0149                         Layout.preferredWidth: Kirigami.Units.gridUnit * 12
0150                         Layout.fillHeight: true
0151                         radius: 6
0152                         color: accentColor
0153 
0154                         Text {
0155                             id: tztext
0156                             font.pixelSize: parent.height * 0.35
0157                             width: parent.width
0158                             height: parent.height
0159                             horizontalAlignment: Text.AlignHCenter
0160                             verticalAlignment: Text.AlignVCenter
0161                             text: qsTr("Timezone: %1").arg(config.currentTimezoneName)
0162                             color: Branding.styleString(Branding.SidebarText)
0163                         }
0164                     }
0165 
0166                     Text {
0167                         font.pixelSize: parent.height * 0.40
0168                         Layout.fillWidth: true
0169                         Layout.fillHeight: true
0170                         wrapMode: Text.WordWrap
0171                         horizontalAlignment: Text.AlignLeft
0172                         verticalAlignment: Text.AlignVCenter
0173                         color: Branding.styleString(Branding.SidebarText)
0174                         text: qsTr("Fine-Tune Language and Locale Settings")
0175                     }
0176                 }
0177             }
0178 
0179             Rectangle {
0180                 id: manualLocalControlArea
0181                 Layout.fillWidth: true
0182                 Layout.preferredHeight: Kirigami.Units.gridUnit * 6
0183                 color: "#ff212121"
0184 
0185                 ColumnLayout {
0186                     anchors.fill: parent
0187                     anchors.margins: Kirigami.Units.largeSpacing
0188                     
0189                     Label {
0190                         Layout.fillWidth: true
0191                         Layout.fillHeight: true
0192                         wrapMode: Text.WordWrap
0193                         text: config.currentLanguageStatus
0194                         font.pixelSize: 45
0195                         fontSizeMode: Text.Fit
0196                         minimumPixelSize: 10
0197                         color: Branding.styleString(Branding.SidebarText)
0198                     }
0199                     Kirigami.Separator {
0200                         Layout.fillWidth: true
0201                         Layout.preferredHeight: 1
0202                     }
0203                     Label {
0204                         Layout.fillWidth: true
0205                         Layout.fillHeight: true
0206                         wrapMode: Text.WordWrap
0207                         text: config.currentLCStatus
0208                         font.pixelSize: 45
0209                         fontSizeMode: Text.Fit
0210                         minimumPixelSize: 10
0211                         color: Branding.styleString(Branding.SidebarText)
0212                     }
0213 
0214                     Rectangle {
0215                         Layout.fillWidth: true
0216                         Layout.preferredHeight: Kirigami.Units.gridUnit * 2
0217                         color: adjustSettingsButton.activeFocus ? accentColor : "#ff212121"
0218                         radius: 3
0219 
0220                         Button {
0221                             id: adjustSettingsButton
0222                             anchors.fill: parent
0223                             anchors.margins: 3
0224                             objectName: "adjustSettingsButton"
0225 
0226                             KeyNavigation.up: localStackContainer
0227                             Keys.onDownPressed: {
0228                                 customNavBar.forceActiveFocus()
0229                             }
0230 
0231                             onActiveFocusChanged: {
0232                                 if(activeFocus) {
0233                                     navigationHelper.activeFocusedElement = objectName
0234                                 }
0235                             }
0236 
0237                             text: qsTr("Adjust Settings")
0238                             onClicked: {
0239                                 onClicked: load.source = "i18n.qml"
0240                             }
0241                         }
0242                     }
0243                 }
0244             }
0245         }
0246     }
0247 
0248     Item {
0249         id: rightSideBar
0250         width: parent.width * 0.15
0251         anchors.top: parent.top
0252         anchors.bottom: navigationBarArea.top
0253         anchors.right: parent.right
0254 
0255         Kirigami.Separator {
0256             id: rightSideBarLine
0257             anchors.left: parent.left
0258             height: parent.height
0259             width: 1
0260         }
0261 
0262         NavigationHelper {
0263             id: navigationHelper
0264             anchors.top: parent.top
0265             anchors.bottom: parent.bottom
0266             anchors.left: rightSideBarLine.right
0267             anchors.leftMargin: 1
0268             anchors.right: parent.right
0269         }
0270     }
0271 
0272     Item {
0273         id: navigationBarArea
0274         width: parent.width
0275         height: Kirigami.Units.gridUnit * 3
0276         anchors.bottom: parent.bottom
0277         
0278         Kirigami.Separator {
0279             id: navigationBarAreaLine
0280             anchors.top: parent.top
0281             width: parent.width
0282             height: 1
0283         }
0284 
0285         CustomNavigationBar {
0286             id: customNavBar
0287             width: parent.width
0288             anchors.top: navigationBarAreaLine.bottom
0289             anchors.bottom: parent.bottom
0290             navigationReturnComponent: adjustSettingsButton
0291             navHelper: navigationHelper
0292         }
0293     }
0294 }