-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWeatherItem.qml
107 lines (86 loc) · 2.4 KB
/
WeatherItem.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
107
import QtQuick 2.15
import QtQuick.Controls 2.15
Rectangle {
id:dayId
color:"transparent"
Rectangle {
anchors.fill:parent
color:constColors[4]
opacity:isActive ? .7:.4
radius:parent.radius
}
clip:true
radius:8
//-------------------------------------------------------------
property alias varDate : dateTextId.text
property alias varWeatherImg : dateTextId.text
property string varMaxTemp
property string varMinTemp
property string varTypeWeather
property string varPercipitation:"1"
property bool isActive:false
property alias varWeatherIconType: imageId.weatherIcon
CLabel {
id:dateTextId
anchors {
top:parent.top
left:parent.left
topMargin:height/3
leftMargin:width/3
}
text:varDate
color:constColors[0]
font {
pixelSize: 20
}
}
CWIcon /* --- Image of the weather --- */
{
id:imageId
height:60
width: height
anchors {
verticalCenter: parent.verticalCenter
verticalCenterOffset:10
left:dateTextId.left
}
}
CLabel /* --- Min and Max temperatures Weather type string --- */{
id:tempTextId
textFormat: Text.RichText
lineHeight:1.2
text: "<span>%1</span> ".arg(varMaxTemp)
+ "<br/>"
+ "<span>%1</span>".arg(varMinTemp)
color:constColors[0]
font.pixelSize:23
horizontalAlignment:Text.AlignLeft
anchors {
verticalCenter: imageId.verticalCenter
// verticalCenterOffset:10
left:imageId.right
leftMargin:10
}
}
CLabel /* --- Min and Max temperatures Weather type string --- */{
id:extraTextId
visible:isActive
height:parent.height/3
font {
letterSpacing:-1
pixelSize:17
}
textFormat: Text.RichText
lineHeight:1.3
text: "<span>%1</span>".arg(varTypeWeather)
+ "<br/>"
+ "<span>%1</span>".arg(varPercipitation)
color:constColors[0]
horizontalAlignment:Text.AlignRight
anchors {
verticalCenter:parent.verticalCenter
right:parent.right
rightMargin:parent.width*.05
}
}
}