Merge lp:~dandrader/ubuntu-ui-toolkit/dontReparentPopup into lp:ubuntu-ui-toolkit

Proposed by Daniel d'Andrada on 2014-11-20
Status: Superseded
Proposed branch: lp:~dandrader/ubuntu-ui-toolkit/dontReparentPopup
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 45 lines (+13/-3)
2 files modified
components.api (+1/-0)
modules/Ubuntu/Components/Popups/PopupBase.qml (+12/-3)
To merge this branch: bzr merge lp:~dandrader/ubuntu-ui-toolkit/dontReparentPopup
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing on 2014-11-20
Ubuntu SDK team 2014-11-20 Pending
Review via email: mp+242312@code.launchpad.net

This proposal has been superseded by a proposal from 2014-11-20.

Commit message

Added PopupBase.reparentToRootItem property

Some applications need Popups to behave as regular items and therefore
remain as children of their original parents (ie, no reparenting
to scene's root item behind the scenes).

This is the case when an application does its own UI rotation (which includes
any dialogs it might be displaying) where Popups should follow its parent
transformations (rotations) and resizes or when it doesn't want the Popup to cover
its entire scene.

Description of the change

This is needed by unity8 for the "shell rotation" feature (ie shell does all the rotation work instead of apps rotating themselves). unity8's dialogs (like the power dialog when you long press the power button) should follow its parent item rotation and size, as one would expect, and not be sneakily reparented to the scene root item, in which case the shell UI would be rotated but its dialog would not.

PPA with shell rotation:
https://launchpad.net/~unity-team/+archive/ubuntu/demo-stuff

And this is how unity8 is using Dialogs:
http://bazaar.launchpad.net/~unity-team/unity8/shellRotation/view/head:/qml/Components/Dialogs.qml

To post a comment you must log in.
1338. By Daniel d'Andrada on 2014-11-20

Added PopupBase.reparentToRootItem property

Some applications need Popups to behave as regular items and therefore
remain as children of their original parents (ie, no reparenting
to scene's root item behind the scenes).

This is the case when an application does its own UI rotation (which includes
any dialogs it might be displaying) where Popups should follow its parent
transformations (rotations) and resizes or when it doesn't want the Popup to cover
its entire scene.

PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1339. By Daniel d'Andrada on 2014-11-27

Make it a hidden property

1340. By Daniel d'Andrada on 2014-11-27

Remove it from components.api

1341. By Daniel d'Andrada on 2014-12-03

merge staging

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components.api'
2--- components.api 2014-10-01 21:20:06 +0000
3+++ components.api 2014-11-20 07:34:01 +0000
4@@ -377,6 +377,7 @@
5 OrientationHelper
6 property Item dismissArea
7 property bool grabDismissAreaEvents
8+ property bool reparentToRootItem
9 property PropertyAnimation fadingAnimation
10 function show()
11 function hide()
12
13=== modified file 'modules/Ubuntu/Components/Popups/PopupBase.qml'
14--- modules/Ubuntu/Components/Popups/PopupBase.qml 2014-08-22 15:02:28 +0000
15+++ modules/Ubuntu/Components/Popups/PopupBase.qml 2014-11-20 07:34:01 +0000
16@@ -42,6 +42,11 @@
17 property bool grabDismissAreaEvents: true
18
19 /*!
20+ Whether it should reparent itself to the scene's root item. The default is true.
21+ */
22+ property bool reparentToRootItem: true
23+
24+ /*!
25 \internal
26 FIXME: publish this property once agreed
27 */
28@@ -67,11 +72,15 @@
29 PopupUtils.open() to do it automatically.
30 */
31 function show() {
32- if (!dismissArea)
33- dismissArea = stateWrapper.rootItem
34+ if (reparentToRootItem) {
35+ parent = stateWrapper.rootItem;
36+ }
37+
38+ if (!dismissArea) {
39+ dismissArea = parent
40+ }
41
42 // Without setting the parent, mapFromItem() breaks in internalPopupUtils.
43- parent = stateWrapper.rootItem;
44 stateWrapper.state = 'opened';
45 }
46

Subscribers

People subscribed via source and target branches

to status/vote changes: