Merge lp:~bzoltan/ubuntu-ui-toolkit/landing-06-08 into lp:ubuntu-ui-toolkit

Proposed by Zoltan Balogh on 2014-08-06
Status: Merged
Approved by: Zoltan Balogh on 2014-08-06
Approved revision: 1183
Merged at revision: 1068
Proposed branch: lp:~bzoltan/ubuntu-ui-toolkit/landing-06-08
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 358 lines (+124/-19)
13 files modified
debian/changelog (+13/-0)
modules/Ubuntu/Components/ListItems/Standard.qml (+1/-1)
modules/Ubuntu/Components/Popups/Popover.qml (+2/-1)
modules/Ubuntu/Components/Tabs.qml (+1/-1)
modules/Ubuntu/Components/Themes/Ambiance/BubbleShape.qml (+9/-5)
modules/Ubuntu/Components/Themes/Ambiance/OverflowPanel.qml (+22/-0)
modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml (+66/-6)
modules/Ubuntu/Components/Themes/Ambiance/PopoverForegroundStyle.qml (+1/-0)
modules/Ubuntu/Components/Themes/Ambiance/artwork/header_overflow_dropshadow@27.sci (+5/-0)
modules/Ubuntu/Components/Themes/Ambiance/qmldir (+1/-0)
modules/Ubuntu/Components/plugin/shapeitem.cpp (+1/-1)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py (+2/-3)
tests/autopilot/ubuntuuitoolkit/tests/components/test_header.py (+0/-1)
To merge this branch: bzr merge lp:~bzoltan/ubuntu-ui-toolkit/landing-06-08
Reviewer Review Type Date Requested Status
Christian Dywan 2014-08-06 Pending
Review via email: mp+229826@code.launchpad.net

Commit message

- Ubuntu Shape: store geometry before redrawing can occur so that the geometry is more reliably respected. Fixes: https://bugs.launchpad.net/bugs/1353493
- Square overflow panel style for header pop overs. Fixes: https://bugs.launchpad.net/bugs/1336789

Description of the change

- Ubuntu Shape: store geometry before redrawing can occur so that the geometry is more reliably respected. Fixes: https://bugs.launchpad.net/bugs/1353493
- Square overflow panel style for header pop overs. Fixes: https://bugs.launchpad.net/bugs/1336789

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-08-04 16:00:57 +0000
3+++ debian/changelog 2014-08-06 16:32:29 +0000
4@@ -1,3 +1,16 @@
5+ubuntu-ui-toolkit (1.1.1181+14.10.20140804-0ubuntu2) UNRELEASED; urgency=medium
6+
7+ [ Florian Boucault ]
8+ * Ubuntu Shape: store geometry before redrawing can occur so that
9+ the geometry is more reliably respected.
10+ Fixes: https://bugs.launchpad.net/bugs/1353493
11+
12+ [ Christian Dywan ]
13+ * Square overflow panel style for header pop overs.
14+ Fixes: https://bugs.launchpad.net/bugs/1336789
15+
16+ -- Zoltán Balogh <zoltan@bakter.hu> Wed, 06 Aug 2014 19:26:17 +0300
17+
18 ubuntu-ui-toolkit (1.1.1179+14.10.20140804-0ubuntu1) utopic; urgency=medium
19
20 [ Florian Boucault ]
21
22=== modified file 'modules/Ubuntu/Components/ListItems/Standard.qml'
23--- modules/Ubuntu/Components/ListItems/Standard.qml 2014-05-22 22:56:16 +0000
24+++ modules/Ubuntu/Components/ListItems/Standard.qml 2014-08-06 16:32:29 +0000
25@@ -197,7 +197,7 @@
26 id: iconHelper
27
28 width: height
29- height: Math.min(units.gu(5), parent.height - units.gu(1))
30+ height: Math.min(units.gu(5), listItem.height - units.gu(1))
31 anchors {
32 left: parent.left
33 leftMargin: listItem.__contentsMargins
34
35=== modified file 'modules/Ubuntu/Components/Popups/Popover.qml'
36--- modules/Ubuntu/Components/Popups/Popover.qml 2014-04-25 15:14:18 +0000
37+++ modules/Ubuntu/Components/Popups/Popover.qml 2014-08-06 16:32:29 +0000
38@@ -127,7 +127,7 @@
39 The property holds the margins from the popover's dismissArea. The property
40 is themed.
41 */
42- property real edgeMargins: units.gu(2)
43+ property real edgeMargins: foreground.square ? 0 : units.gu(2)
44
45 /*!
46 The property holds the margin from the popover's caller. The property
47@@ -231,6 +231,7 @@
48 property point target: Qt.point(pointer.x - x, pointer.y - y)
49 property string direction: pointer.direction
50 property bool clipContent: true
51+ property bool square: popover.hasOwnProperty("square") ? popover.square : false
52
53 signal show()
54 signal hide()
55
56=== modified file 'modules/Ubuntu/Components/Tabs.qml'
57--- modules/Ubuntu/Components/Tabs.qml 2014-06-18 11:49:29 +0000
58+++ modules/Ubuntu/Components/Tabs.qml 2014-08-06 16:32:29 +0000
59@@ -338,7 +338,7 @@
60 function connectToRepeaters(children) {
61 for (var i = 0; i < children.length; i++) {
62 var child = children[i];
63- if (internal.isRepeater(child) && (internal.repeaters.indexOf(child) < 0)) {
64+ if (internal.isRepeater(child) && internal.repeaters && (internal.repeaters.indexOf(child) < 0)) {
65 internal.connectRepeater(child);
66 }
67 }
68
69=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/BubbleShape.qml'
70--- modules/Ubuntu/Components/Themes/Ambiance/BubbleShape.qml 2014-05-07 18:06:41 +0000
71+++ modules/Ubuntu/Components/Themes/Ambiance/BubbleShape.qml 2014-08-06 16:32:29 +0000
72@@ -29,6 +29,7 @@
73 // FIXME: This should not be necessary. See
74 // https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1214978
75 property alias arrowSource: arrow.source
76+ property bool square: false
77
78 implicitWidth: units.gu(10)
79 implicitHeight: units.gu(8)
80@@ -94,8 +95,10 @@
81 BorderImage {
82 id: shadow
83 anchors.fill: parent
84- anchors.margins: -units.gu(0.5)
85- source: "artwork/bubble_shadow.sci"
86+ anchors.margins: square ? -units.gu(1) : -units.gu(0.5)
87+ anchors.topMargin: square ? 0 : anchors.margins
88+ source: !square ? "artwork/bubble_shadow.sci" : "artwork/header_overflow_dropshadow.sci"
89+ opacity: 0.8
90 }
91
92 UbuntuShape {
93@@ -103,13 +106,14 @@
94 borderSource: "none"
95 color: Theme.palette.normal.overlay
96 image: bubbleShape.clipContent ? shapeSource : null
97+ visible: !square
98 }
99
100 ShaderEffectSource {
101 id: shapeSource
102 visible: bubbleShape.clipContent
103 sourceItem: bubbleShape.clipContent ? content : null
104- hideSource: true
105+ hideSource: !square
106 // FIXME: visible: false prevents rendering so make it a nearly
107 // transparent 1x1 pixel instead
108 opacity: 0.01
109@@ -124,7 +128,7 @@
110 Rectangle {
111 id: colorRect
112 anchors.fill: parent
113- color: Theme.palette.normal.overlay
114+ color: square ? Theme.palette.normal.background : Theme.palette.normal.overlay
115 visible: bubbleShape.clipContent
116 }
117 }
118@@ -136,7 +140,7 @@
119 Image {
120 id: arrow
121
122- visible: bubbleShape.direction != "none"
123+ visible: !square && bubbleShape.direction != "none"
124
125 function directionToRotation(direction) {
126 switch (direction) {
127
128=== added file 'modules/Ubuntu/Components/Themes/Ambiance/OverflowPanel.qml'
129--- modules/Ubuntu/Components/Themes/Ambiance/OverflowPanel.qml 1970-01-01 00:00:00 +0000
130+++ modules/Ubuntu/Components/Themes/Ambiance/OverflowPanel.qml 2014-08-06 16:32:29 +0000
131@@ -0,0 +1,22 @@
132+/*
133+ * Copyright 2014 Canonical Ltd.
134+ *
135+ * This program is free software; you can redistribute it and/or modify
136+ * it under the terms of the GNU Lesser General Public License as published by
137+ * the Free Software Foundation; version 3.
138+ *
139+ * This program is distributed in the hope that it will be useful,
140+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
141+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
142+ * GNU Lesser General Public License for more details.
143+ *
144+ * You should have received a copy of the GNU Lesser General Public License
145+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
146+ */
147+
148+import QtQuick 2.0
149+import Ubuntu.Components.Popups 1.0
150+
151+Popover {
152+ property bool square: true
153+}
154
155=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml'
156--- modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml 2014-07-31 14:09:45 +0000
157+++ modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml 2014-08-06 16:32:29 +0000
158@@ -161,11 +161,14 @@
159 tabsPopover.show();
160 }
161
162- Popover {
163+ OverflowPanel {
164 id: tabsPopover
165 objectName: "tabsPopover"
166 parent: QuickUtils.rootItem(tabsPopover)
167 caller: tabsButton
168+ callerMargin: -units.gu(1) + units.dp(4)
169+ contentWidth: units.gu(20)
170+
171 Column {
172 anchors {
173 left: parent.left
174@@ -174,14 +177,33 @@
175 }
176 Repeater {
177 model: styledItem.tabsModel
178- ListItem.Standard {
179- visible: index !== styledItem.tabsModel.selectedIndex
180- text: tab.title // FIXME: only "title" doesn't work with i18n.tr(). Why not?
181+ AbstractButton {
182 objectName: "tabButton" + index
183 onClicked: {
184 styledItem.tabsModel.selectedIndex = index;
185 tabsPopover.hide();
186 }
187+ implicitHeight: units.gu(6) + bottomDividerLine.height
188+ width: parent ? parent.width : units.gu(31)
189+
190+ Label {
191+ anchors {
192+ verticalCenter: parent.verticalCenter
193+ verticalCenterOffset: units.dp(-1)
194+ left: parent.left
195+ leftMargin: units.gu(2)
196+ }
197+ fontSize: "medium"
198+ elide: Text.ElideRight
199+ text: tab.title // FIXME: only "title" doesn't work with i18n.tr(). Why not?
200+ color: '#5d5d5d'
201+ }
202+
203+ ListItem.ThinDivider {
204+ id: bottomDividerLine
205+ anchors.bottom: parent.bottom
206+ visible: index < styledItem.tabsModel.count - 1
207+ }
208 }
209 }
210 }
211@@ -296,11 +318,13 @@
212 height: actionsContainer.height
213 onTriggered: actionsOverflowPopover.show()
214
215- Popover {
216+ OverflowPanel {
217 id: actionsOverflowPopover
218 objectName: "actions_overflow_popover"
219 parent: QuickUtils.rootItem(actionsOverflowPopover)
220 caller: actionsOverflowButton
221+ callerMargin: -units.gu(1) + units.dp(4)
222+ contentWidth: units.gu(20)
223
224 // Ensure the popover closes when actions change and
225 // the list item below may be destroyed before its
226@@ -326,11 +350,47 @@
227 right: parent.right
228 }
229 Repeater {
230+ id: overflowRepeater
231 model: numberOfSlots.requested - numberOfSlots.used
232- ListItem.Standard {
233+ AbstractButton {
234 action: actionsContainer.visibleActions[numberOfSlots.used + index]
235 objectName: action.objectName + "_header_overflow_button"
236 onClicked: actionsOverflowPopover.hide()
237+ implicitHeight: units.gu(6) + bottomDividerLine.height
238+ width: parent ? parent.width : units.gu(31)
239+
240+ Icon {
241+ id: actionIcon
242+ name: action.iconName
243+ color: '#5d5d5d'
244+ anchors {
245+ verticalCenter: parent.verticalCenter
246+ verticalCenterOffset: units.dp(-1)
247+ left: parent.left
248+ leftMargin: units.gu(2)
249+ }
250+ width: units.gu(2)
251+ height: units.gu(2)
252+ }
253+
254+ Label {
255+ anchors {
256+ verticalCenter: parent.verticalCenter
257+ verticalCenterOffset: units.dp(-1)
258+ left: actionIcon.right
259+ leftMargin: units.gu(2)
260+ }
261+ fontSize: "small"
262+ elide: Text.ElideRight
263+ text: action.text
264+ color: '#5d5d5d'
265+ }
266+
267+ ListItem.ThinDivider {
268+ id: bottomDividerLine
269+ anchors.bottom: parent.bottom
270+ visible: index !== overflowRepeater.count - 1
271+ }
272 }
273 }
274 }
275
276=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/PopoverForegroundStyle.qml'
277--- modules/Ubuntu/Components/Themes/Ambiance/PopoverForegroundStyle.qml 2013-07-31 12:16:52 +0000
278+++ modules/Ubuntu/Components/Themes/Ambiance/PopoverForegroundStyle.qml 2014-08-06 16:32:29 +0000
279@@ -22,6 +22,7 @@
280 target: styledItem.target
281 direction: styledItem.direction
282 clipContent: styledItem.clipContent
283+ square: styledItem.square
284
285 onShowCompleted: styledItem.showCompleted()
286 onHideCompleted: styledItem.hideCompleted()
287
288=== added file 'modules/Ubuntu/Components/Themes/Ambiance/artwork/header_overflow_dropshadow@27.png'
289Binary files modules/Ubuntu/Components/Themes/Ambiance/artwork/header_overflow_dropshadow@27.png 1970-01-01 00:00:00 +0000 and modules/Ubuntu/Components/Themes/Ambiance/artwork/header_overflow_dropshadow@27.png 2014-08-06 16:32:29 +0000 differ
290=== added file 'modules/Ubuntu/Components/Themes/Ambiance/artwork/header_overflow_dropshadow@27.sci'
291--- modules/Ubuntu/Components/Themes/Ambiance/artwork/header_overflow_dropshadow@27.sci 1970-01-01 00:00:00 +0000
292+++ modules/Ubuntu/Components/Themes/Ambiance/artwork/header_overflow_dropshadow@27.sci 2014-08-06 16:32:29 +0000
293@@ -0,0 +1,5 @@
294+border.left: 27
295+border.top: 27
296+border.bottom: 27
297+border.right: 27
298+source: header_overflow_dropshadow@27.png
299\ No newline at end of file
300
301=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/qmldir'
302--- modules/Ubuntu/Components/Themes/Ambiance/qmldir 2014-07-22 14:20:08 +0000
303+++ modules/Ubuntu/Components/Themes/Ambiance/qmldir 2014-08-06 16:32:29 +0000
304@@ -49,3 +49,4 @@
305
306 internal TextSelectionStartCursorStyle TextSelectionStartCursorStyle.qml
307 internal TextSelectionEndCursorStyle TextSelectionEndCursorStyle.qml
308+internal OverflowPanel OverflowPanel.qml
309
310=== modified file 'modules/Ubuntu/Components/plugin/shapeitem.cpp'
311--- modules/Ubuntu/Components/plugin/shapeitem.cpp 2014-08-04 12:53:59 +0000
312+++ modules/Ubuntu/Components/plugin/shapeitem.cpp 2014-08-06 16:32:29 +0000
313@@ -408,9 +408,9 @@
314
315 void ShapeItem::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry)
316 {
317- QQuickItem::geometryChanged(newGeometry, oldGeometry);
318 geometry_ = newGeometry;
319 dirtyFlags_ |= ShapeItem::DirtyGeometry;
320+ QQuickItem::geometryChanged(newGeometry, oldGeometry);
321 update();
322 }
323
324
325=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py'
326--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2014-07-23 13:27:09 +0000
327+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2014-08-06 16:32:29 +0000
328@@ -181,7 +181,7 @@
329
330 try:
331 tab_button = self.get_root_instance().select_single(
332- 'Standard', objectName='tabButton' + str(index))
333+ objectName='tabButton' + str(index))
334 except dbus.StateNotFoundError:
335 raise _common.ToolkitException(
336 "Tab button {0} not found.".format(index))
337@@ -229,8 +229,7 @@
338
339 # the popover is not a child of the header, so use the root object
340 # to find the requested button
341- return self.get_root_instance().select_single(
342- 'Standard', objectName=object_name)
343+ return self.get_root_instance().select_single(objectName=object_name)
344
345
346 class Header(AppHeader):
347
348=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/components/test_header.py'
349--- tests/autopilot/ubuntuuitoolkit/tests/components/test_header.py 2014-07-17 06:38:04 +0000
350+++ tests/autopilot/ubuntuuitoolkit/tests/components/test_header.py 2014-08-06 16:32:29 +0000
351@@ -51,7 +51,6 @@
352
353 """
354 overflow_popover = self.main_view.select_single(
355- 'Popover',
356 objectName='actions_overflow_popover')
357 self.header.click_action_button('pushStackAction')
358 self.assertThat(overflow_popover.visible, Eventually(Equals(False)))

Subscribers

People subscribed via source and target branches

to status/vote changes: