Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/galleryTweaksPage into lp:ubuntu-ui-toolkit

Proposed by Cris Dywan
Status: Superseded
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/galleryTweaksPage
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 374 lines (+87/-71)
12 files modified
CHANGES (+1/-1)
components.api (+7/-14)
examples/ubuntu-ui-toolkit-gallery/Tweaks.qml (+48/-0)
examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml (+5/-0)
modules/Ubuntu/Components/AnimatedItem.qml (+1/-38)
modules/Ubuntu/Components/ListItems/Base.qml (+1/-1)
modules/Ubuntu/Components/PageStack.qml (+1/-0)
modules/Ubuntu/Components/Pickers/DatePicker.qml (+4/-2)
modules/Ubuntu/Components/plugin/i18n.cpp (+6/-5)
modules/Ubuntu/Components/plugin/thumbnailgenerator.cpp (+6/-3)
modules/Ubuntu/Components/qmldir (+1/-2)
tests/qmlapicheck.py (+6/-5)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/galleryTweaksPage
Reviewer Review Type Date Requested Status
Tim Peeters Needs Resubmitting
PS Jenkins bot continuous-integration Approve
Review via email: mp+221356@code.launchpad.net

This proposal has been superseded by a proposal from 2014-05-30.

Commit message

Add a page Tweaks to change theme and header style in the gallery

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Tim Peeters (tpeeters) wrote :

This should be proposed for merging into staging, not trunk.

Also I see changes here that make the header private (from another MR, that is being reverted in landing). Before we accept this we need to make sure that the revert of that is not being reverted again.

review: Needs Resubmitting
1089. By Cris Dywan

Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/staging

1090. By Cris Dywan

Rename Tweaks to Styles

1091. By Cris Dywan

Embrace selectedIndex

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CHANGES'
2--- CHANGES 2014-05-20 08:35:14 +0000
3+++ CHANGES 2014-05-29 11:06:26 +0000
4@@ -12,7 +12,7 @@
5
6 Compatibility Breaks
7 ********************
8-
9+* Header component API was made internal (as it was always documented)
10
11 Ubuntu.Components 1.0
12 #####################
13
14=== modified file 'components.api'
15--- components.api 2014-05-26 11:36:53 +0000
16+++ components.api 2014-05-29 11:06:26 +0000
17@@ -31,6 +31,7 @@
18 AbstractButton
19 property color color
20 property Gradient gradient
21+ property font font
22 property string iconPosition
23 CheckBox 0.1 1.0
24 AbstractButton
25@@ -61,19 +62,6 @@
26 readonly property bool running
27 property size sourceSize
28 readonly property int status
29-Header 0.1 1.0
30-StyledItem
31- property bool animate
32- function show()
33- function hide()
34- property string title
35- property Item contents
36- property var tabsModel
37- property var pageStack
38- property var actions
39- property var __customBackAction
40- property Flickable flickable
41- property bool useDeprecatedToolbar
42 Icon 0.1 1.0
43 Item
44 property string name
45@@ -94,7 +82,7 @@
46 property real __leftIconMargin
47 property real __rightIconMargin
48 property bool __iconIsItem
49- property internal children
50+ default property internal children
51 Caption 0.1 1.0
52 Item
53 property string text
54@@ -140,6 +128,7 @@
55 property bool expanded
56 property bool multiSelection
57 property bool colourImage
58+ property Component delegate
59 property real containerHeight
60 property int selectedIndex
61 property bool currentlyExpanded
62@@ -204,12 +193,14 @@
63 Object 0.1 1.0
64 QtObject
65 default property internal children
66+ property list<QtObject> __defaultPropertyFix
67 OptionSelector 0.1 1.0
68 ListItem.Empty
69 property var model
70 property bool expanded
71 property bool multiSelection
72 property bool colourImage
73+ property Component delegate
74 property real containerHeight
75 property int selectedIndex
76 property bool currentlyExpanded
77@@ -235,6 +226,7 @@
78 Page 0.1 1.0
79 PageTreeNode
80 property string title
81+ property Item tools
82 property Item __customHeaderContents
83 property Flickable flickable
84 property list<Action> actions
85@@ -355,6 +347,7 @@
86 OrientationHelper
87 property Item dismissArea
88 property bool grabDismissAreaEvents
89+ property PropertyAnimation fadingAnimation
90 function show()
91 function hide()
92 function __closeIfHidden()
93
94=== added file 'examples/ubuntu-ui-toolkit-gallery/Tweaks.qml'
95--- examples/ubuntu-ui-toolkit-gallery/Tweaks.qml 1970-01-01 00:00:00 +0000
96+++ examples/ubuntu-ui-toolkit-gallery/Tweaks.qml 2014-05-29 11:06:26 +0000
97@@ -0,0 +1,48 @@
98+/*
99+ * Copyright 2014 Canonical Ltd.
100+ *
101+ * This program is free software; you can redistribute it and/or modify
102+ * it under the terms of the GNU Lesser General Public License as published by
103+ * the Free Software Foundation; version 3.
104+ *
105+ * This program is distributed in the hope that it will be useful,
106+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
107+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
108+ * GNU Lesser General Public License for more details.
109+ *
110+ * You should have received a copy of the GNU Lesser General Public License
111+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
112+ */
113+
114+import QtQuick 2.0
115+import Ubuntu.Components 1.1
116+
117+Template {
118+ objectName: "tweaksTemplate"
119+
120+ Label {
121+ anchors.left: parent.left
122+ anchors.right: parent.right
123+
124+ text: i18n.tr("Switch between old and new style header")
125+ }
126+
127+ OptionSelector {
128+ model: [ i18n.tr('Header with Toolbar'), i18n.tr('New Style Header') ]
129+ expanded: true
130+ onSelectedIndexChanged: gallery.useDeprecatedToolbar = selectedIndex == 0
131+ }
132+
133+ Label {
134+ anchors.left: parent.left
135+ anchors.right: parent.right
136+
137+ text: i18n.tr("Switch between themes")
138+ }
139+
140+ OptionSelector {
141+ model: [ 'Ambiance', 'SuruDark' ]
142+ expanded: true
143+ onSelectedIndexChanged: Theme.name = 'Ubuntu.Components.Themes.%1'.arg(model[selectedIndex])
144+ }
145+}
146
147=== modified file 'examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml'
148--- examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2014-04-30 10:26:35 +0000
149+++ examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2014-05-29 11:06:26 +0000
150@@ -23,6 +23,11 @@
151 label: "Navigation"
152 source: "Navigation.qml"
153 }
154+ ListElement {
155+ objectName: "tweaksElement"
156+ label: "Tweaks"
157+ source: "Tweaks.qml"
158+ }
159
160 ListElement {
161 objectName: "togglesElement"
162
163=== modified file 'modules/Ubuntu/Components/AnimatedItem.qml'
164--- modules/Ubuntu/Components/AnimatedItem.qml 2014-04-23 08:50:20 +0000
165+++ modules/Ubuntu/Components/AnimatedItem.qml 2014-05-29 11:06:26 +0000
166@@ -30,45 +30,8 @@
167 id: root
168 /*!
169 \preliminary
170+ \deprecated
171 Specifies whether the component is on the visible area of the Flickable or not.
172 */
173 property bool onScreen: true
174-
175- QtObject {
176- id: internal
177- property Flickable flickable
178-
179- // returns whether the component is in the visible area of the flickable
180- function checkOnScreen()
181- {
182- var pos = root.mapToItem(flickable, 0, 0)
183- root.onScreen = (pos.y + root.height >= 0) && (pos.y <= internal.flickable.height) &&
184- (pos.x + root.width >= 0) && (pos.x <= internal.flickable.width)
185- }
186- // lookup for a flickable parent
187- function updateFlickableParent()
188- {
189- var flickable = root.parent
190- while (flickable) {
191- if (flickable.hasOwnProperty("flicking") && flickable.hasOwnProperty("flickableDirection")) {
192- // non-interactive flickables must be skipped as those do not provide
193- // on-screen detection support
194- if (flickable.interactive)
195- break
196- }
197- flickable = flickable.parent
198- }
199- internal.flickable = flickable
200- }
201- }
202-
203- Connections {
204- target: internal.flickable
205-
206- onContentXChanged: internal.checkOnScreen()
207- onContentYChanged: internal.checkOnScreen()
208- }
209-
210- Component.onCompleted: internal.updateFlickableParent()
211- onParentChanged: internal.updateFlickableParent()
212 }
213
214=== modified file 'modules/Ubuntu/Components/ListItems/Base.qml'
215--- modules/Ubuntu/Components/ListItems/Base.qml 2014-04-28 19:24:56 +0000
216+++ modules/Ubuntu/Components/ListItems/Base.qml 2014-05-29 11:06:26 +0000
217@@ -159,7 +159,7 @@
218 /*!
219 \internal
220 */
221- property alias children: middle.data
222+ default property alias children: middle.data
223 Item {
224 id: middle
225 property bool anchorToIconHelper: !__iconIsItem && iconHelper.source != ""
226
227=== modified file 'modules/Ubuntu/Components/PageStack.qml'
228--- modules/Ubuntu/Components/PageStack.qml 2014-05-13 09:09:35 +0000
229+++ modules/Ubuntu/Components/PageStack.qml 2014-05-29 11:06:26 +0000
230@@ -192,6 +192,7 @@
231 */
232 default property alias data: inactiveNode.data
233 PageTreeNode {
234+ anchors.fill: parent
235 id: inactiveNode
236 active: false
237 }
238
239=== modified file 'modules/Ubuntu/Components/Pickers/DatePicker.qml'
240--- modules/Ubuntu/Components/Pickers/DatePicker.qml 2014-05-07 10:42:31 +0000
241+++ modules/Ubuntu/Components/Pickers/DatePicker.qml 2014-05-29 11:06:26 +0000
242@@ -523,7 +523,8 @@
243 function updatePickers() {
244 if (completed) {
245 // check mode flags first
246- var modes = datePicker.mode.split(/\W/g);
247+ // FIXME: The js split(/\W/g) terminates the process on armhf with Qt 5.3 (v4 js) (https://bugreports.qt-project.org/browse/QTBUG-39255)
248+ var modes = datePicker.mode.match(/\w+/g);
249
250 showYearPicker = showMonthPicker = showDayPicker =
251 showHoursPicker = showMinutesPicker = showSecondsPicker = false;
252@@ -607,7 +608,8 @@
253 completed = false;
254
255 // use short format to exclude any extra characters
256- var format = datePicker.locale.dateFormat(Locale.ShortFormat).split(/\W/g);
257+ // FIXME: The js split(/\W/g) terminates the process on armhf with Qt 5.3 (v4 js) (https://bugreports.qt-project.org/browse/QTBUG-39255)
258+ var format = datePicker.locale.dateFormat(Locale.ShortFormat).match(/\w+/g);
259 // loop through the format to decide the position of the tumbler
260 var formatIndex = 0;
261 for (var i in format) {
262
263=== modified file 'modules/Ubuntu/Components/plugin/i18n.cpp'
264--- modules/Ubuntu/Components/plugin/i18n.cpp 2014-05-22 15:54:13 +0000
265+++ modules/Ubuntu/Components/plugin/i18n.cpp 2014-05-29 11:06:26 +0000
266@@ -103,13 +103,14 @@
267 /*
268 The default is /usr/share/locale if we don't set a folder
269 For click we use APP_DIR/share/locale
270- eg. /usr/share/click/preinstalled/com.example.foo/current/share/locale
271+ e.g. /usr/share/click/preinstalled/com.example.foo/current/share/locale
272 */
273- QDir appDir(getenv("APP_DIR"));
274- if (appDir.exists()) {
275- QString localePath(appDir.filePath("share/locale"));
276- C::bindtextdomain(domain.toUtf8(), localePath.toUtf8());
277+ QString appDir(getenv("APP_DIR"));
278+ if (!QDir::isAbsolutePath (appDir)) {
279+ appDir = "/usr";
280 }
281+ QString localePath(QDir(appDir).filePath("share/locale"));
282+ C::bindtextdomain(domain.toUtf8(), localePath.toUtf8());
283 Q_EMIT domainChanged();
284 }
285
286
287=== modified file 'modules/Ubuntu/Components/plugin/thumbnailgenerator.cpp'
288--- modules/Ubuntu/Components/plugin/thumbnailgenerator.cpp 2014-02-25 09:14:23 +0000
289+++ modules/Ubuntu/Components/plugin/thumbnailgenerator.cpp 2014-05-29 11:06:26 +0000
290@@ -43,12 +43,15 @@
291 * is the only way around the issue for now. */
292 std::string src_path(QUrl(id).path().toUtf8().data());
293 std::string tgt_path;
294+ const int xlarge_cutoff = 512;
295+ const int large_cutoff = 256;
296+ const int small_cutoff = 128;
297 try {
298 ThumbnailSize desiredSize;
299- const int large_cutoff = 256;
300- const int small_cutoff = 128;
301- if(requestedSize.width() > large_cutoff || requestedSize.height() > large_cutoff) {
302+ if(requestedSize.width() > xlarge_cutoff || requestedSize.height() > xlarge_cutoff) {
303 desiredSize = TN_SIZE_ORIGINAL;
304+ } else if(requestedSize.width() > large_cutoff || requestedSize.height() > large_cutoff) {
305+ desiredSize = TN_SIZE_XLARGE;
306 } else if(requestedSize.width() > small_cutoff || requestedSize.height() > small_cutoff) {
307 desiredSize = TN_SIZE_LARGE;
308 } else {
309
310=== modified file 'modules/Ubuntu/Components/qmldir'
311--- modules/Ubuntu/Components/qmldir 2014-04-25 12:53:58 +0000
312+++ modules/Ubuntu/Components/qmldir 2014-05-29 11:06:26 +0000
313@@ -29,7 +29,7 @@
314 internal PageTreeNode PageTreeNode.qml
315 PageStack 0.1 PageStack.qml
316 internal Toolbar Toolbar.qml
317-Header 0.1 Header.qml
318+internal Header Header.qml
319 internal AnimatedItem AnimatedItem.qml
320 internal PageWrapper PageWrapper.qml
321 UbuntuShape 0.1 UbuntuShape.qml
322@@ -76,7 +76,6 @@
323 OptionSelectorDelegate 1.0 OptionSelectorDelegate.qml
324 Page 1.0 Page.qml
325 PageStack 1.0 PageStack.qml
326-Header 1.0 Header.qml
327 UbuntuShape 1.0 UbuntuShape.qml
328 CrossFadeImage 1.0 CrossFadeImage.qml
329 Icon 1.0 Icon.qml
330
331=== modified file 'tests/qmlapicheck.py'
332--- tests/qmlapicheck.py 2014-04-24 09:18:38 +0000
333+++ tests/qmlapicheck.py 2014-05-29 11:06:26 +0000
334@@ -130,10 +130,10 @@
335 if '{' in line and '}' in line:
336 if filetype == 'qmltypes' and not in_builtin_type:
337 print(' ' + line.strip())
338- continue
339+ continue
340
341 # End of function/ signal/ Item block
342- if '}' in line:
343+ if '}' in line and not '{' in line:
344 in_block -= 1
345 block_meta = {}
346 if in_block == 1 and in_builtin_type:
347@@ -143,7 +143,7 @@
348 # Only root "Item {" is inspected for QML, otherwise all children
349 if in_block == 1 or filetype == 'qmltypes':
350 # Left hand side specifies a keyword, a type and a variable name
351- declaration = line.split(':')[0]
352+ declaration = line.split(':', 1)[0]
353 words = declaration.strip().split(' ')
354 # Skip types with prefixes considered builtin
355 if filetype == 'qmltypes' and words[0] == 'name':
356@@ -175,7 +175,8 @@
357 for word in words:
358 if word in keywords:
359 if filetype == 'qml':
360- signature = declaration.split('{')[0].strip()
361+ separator = '{' if 'function' in declaration else ':'
362+ signature = declaration.split(separator, 1)[0].strip()
363 if 'alias' in line:
364 no_mods = signature
365 for mod in ['readonly', 'default']:
366@@ -198,7 +199,7 @@
367 break
368
369 # Start of function/ signal/ Item block
370- if '{' in line:
371+ if '{' in line and not '}' in line:
372 in_block += 1
373 block_meta = {}
374 # The parent type can affect API

Subscribers

People subscribed via source and target branches

to status/vote changes: