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

Proposed by Daniel d'Andrada
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
Ubuntu SDK team 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

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.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1339. By Daniel d'Andrada

Make it a hidden property

1340. By Daniel d'Andrada

Remove it from components.api

1341. By Daniel d'Andrada

merge staging

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'components.api'
--- components.api 2014-10-01 21:20:06 +0000
+++ components.api 2014-11-20 07:34:01 +0000
@@ -377,6 +377,7 @@
377OrientationHelper377OrientationHelper
378 property Item dismissArea378 property Item dismissArea
379 property bool grabDismissAreaEvents379 property bool grabDismissAreaEvents
380 property bool reparentToRootItem
380 property PropertyAnimation fadingAnimation381 property PropertyAnimation fadingAnimation
381 function show()382 function show()
382 function hide()383 function hide()
383384
=== modified file 'modules/Ubuntu/Components/Popups/PopupBase.qml'
--- modules/Ubuntu/Components/Popups/PopupBase.qml 2014-08-22 15:02:28 +0000
+++ modules/Ubuntu/Components/Popups/PopupBase.qml 2014-11-20 07:34:01 +0000
@@ -42,6 +42,11 @@
42 property bool grabDismissAreaEvents: true42 property bool grabDismissAreaEvents: true
4343
44 /*!44 /*!
45 Whether it should reparent itself to the scene's root item. The default is true.
46 */
47 property bool reparentToRootItem: true
48
49 /*!
45 \internal50 \internal
46 FIXME: publish this property once agreed51 FIXME: publish this property once agreed
47 */52 */
@@ -67,11 +72,15 @@
67 PopupUtils.open() to do it automatically.72 PopupUtils.open() to do it automatically.
68 */73 */
69 function show() {74 function show() {
70 if (!dismissArea)75 if (reparentToRootItem) {
71 dismissArea = stateWrapper.rootItem76 parent = stateWrapper.rootItem;
77 }
78
79 if (!dismissArea) {
80 dismissArea = parent
81 }
7282
73 // Without setting the parent, mapFromItem() breaks in internalPopupUtils.83 // Without setting the parent, mapFromItem() breaks in internalPopupUtils.
74 parent = stateWrapper.rootItem;
75 stateWrapper.state = 'opened';84 stateWrapper.state = 'opened';
76 }85 }
7786

Subscribers

People subscribed via source and target branches

to status/vote changes: