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

Proposed by Daniel d'Andrada
Status: Merged
Approved by: Zsombor Egri
Approved revision: 1341
Merged at revision: 1362
Proposed branch: lp:~dandrader/ubuntu-ui-toolkit/dontReparentPopup
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 28 lines (+14/-3)
1 file modified
modules/Ubuntu/Components/Popups/PopupBase.qml (+14/-3)
To merge this branch: bzr merge lp:~dandrader/ubuntu-ui-toolkit/dontReparentPopup
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Zsombor Egri Approve
Review via email: mp+242313@code.launchpad.net

This proposal supersedes a proposal from 2014-11-20.

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

Related bug: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1394511

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)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
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

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) wrote :

The changes are good, we have a small problem in staging, let's get back to this when that is fixed.

1341. By Daniel d'Andrada

merge staging

Revision history for this message
Zsombor Egri (zsombi) wrote :

Looks good now, let's wait Jenkins.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/Popups/PopupBase.qml'
2--- modules/Ubuntu/Components/Popups/PopupBase.qml 2014-11-25 15:39:38 +0000
3+++ modules/Ubuntu/Components/Popups/PopupBase.qml 2014-12-03 14:15:34 +0000
4@@ -66,11 +66,22 @@
5 PopupUtils.open() to do it automatically.
6 */
7 function show() {
8- if (!dismissArea)
9- dismissArea = stateWrapper.rootItem
10+
11+ if ((typeof popupBase["reparentToRootItem"]) === "boolean") {
12+ // So the property exists. Let's use it then.
13+ if (reparentToRootItem) {
14+ parent = stateWrapper.rootItem;
15+ }
16+ } else {
17+ // The property does not exist. Default is to reparent
18+ parent = stateWrapper.rootItem;
19+ }
20+
21+ if (!dismissArea) {
22+ dismissArea = parent
23+ }
24
25 // Without setting the parent, mapFromItem() breaks in internalPopupUtils.
26- parent = stateWrapper.rootItem;
27 stateWrapper.state = 'opened';
28 }
29

Subscribers

People subscribed via source and target branches