// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
/*
This is a UI file (.ui.qml) that is intended to be edited in Qt Design Studio only.
It is supposed to be strictly declarative and only uses a subset of QML. If you edit
this file manually, you might introduce QML code that is not supported by Qt Design Studio.
Check out https://doc.qt.io/qtcreator/creator-quick-ui-forms.html for details on .ui.qml files.
*/
import QtQuick
import QtQuick.Controls.Basic
import QtQuick.Layouts
import Thermostat
import ThermostatCustomControls
Pane {
id: root
property int currentRoomIndex: 0
required property list<Room> roomsList
property string currentDate
property list<int> selectedHours: [0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
property list<int> selectedDays: [0,0,0,0,0,0,0]
property int currentMode: 2
property int currentTemp: 10
background: Rectangle {
anchors.fill: parent
color: Constants.backgroundColor
}
Column {
id: title
width: parent.width
Label {
id: header
text: qsTr("Time Schedule")
font.pixelSize: 48
font.weight: 600
font.family: "Titillium Web"
color: Constants.primaryTextColor
elide: Text.ElideRight
RowLayout {
id: label
text: qsTr("Adjust a timer for specific room temperature")
font.pixelSize: 24
color: Constants.accentTextColor
Layout.fillWidth: true
CustomComboBox {
id: customComboBox
roomsList: root.roomsList
currentIndex: root.currentRoomIndex
Connections {
function onCurrentIndexChanged() {
root.currentRoomIndex = customComboBox.currentIndex
ScheduleStackView {
id: scrollView
scheduleViewRoot: root
anchors.top: title.bottom
anchors.topMargin: 12
anchors.leftMargin: 28
width: internal.contentWidth
height: internal.contentHeight
currentRoomIndex: root.currentRoomIndex
ScheduleSwipeView {
id: swipeView
visible: false
function onCurrentRoomIndexChanged() {
root.currentRoomIndex = swipeView.currentRoomIndex
QtObject {
id: internal
readonly property int contentHeight: root.height - title.height
- root.topPadding - root.bottomPadding
readonly property int contentWidth: root.width - root.rightPadding - root.leftPadding
states: [
State {
name: "desktopLayout"
when: Constants.isBigDesktopLayout || Constants.isSmallDesktopLayout
PropertyChanges {
target: root
leftPadding: 20
target: header
visible: true
target: label
target: scrollView
target: swipeView
},
name: "mobileLayout"
when: Constants.isMobileLayout
leftPadding: 16
rightPadding: 16
name: "smallLayout"
when: Constants.isSmallLayout
leftPadding: 15
rightPadding: 15
]