/**************************************************************************** ** ** Copyright (C) 2019 Luxoft Sweden AB ** Copyright (C) 2018 Pelagicore AG ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Neptune 3 UI. ** ** $QT_BEGIN_LICENSE:GPL-QTAS$ ** Commercial License Usage ** Licensees holding valid commercial Qt Automotive Suite licenses may use ** this file in accordance with the commercial license agreement provided ** with the Software or, alternatively, in accordance with the terms ** contained in a written agreement between you and The Qt Company. For ** licensing terms and conditions see https://www.qt.io/terms-conditions. ** For further information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 or (at your option) any later version ** approved by the KDE Free Qt Foundation. The licenses are as published by ** the Free Software Foundation and appearing in the file LICENSE.GPL3 ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ** SPDX-License-Identifier: GPL-3.0 ** ****************************************************************************/ import QtQuick 2.8 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import Qt.labs.calendar 1.0 import shared.animations 1.0 import shared.controls 1.0 import shared.utils 1.0 import "../stores" 1.0 import "../controls" 1.0 import "../panels" 1.0 import shared.Style 1.0 import shared.Sizes 1.0 import QtQuick3D 1.15 import QtQuick3D.Effects 1.15 import QtQuick3D.Materials 1.14 Item { id: root property CalendarStore store property bool bottomWidgetHide: false CalendarWidgetPanel { anchors.fill: parent state: root.state visible: root.state !== "Maximized" opacity: visible ? 1.0 : 0.0 Behavior on opacity { DefaultNumberAnimation { } } // Generate random number to get contents from calendar model. property int randomIndex: Math.floor((Math.random() * root.store.eventModel.count) + 0) eventModel: root.store.eventModel } // Top content background // Image { // id: topContentBg // anchors.left: parent.left // anchors.right: parent.right // anchors.top: parent.top // height: Sizes.dp(436) // source: Style.image("app-fullscreen-top-bg") // visible: root.state === "Maximized" // } Rectangle { id: topContentBg anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top height: Sizes.dp(436) visible: root.state === "Maximized" color:"pink" View3D { id: view3D anchors.centerIn: parent anchors.fill: parent environment: sceneEnvironment camera: camera SceneEnvironment { id: sceneEnvironment antialiasingMode: SceneEnvironment.MSAA antialiasingQuality: SceneEnvironment.High } Node { id: scene DirectionalLight { id: directionalLight x: 493.693 y: 798.913 visible: true eulerRotation.z: -83.93905 eulerRotation.y: -26.26826 eulerRotation.x: -54.4926 brightness: 198 z: 793.45105 } PerspectiveCamera { id: camera x: -2832.216 y: 3944.701 clipFar: 100000 clipNear: 10 fieldOfViewOrientation: PerspectiveCamera.Horizontal eulerRotation.z: -0 eulerRotation.y: -26.06882 eulerRotation.x: -20.28238 scale.z: 1 scale.y: 1 scale.x: 1 fieldOfView: 65 z: 6487.06689 } Node{ Model { id: cone x: 1659.88 y: 136.321 visible: true source: "#Cone" scale.z: 3.8 scale.x: 3.3 scale.y: 7 eulerRotation.y: 20 eulerRotation.x: 270 castsShadows: true z: 824.27551 materials: lightsMaterial DefaultMaterial { id: lightsMaterial lighting: DefaultMaterial.FragmentLighting blendMode: DefaultMaterial.Screen diffuseMap: lightsMap diffuseColor: Style.contrastColor diffuseLightWrap: 0 vertexColorsEnabled: false specularTint: Style.mainColor emissiveFactor: 1 emissiveColor: Style.contrastColor Texture { id: lightsMap source: "../assets/icon_cloudy.png" } } } Model{ id:cube scale.z: 4 scale.y: 4 scale.x: 4 visible: true source:"#Cube" materials: defaultMaterial DefaultMaterial { id: defaultMaterial vertexColorsEnabled: true blendMode: DefaultMaterial.SourceOver lighting: DefaultMaterial.FragmentLighting emissiveFactor: 0.25 diffuseMap: tirePressureLabelBg //diffuseColor: "#ffffff" emissiveMap: tirePressureLabelBg Texture{ id:tirePressureLabelBg sourceItem: Rectangle { id: pressLabel visible:true width: 900 height: 450 border.width: 0 gradient: Gradient { GradientStop { position: 0 color: "#ac7786" } GradientStop { position: 1 color: "#9772a0" } } Text { id: pressuretext color: "#f0f0f0" text: "2.5 bar" anchors.verticalCenter: parent.verticalCenter font.pixelSize: 64 horizontalAlignment: Text.AlignHCenter anchors.horizontalCenter: parent.horizontalCenter font.weight: Font.Medium font.family: Constants.font.family } } } } } } } } } TopCalendarPanel { id: calendarOnTop anchors { top: topContentBg.top topMargin: Sizes.dp(80) left: topContentBg.left leftMargin: Sizes.dp(135) right: topContentBg.right rightMargin: Sizes.dp(135) bottom: topContentBg.bottom bottomMargin: Sizes.dp(40) } visible: root.state === "Maximized" } Item { id: mainControl anchors.left: parent.left anchors.right: parent.right anchors.top: calendarOnTop.bottom anchors.topMargin: Sizes.dp(64) anchors.bottom: root.bottom visible: root.state === "Maximized" Item { anchors.left: parent.left width: Sizes.dp(264) anchors.top: parent.top anchors.bottom: parent.bottom ToolsColumn { id: toolsColumn anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: Sizes.dp(53) translationContext: "CalendarToolsColumn" model: ListModel { id: toolsColumnModel ListElement { icon: "ic-calendar"; text: QT_TRANSLATE_NOOP("CalendarToolsColumn", "year"); objectName: "yearViewButton" } ListElement { icon: "ic-calendar"; text: QT_TRANSLATE_NOOP("CalendarToolsColumn", "next"); objectName: "nextViewButton" } ListElement { icon: "ic-calendar"; text: QT_TRANSLATE_NOOP("CalendarToolsColumn", "events"); objectName: "eventsViewButton" } } } } StackLayout { objectName: "calendarViewContent" anchors.top: parent.top anchors.topMargin: Sizes.dp(53) anchors.right: parent.right anchors.rightMargin: Sizes.dp(96) anchors.bottom: parent.bottom width: Sizes.dp(720) currentIndex: toolsColumn.currentIndex CalendarGridPanel { objectName: "calendarGridPanel" } NextCalendarPanel { objectName: "nextCalendarPanel" eventModel: root.store.eventModel } EventList { objectName: "eventList" model: root.store.eventModel } } } }