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

Proposed by Zoltan Balogh
Status: Merged
Approved by: Zoltan Balogh
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
Cris Dywan 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
=== modified file 'debian/changelog'
--- debian/changelog 2014-08-04 16:00:57 +0000
+++ debian/changelog 2014-08-06 16:32:29 +0000
@@ -1,3 +1,16 @@
1ubuntu-ui-toolkit (1.1.1181+14.10.20140804-0ubuntu2) UNRELEASED; urgency=medium
2
3 [ Florian Boucault ]
4 * Ubuntu Shape: store geometry before redrawing can occur so that
5 the geometry is more reliably respected.
6 Fixes: https://bugs.launchpad.net/bugs/1353493
7
8 [ Christian Dywan ]
9 * Square overflow panel style for header pop overs.
10 Fixes: https://bugs.launchpad.net/bugs/1336789
11
12 -- Zoltán Balogh <zoltan@bakter.hu> Wed, 06 Aug 2014 19:26:17 +0300
13
1ubuntu-ui-toolkit (1.1.1179+14.10.20140804-0ubuntu1) utopic; urgency=medium14ubuntu-ui-toolkit (1.1.1179+14.10.20140804-0ubuntu1) utopic; urgency=medium
215
3 [ Florian Boucault ]16 [ Florian Boucault ]
417
=== modified file 'modules/Ubuntu/Components/ListItems/Standard.qml'
--- modules/Ubuntu/Components/ListItems/Standard.qml 2014-05-22 22:56:16 +0000
+++ modules/Ubuntu/Components/ListItems/Standard.qml 2014-08-06 16:32:29 +0000
@@ -197,7 +197,7 @@
197 id: iconHelper197 id: iconHelper
198198
199 width: height199 width: height
200 height: Math.min(units.gu(5), parent.height - units.gu(1))200 height: Math.min(units.gu(5), listItem.height - units.gu(1))
201 anchors {201 anchors {
202 left: parent.left202 left: parent.left
203 leftMargin: listItem.__contentsMargins203 leftMargin: listItem.__contentsMargins
204204
=== modified file 'modules/Ubuntu/Components/Popups/Popover.qml'
--- modules/Ubuntu/Components/Popups/Popover.qml 2014-04-25 15:14:18 +0000
+++ modules/Ubuntu/Components/Popups/Popover.qml 2014-08-06 16:32:29 +0000
@@ -127,7 +127,7 @@
127 The property holds the margins from the popover's dismissArea. The property127 The property holds the margins from the popover's dismissArea. The property
128 is themed.128 is themed.
129 */129 */
130 property real edgeMargins: units.gu(2)130 property real edgeMargins: foreground.square ? 0 : units.gu(2)
131131
132 /*!132 /*!
133 The property holds the margin from the popover's caller. The property133 The property holds the margin from the popover's caller. The property
@@ -231,6 +231,7 @@
231 property point target: Qt.point(pointer.x - x, pointer.y - y)231 property point target: Qt.point(pointer.x - x, pointer.y - y)
232 property string direction: pointer.direction232 property string direction: pointer.direction
233 property bool clipContent: true233 property bool clipContent: true
234 property bool square: popover.hasOwnProperty("square") ? popover.square : false
234235
235 signal show()236 signal show()
236 signal hide()237 signal hide()
237238
=== modified file 'modules/Ubuntu/Components/Tabs.qml'
--- modules/Ubuntu/Components/Tabs.qml 2014-06-18 11:49:29 +0000
+++ modules/Ubuntu/Components/Tabs.qml 2014-08-06 16:32:29 +0000
@@ -338,7 +338,7 @@
338 function connectToRepeaters(children) {338 function connectToRepeaters(children) {
339 for (var i = 0; i < children.length; i++) {339 for (var i = 0; i < children.length; i++) {
340 var child = children[i];340 var child = children[i];
341 if (internal.isRepeater(child) && (internal.repeaters.indexOf(child) < 0)) {341 if (internal.isRepeater(child) && internal.repeaters && (internal.repeaters.indexOf(child) < 0)) {
342 internal.connectRepeater(child);342 internal.connectRepeater(child);
343 }343 }
344 }344 }
345345
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/BubbleShape.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/BubbleShape.qml 2014-05-07 18:06:41 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/BubbleShape.qml 2014-08-06 16:32:29 +0000
@@ -29,6 +29,7 @@
29 // FIXME: This should not be necessary. See29 // FIXME: This should not be necessary. See
30 // https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/121497830 // https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1214978
31 property alias arrowSource: arrow.source31 property alias arrowSource: arrow.source
32 property bool square: false
3233
33 implicitWidth: units.gu(10)34 implicitWidth: units.gu(10)
34 implicitHeight: units.gu(8)35 implicitHeight: units.gu(8)
@@ -94,8 +95,10 @@
94 BorderImage {95 BorderImage {
95 id: shadow96 id: shadow
96 anchors.fill: parent97 anchors.fill: parent
97 anchors.margins: -units.gu(0.5)98 anchors.margins: square ? -units.gu(1) : -units.gu(0.5)
98 source: "artwork/bubble_shadow.sci"99 anchors.topMargin: square ? 0 : anchors.margins
100 source: !square ? "artwork/bubble_shadow.sci" : "artwork/header_overflow_dropshadow.sci"
101 opacity: 0.8
99 }102 }
100103
101 UbuntuShape {104 UbuntuShape {
@@ -103,13 +106,14 @@
103 borderSource: "none"106 borderSource: "none"
104 color: Theme.palette.normal.overlay107 color: Theme.palette.normal.overlay
105 image: bubbleShape.clipContent ? shapeSource : null108 image: bubbleShape.clipContent ? shapeSource : null
109 visible: !square
106 }110 }
107111
108 ShaderEffectSource {112 ShaderEffectSource {
109 id: shapeSource113 id: shapeSource
110 visible: bubbleShape.clipContent114 visible: bubbleShape.clipContent
111 sourceItem: bubbleShape.clipContent ? content : null115 sourceItem: bubbleShape.clipContent ? content : null
112 hideSource: true116 hideSource: !square
113 // FIXME: visible: false prevents rendering so make it a nearly117 // FIXME: visible: false prevents rendering so make it a nearly
114 // transparent 1x1 pixel instead118 // transparent 1x1 pixel instead
115 opacity: 0.01119 opacity: 0.01
@@ -124,7 +128,7 @@
124 Rectangle {128 Rectangle {
125 id: colorRect129 id: colorRect
126 anchors.fill: parent130 anchors.fill: parent
127 color: Theme.palette.normal.overlay131 color: square ? Theme.palette.normal.background : Theme.palette.normal.overlay
128 visible: bubbleShape.clipContent132 visible: bubbleShape.clipContent
129 }133 }
130 }134 }
@@ -136,7 +140,7 @@
136 Image {140 Image {
137 id: arrow141 id: arrow
138142
139 visible: bubbleShape.direction != "none"143 visible: !square && bubbleShape.direction != "none"
140144
141 function directionToRotation(direction) {145 function directionToRotation(direction) {
142 switch (direction) {146 switch (direction) {
143147
=== added file 'modules/Ubuntu/Components/Themes/Ambiance/OverflowPanel.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/OverflowPanel.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/OverflowPanel.qml 2014-08-06 16:32:29 +0000
@@ -0,0 +1,22 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components.Popups 1.0
19
20Popover {
21 property bool square: true
22}
023
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml 2014-07-31 14:09:45 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml 2014-08-06 16:32:29 +0000
@@ -161,11 +161,14 @@
161 tabsPopover.show();161 tabsPopover.show();
162 }162 }
163163
164 Popover {164 OverflowPanel {
165 id: tabsPopover165 id: tabsPopover
166 objectName: "tabsPopover"166 objectName: "tabsPopover"
167 parent: QuickUtils.rootItem(tabsPopover)167 parent: QuickUtils.rootItem(tabsPopover)
168 caller: tabsButton168 caller: tabsButton
169 callerMargin: -units.gu(1) + units.dp(4)
170 contentWidth: units.gu(20)
171
169 Column {172 Column {
170 anchors {173 anchors {
171 left: parent.left174 left: parent.left
@@ -174,14 +177,33 @@
174 }177 }
175 Repeater {178 Repeater {
176 model: styledItem.tabsModel179 model: styledItem.tabsModel
177 ListItem.Standard {180 AbstractButton {
178 visible: index !== styledItem.tabsModel.selectedIndex
179 text: tab.title // FIXME: only "title" doesn't work with i18n.tr(). Why not?
180 objectName: "tabButton" + index181 objectName: "tabButton" + index
181 onClicked: {182 onClicked: {
182 styledItem.tabsModel.selectedIndex = index;183 styledItem.tabsModel.selectedIndex = index;
183 tabsPopover.hide();184 tabsPopover.hide();
184 }185 }
186 implicitHeight: units.gu(6) + bottomDividerLine.height
187 width: parent ? parent.width : units.gu(31)
188
189 Label {
190 anchors {
191 verticalCenter: parent.verticalCenter
192 verticalCenterOffset: units.dp(-1)
193 left: parent.left
194 leftMargin: units.gu(2)
195 }
196 fontSize: "medium"
197 elide: Text.ElideRight
198 text: tab.title // FIXME: only "title" doesn't work with i18n.tr(). Why not?
199 color: '#5d5d5d'
200 }
201
202 ListItem.ThinDivider {
203 id: bottomDividerLine
204 anchors.bottom: parent.bottom
205 visible: index < styledItem.tabsModel.count - 1
206 }
185 }207 }
186 }208 }
187 }209 }
@@ -296,11 +318,13 @@
296 height: actionsContainer.height318 height: actionsContainer.height
297 onTriggered: actionsOverflowPopover.show()319 onTriggered: actionsOverflowPopover.show()
298320
299 Popover {321 OverflowPanel {
300 id: actionsOverflowPopover322 id: actionsOverflowPopover
301 objectName: "actions_overflow_popover"323 objectName: "actions_overflow_popover"
302 parent: QuickUtils.rootItem(actionsOverflowPopover)324 parent: QuickUtils.rootItem(actionsOverflowPopover)
303 caller: actionsOverflowButton325 caller: actionsOverflowButton
326 callerMargin: -units.gu(1) + units.dp(4)
327 contentWidth: units.gu(20)
304328
305 // Ensure the popover closes when actions change and329 // Ensure the popover closes when actions change and
306 // the list item below may be destroyed before its330 // the list item below may be destroyed before its
@@ -326,11 +350,47 @@
326 right: parent.right350 right: parent.right
327 }351 }
328 Repeater {352 Repeater {
353 id: overflowRepeater
329 model: numberOfSlots.requested - numberOfSlots.used354 model: numberOfSlots.requested - numberOfSlots.used
330 ListItem.Standard {355 AbstractButton {
331 action: actionsContainer.visibleActions[numberOfSlots.used + index]356 action: actionsContainer.visibleActions[numberOfSlots.used + index]
332 objectName: action.objectName + "_header_overflow_button"357 objectName: action.objectName + "_header_overflow_button"
333 onClicked: actionsOverflowPopover.hide()358 onClicked: actionsOverflowPopover.hide()
359 implicitHeight: units.gu(6) + bottomDividerLine.height
360 width: parent ? parent.width : units.gu(31)
361
362 Icon {
363 id: actionIcon
364 name: action.iconName
365 color: '#5d5d5d'
366 anchors {
367 verticalCenter: parent.verticalCenter
368 verticalCenterOffset: units.dp(-1)
369 left: parent.left
370 leftMargin: units.gu(2)
371 }
372 width: units.gu(2)
373 height: units.gu(2)
374 }
375
376 Label {
377 anchors {
378 verticalCenter: parent.verticalCenter
379 verticalCenterOffset: units.dp(-1)
380 left: actionIcon.right
381 leftMargin: units.gu(2)
382 }
383 fontSize: "small"
384 elide: Text.ElideRight
385 text: action.text
386 color: '#5d5d5d'
387 }
388
389 ListItem.ThinDivider {
390 id: bottomDividerLine
391 anchors.bottom: parent.bottom
392 visible: index !== overflowRepeater.count - 1
393 }
334 }394 }
335 }395 }
336 }396 }
337397
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/PopoverForegroundStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/PopoverForegroundStyle.qml 2013-07-31 12:16:52 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/PopoverForegroundStyle.qml 2014-08-06 16:32:29 +0000
@@ -22,6 +22,7 @@
22 target: styledItem.target22 target: styledItem.target
23 direction: styledItem.direction23 direction: styledItem.direction
24 clipContent: styledItem.clipContent24 clipContent: styledItem.clipContent
25 square: styledItem.square
2526
26 onShowCompleted: styledItem.showCompleted()27 onShowCompleted: styledItem.showCompleted()
27 onHideCompleted: styledItem.hideCompleted()28 onHideCompleted: styledItem.hideCompleted()
2829
=== added file 'modules/Ubuntu/Components/Themes/Ambiance/artwork/header_overflow_dropshadow@27.png'
29Binary 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 differ30Binary 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
=== added file 'modules/Ubuntu/Components/Themes/Ambiance/artwork/header_overflow_dropshadow@27.sci'
--- modules/Ubuntu/Components/Themes/Ambiance/artwork/header_overflow_dropshadow@27.sci 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/artwork/header_overflow_dropshadow@27.sci 2014-08-06 16:32:29 +0000
@@ -0,0 +1,5 @@
1border.left: 27
2border.top: 27
3border.bottom: 27
4border.right: 27
5source: header_overflow_dropshadow@27.png
0\ No newline at end of file6\ No newline at end of file
17
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/qmldir'
--- modules/Ubuntu/Components/Themes/Ambiance/qmldir 2014-07-22 14:20:08 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/qmldir 2014-08-06 16:32:29 +0000
@@ -49,3 +49,4 @@
4949
50internal TextSelectionStartCursorStyle TextSelectionStartCursorStyle.qml50internal TextSelectionStartCursorStyle TextSelectionStartCursorStyle.qml
51internal TextSelectionEndCursorStyle TextSelectionEndCursorStyle.qml51internal TextSelectionEndCursorStyle TextSelectionEndCursorStyle.qml
52internal OverflowPanel OverflowPanel.qml
5253
=== modified file 'modules/Ubuntu/Components/plugin/shapeitem.cpp'
--- modules/Ubuntu/Components/plugin/shapeitem.cpp 2014-08-04 12:53:59 +0000
+++ modules/Ubuntu/Components/plugin/shapeitem.cpp 2014-08-06 16:32:29 +0000
@@ -408,9 +408,9 @@
408408
409void ShapeItem::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry)409void ShapeItem::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry)
410{410{
411 QQuickItem::geometryChanged(newGeometry, oldGeometry);
412 geometry_ = newGeometry;411 geometry_ = newGeometry;
413 dirtyFlags_ |= ShapeItem::DirtyGeometry;412 dirtyFlags_ |= ShapeItem::DirtyGeometry;
413 QQuickItem::geometryChanged(newGeometry, oldGeometry);
414 update();414 update();
415}415}
416416
417417
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2014-07-23 13:27:09 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2014-08-06 16:32:29 +0000
@@ -181,7 +181,7 @@
181181
182 try:182 try:
183 tab_button = self.get_root_instance().select_single(183 tab_button = self.get_root_instance().select_single(
184 'Standard', objectName='tabButton' + str(index))184 objectName='tabButton' + str(index))
185 except dbus.StateNotFoundError:185 except dbus.StateNotFoundError:
186 raise _common.ToolkitException(186 raise _common.ToolkitException(
187 "Tab button {0} not found.".format(index))187 "Tab button {0} not found.".format(index))
@@ -229,8 +229,7 @@
229229
230 # the popover is not a child of the header, so use the root object230 # the popover is not a child of the header, so use the root object
231 # to find the requested button231 # to find the requested button
232 return self.get_root_instance().select_single(232 return self.get_root_instance().select_single(objectName=object_name)
233 'Standard', objectName=object_name)
234233
235234
236class Header(AppHeader):235class Header(AppHeader):
237236
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/components/test_header.py'
--- tests/autopilot/ubuntuuitoolkit/tests/components/test_header.py 2014-07-17 06:38:04 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/components/test_header.py 2014-08-06 16:32:29 +0000
@@ -51,7 +51,6 @@
5151
52 """52 """
53 overflow_popover = self.main_view.select_single(53 overflow_popover = self.main_view.select_single(
54 'Popover',
55 objectName='actions_overflow_popover')54 objectName='actions_overflow_popover')
56 self.header.click_action_button('pushStackAction')55 self.header.click_action_button('pushStackAction')
57 self.assertThat(overflow_popover.visible, Eventually(Equals(False)))56 self.assertThat(overflow_popover.visible, Eventually(Equals(False)))

Subscribers

People subscribed via source and target branches

to status/vote changes: