forked from JackV2020/life
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLifeTile.qml
More file actions
95 lines (82 loc) · 3.19 KB
/
Copy pathLifeTile.qml
File metadata and controls
95 lines (82 loc) · 3.19 KB
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
import QtQuick 2.1
import qb.components 1.0
Tile {
id : lifeTile
onVisibleChanged: {
if ( visible ) {
/*
A trick to keep lifeScreenUrl on the screen while it is alive
When dimState is activated while lifeScreenUrl is on the screen,
lifeScreenUrl will run onVisibleChanged and will execute :
app.keepLifeOnScreen = alive
and it will be removed from the screen and this Tile will show up.
When the tile shows up while Life is still running ,
app.keepLifeOnScreen == true
and we need to open the screen again while we are in dimState
*/
if (app.keepLifeOnScreen) { stage.openFullscreen(app.lifeScreenUrl) }
}
}
// --- Tile button
YaLabel {
id : tileButton
buttonBorderWidth : 0
height : isNxt ? 150 : 120
width : isNxt ? 150 : 120
buttonActiveColor : dimState ? "black" : "white"
buttonSelectedColor : buttonActiveColor
buttonHoverColor : buttonActiveColor
hoveringEnabled : false
selected : true
enabled : true
textColor : "white"
anchors {
verticalCenter : parent.verticalCenter
horizontalCenter : parent.horizontalCenter
}
onClicked : { stage.openFullscreen(app.lifeScreenUrl) }
}
Image {
id : lifeImage
source : dimState ? "drawables/lifeDimmed.png"
: "drawables/life.png"
height : isNxt ? (dimState ? 50 : 100 )
: (dimState ? 40 : 80 )
width : isNxt ? (dimState ? 50 : 100 )
: (dimState ? 40 : 80 )
anchors {
verticalCenter : parent.verticalCenter
horizontalCenter : parent.horizontalCenter
}
}
Text {
id : examplesUpdatedMessage
visible : ( app.examplesCountNew != 0 )
text : app.examplesCount + " Examples, new : " + app.examplesCountNew
anchors {
top : tileButton.top
horizontalCenter: tileButton.horizontalCenter
}
font {
pixelSize : isNxt ? 20 : 16
family : qfont.regular.name
bold : true
}
color : "blue"
}
Text {
id : themesUpdatedMessage
visible : ( app.themesCountNew != 0 )
text : app.themesCount + " Themes, new : " + app.themesCountNew
anchors {
bottom : tileButton.bottom
horizontalCenter: tileButton.horizontalCenter
}
font {
pixelSize : isNxt ? 20 : 16
family : qfont.regular.name
bold : true
}
color : "blue"
}
}