-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.qml
106 lines (90 loc) · 1.95 KB
/
main.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.VirtualKeyboard 2.4
import QtQuick.Controls.Material 2.12
import "qml/forms"
import "qml/components"
import "qml/fonts/font-awesome"
ApplicationWindow {
id: window
width: 600
height: 1000
visible: true
title: qsTr("QML Weather App - Open Weather Map Widget")
property bool darkMode: true
property var accentColor
property var primaryColor
Material.theme: window.darkMode ? Material.Dark : Material.Light
Material.accent: window.accentColor
Material.primary: window.primaryColor
Component.onCompleted: {
OwmController.update();
}
property alias interactive: swipeView.interactive;
background: MaterialGradientBackground{ }
SwipeView {
id: swipeView
anchors.fill: parent
currentIndex: tabBar.currentIndex
PageLoader {
id: loaderCurrentWeather
active: Math.abs(swipeView.currentIndex - SwipeView.index) < 2;
CurrentWeather { }
}
PageLoader {
active: Math.abs(swipeView.currentIndex - SwipeView.index) < 2;
ForecastHourly { }
}
PageLoader {
active: Math.abs(swipeView.currentIndex - SwipeView.index) < 2;
ForecastWeek { }
}
PageLoader {
active: Math.abs(swipeView.currentIndex - SwipeView.index) < 2;
SettingsForm { }
}
}
footer: TabBar {
id: tabBar
currentIndex: swipeView.currentIndex
TabButton {
text: qsTr("Home")
}
TabButton {
text: qsTr("Today")
}
TabButton {
text: qsTr("Forecast")
}
TabButton {
text: qsTr("Settings")
}
}
InputPanel {
id: inputPanel
z: 99
x: 0
y: window.height
width: window.width
states: State {
name: "visible"
when: inputPanel.active
PropertyChanges {
target: inputPanel
y: window.height - inputPanel.height
}
}
transitions: Transition {
from: ""
to: "visible"
reversible: true
ParallelAnimation {
NumberAnimation {
properties: "y"
duration: 250
easing.type: Easing.InOutQuad
}
}
}
}
}