Merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-ubuntushape-qml-code-snippets-indentation into lp:ubuntu-ui-toolkit/staging

Proposed by Loïc Molinari
Status: Merged
Approved by: Zsombor Egri
Approved revision: 1443
Merged at revision: 1443
Proposed branch: lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-ubuntushape-qml-code-snippets-indentation
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 152 lines (+48/-48)
2 files modified
modules/Ubuntu/Components/plugin/ucubuntushape.cpp (+32/-32)
modules/Ubuntu/Components/plugin/ucubuntushapeoverlay.cpp (+16/-16)
To merge this branch: bzr merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-ubuntushape-qml-code-snippets-indentation
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Zsombor Egri Approve
Review via email: mp+252421@code.launchpad.net

Commit message

[UbuntuShape*] Fixed embedded QML code snippets indentation.

Description of the change

[UbuntuShape*] Fixed embedded QML code snippets indentation.

To post a comment you must log in.
Revision history for this message
Zsombor Egri (zsombi) wrote :

Thanks for the fix, docs look nice now :)

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/plugin/ucubuntushape.cpp'
2--- modules/Ubuntu/Components/plugin/ucubuntushape.cpp 2015-03-06 11:45:09 +0000
3+++ modules/Ubuntu/Components/plugin/ucubuntushape.cpp 2015-03-10 11:56:07 +0000
4@@ -224,21 +224,21 @@
5 Examples:
6
7 \qml
8- import Ubuntu.Components 1.2
9-
10- UbuntuShape {
11- backgroundColor: "green"
12+ import Ubuntu.Components 1.2
13+
14+ UbuntuShape {
15+ backgroundColor: "green"
16+ }
17+ \endqml
18+
19+ \qml
20+ import Ubuntu.Components 1.2
21+
22+ UbuntuShape {
23+ source: Image {
24+ source: "ubuntu.png"
25 }
26- \endqml
27-
28- \qml
29- import Ubuntu.Components 1.2
30-
31- UbuntuShape {
32- source: Image {
33- source: "ubuntu.png"
34- }
35- }
36+ }
37 \endqml
38 */
39 UCUbuntuShape::UCUbuntuShape(QQuickItem* parent)
40@@ -336,26 +336,26 @@
41 It can be set either with an inlined \c Image:
42
43 \qml
44- Item {
45- UbuntuShape {
46- source: Image { source: "ubuntu.png" }
47- }
48+ Item {
49+ UbuntuShape {
50+ source: Image { source: "ubuntu.png" }
51 }
52+ }
53 \endqml
54
55 or with an \c Image \c id:
56
57 \qml
58- Item {
59- Image {
60- id: img
61- visible: false
62- source: "ubuntu.png"
63- }
64- UbuntuShape {
65- source: img
66- }
67- }
68+ Item {
69+ Image {
70+ id: img
71+ visible: false
72+ source: "ubuntu.png"
73+ }
74+ UbuntuShape {
75+ source: img
76+ }
77+ }
78 \endqml
79
80 Note that in this case, the \c Image is stored in the scene tree as any other items. So setting
81@@ -575,10 +575,10 @@
82 Here is a code sample showing how to apply an horizontal flip:
83
84 \qml
85- UbuntuShape {
86- source: Image { source: "ubuntu.png" }
87- sourceScale: Qt.vector2d(-1.0, 1.0)
88- }
89+ UbuntuShape {
90+ source: Image { source: "ubuntu.png" }
91+ sourceScale: Qt.vector2d(-1.0, 1.0)
92+ }
93 \endqml
94
95 \note Setting this disables support for the deprecated \l image property.
96
97=== modified file 'modules/Ubuntu/Components/plugin/ucubuntushapeoverlay.cpp'
98--- modules/Ubuntu/Components/plugin/ucubuntushapeoverlay.cpp 2015-03-05 10:42:54 +0000
99+++ modules/Ubuntu/Components/plugin/ucubuntushapeoverlay.cpp 2015-03-10 11:56:07 +0000
100@@ -102,13 +102,13 @@
101 Example:
102
103 \qml
104- import Ubuntu.Components 1.2
105+ import Ubuntu.Components 1.2
106
107- UbuntuShapeOverlay {
108- backgroundColor: "white"
109- overlayColor: "black"
110- overlayGeometry: Qt.rect(0.25, 0.25, 0.5, 0.5)
111- }
112+ UbuntuShapeOverlay {
113+ backgroundColor: "white"
114+ overlayColor: "black"
115+ overlayGeometry: Qt.rect(0.25, 0.25, 0.5, 0.5)
116+ }
117 \endqml
118 */
119 UCUbuntuShapeOverlay::UCUbuntuShapeOverlay(QQuickItem* parent)
120@@ -131,22 +131,22 @@
121 at the vertical center can be done like that:
122
123 \qml
124- UbuntuShapeOverlay {
125- width: 200; height: 200
126- overlayColor: Qt.rgba(0.0, 0.0, 0.5, 0.5)
127- overlayGeometry: Qt.rect(0.0, 0.5, 1.0, 0.5)
128- }
129+ UbuntuShapeOverlay {
130+ width: 200; height: 200
131+ overlayColor: Qt.rgba(0.0, 0.0, 0.5, 0.5)
132+ overlayGeometry: Qt.rect(0.0, 0.5, 1.0, 0.5)
133+ }
134 \endqml
135
136 Converting a position and a size in pixels to normalized item coordinates can be done with a
137 division by the size. Here is an equivalent of the previous code sample:
138
139 \qml
140- UbuntuShapeOverlay {
141- width: 200; height: 200
142- overlayColor: Qt.rgba(0.0, 0.0, 0.5, 0.5)
143- overlayGeometry: Qt.rect(100.0/width, 100.0/height, 200.0/width, 100.0/height)
144- }
145+ UbuntuShapeOverlay {
146+ width: 200; height: 200
147+ overlayColor: Qt.rgba(0.0, 0.0, 0.5, 0.5)
148+ overlayGeometry: Qt.rect(100.0/width, 100.0/height, 200.0/width, 100.0/height)
149+ }
150 \endqml
151
152 A geometry exceeding the item area is cropped.

Subscribers

People subscribed via source and target branches