Warning, /education/kstars/kstars/kstarslite/qml/modules/SkyMapLiteWrapper.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-FileCopyrightText: 2016 Artem Fedoskin <afedoskin3@gmail.com>
0002 // SPDX-License-Identifier: GPL-2.0-or-later
0003
0004 import QtQuick 2.6
0005 import QtQuick.Controls 2.0
0006
0007 import "../constants" 1.0
0008 import "helpers"
0009 import "tutorial"
0010
0011 Item {
0012 id: skyMapLiteItem
0013 visible: isLoaded
0014 property alias notification: notification
0015
0016 Rectangle {
0017 id: skyMapLiteWrapper
0018 objectName: "skyMapLiteWrapper"
0019 width: parent.width
0020 height: parent.height
0021 color: KStarsLite.getColor("SkyColor")
0022
0023 Connections {
0024 target: colorSchemePopup
0025 onColorSchemeChanged: {
0026 skyMapLiteWrapper.color = KStarsLite.getColor("SkyColor")
0027 }
0028 }
0029
0030 Connections {
0031 target: stackView
0032 onCurrentItemChanged: {
0033 if(stackView.currentItem != initPage) {
0034 //Workaround to make animation on push from / and pop to initPage faster
0035 //skyMapLiteWrapper.anchors.fill = null
0036 skyMapLiteWrapper.width = 0
0037 skyMapLiteWrapper.height = 0
0038 skyMapLite.visible = false
0039 }
0040 }
0041 onBusyChanged: {
0042 if(stackView.currentItem == initPage) {
0043 skyMapLite.visible = true
0044 skyMapLiteWrapper.width = Qt.binding(function() {return skyMapLite.width})
0045 skyMapLiteWrapper.height = Qt.binding(function() {return skyMapLite.height})
0046 }
0047 }
0048 }
0049
0050 Button {
0051 z: 1
0052 visible: SkyMapLite.centerLocked
0053 anchors {
0054 right: parent.right
0055 top: parent.top
0056 margins: 25
0057 }
0058 onClicked: {
0059 SkyMapLite.centerLocked = false
0060 }
0061 onPressedChanged: {
0062 if(pressed)
0063 lockBG.color = "#D40000"
0064 else
0065 lockBG.color = "red"
0066 }
0067
0068 background: Rectangle {
0069 id: lockBG
0070 color: "red"
0071 implicitWidth: 100
0072 implicitHeight: 70
0073 radius: 4
0074 border.width: 3
0075 border.color: "#AA0000"
0076 }
0077
0078 Image {
0079 source: "../images/lock-closed.png"
0080 anchors.centerIn: parent
0081 }
0082 }
0083
0084 Button {
0085 z: 1
0086 id: exitAutomaticMode
0087 visible: SkyMapLite.automaticMode
0088 anchors {
0089 left: parent.left
0090 top: parent.top
0091 margins: 25
0092 }
0093
0094 Image {
0095 source: "../images/back.png"
0096 anchors.centerIn: parent
0097 }
0098
0099 onClicked: {
0100 SkyMapLite.automaticMode = false
0101 }
0102 }
0103
0104 /** Circle that appears after user taps on screen **/
0105 Rectangle {
0106 id: tapCircle
0107 z: 1
0108 width: 20 * Num.dp
0109 radius: width*0.5
0110 height: width
0111 color: "grey"
0112 opacity: 0
0113
0114 Connections {
0115 target: SkyMapLite
0116 onPosClicked: {
0117 tapCircle.x = pos.x - tapCircle.width * 0.5
0118 tapCircle.y = pos.y - tapCircle.height * 0.5
0119 tapAnimation.start()
0120 }
0121 onPointLiteChanged: {
0122 contextMenu.openPoint()
0123 }
0124
0125 onObjectLiteChanged: {
0126 contextMenu.openObject()
0127 }
0128 }
0129
0130 SequentialAnimation on opacity {
0131 id: tapAnimation
0132 OpacityAnimator { from: 0; to: 0.8; duration: 100 }
0133 OpacityAnimator { from: 0.8; to: 0; duration: 400 }
0134 }
0135 }
0136 }
0137
0138 TopMenu {
0139 id: topMenu
0140 }
0141
0142 //Step 3 - Top Menu
0143 TutorialStep3 {
0144 anchors {
0145 top: topMenu.bottom
0146 }
0147 }
0148
0149 PassiveNotification {
0150 z: 2
0151 height: 10
0152 id: notification
0153 visible: true
0154 anchors {
0155 bottom: bottomMenu.top
0156 horizontalCenter: parent.horizontalCenter
0157 }
0158
0159 Connections {
0160 target: KStarsLite
0161 onNotificationMessage: {
0162 skyMapLite.notification.showNotification(msg)
0163 }
0164 }
0165 }
0166
0167 BottomMenu {
0168 id: bottomMenu
0169 }
0170
0171 //Step 4 - Bottom Menu
0172 TutorialStep4 {
0173 anchors{
0174 bottom: bottomMenu.top
0175 }
0176 }
0177 }