forked from SiriusDely/Cascades-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hellocascades.qml
73 lines (64 loc) · 2.84 KB
/
hellocascades.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
/* Copyright (c) 2012 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Import all our cascades functions.
import bb.cascades 1.2
Page {
// A container is used to gather visual items together.
Container {
// A DockLayout is applied to the main container, making it
// possible to layout controls and view inside the container.
layout: DockLayout {
}
// The Container is painted with an imagePaint. An imagePaint
// can be tiled, in which the size must be power of two.
// In this case, it is simply an image of the size of the screen
// to set our background.
background: backgroundPaint.imagePaint
// The container containing the bubble image and text
Container {
// This container is also using a dock layout and it is centered on the
// background image by setting up the layoutProperties for the container.
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
layout: DockLayout {
}
// The bubble image
ImageView {
imageSource: "asset:///images/bubble.png"
}
// A text label with the comforting hello world text
Label {
// Set the label text, by using qsTr() the string can be translated.
// Adding + Retranslate.onLanguageChanged will force the string to update
// if language change happens while the app is running (see hellocascadesapp.cpp)
text: qsTr("Hello World") + Retranslate.onLanguageChanged
// The Label text style.
textStyle.base: SystemDefaults.TextStyles.BigText
textStyle.fontWeight: FontWeight.Bold
textStyle.color: Color.create("#ff5D5D5D")
// Center the text in the container.
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Center
}// Label
}// Container
}// Container
attachedObjects: [
// Non UI objects are specified as attached objects
ImagePaintDefinition {
id: backgroundPaint
imageSource: "asset:///images/background.png"
}
]
}// Page