Merge lp:~zsombi/ubuntu-ui-toolkit/popover-dismiss-timeout into lp:ubuntu-ui-toolkit

Proposed by Zsombor Egri
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 349
Merged at revision: 353
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/popover-dismiss-timeout
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 127 lines (+54/-4)
3 files modified
modules/Ubuntu/Components/Popups/PopupBase.qml (+48/-3)
modules/Ubuntu/Components/Popups/popupUtils.js (+0/-1)
themes/Ambiance/qmltheme/default.qmltheme (+6/-0)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/popover-dismiss-timeout
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Tim Peeters Approve
Review via email: mp+148207@code.launchpad.net

Commit message

Closing timeout handling added to all popups. Popovers, Sheets and Dialogs now have themable (200 ms) delay before they get closed.

Description of the change

Closing timeout handling added to all popups. Popovers, Sheets and Dialogs now have themable (200 ms) delay before they get closed.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Tim Peeters (tpeeters) wrote :

when I close a dialog or sheet, this works fine. When, in the showcase, I close a popover by clicking the "close" button the delay is also there, but there is no delay when I click next to the popover to close it.

review: Needs Fixing
Revision history for this message
Tim Peeters (tpeeters) wrote :

If it is a small change, we could combine this MR with solving this: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1122153

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

> when I close a dialog or sheet, this works fine. When, in the showcase, I
> close a popover by clicking the "close" button the delay is also there, but
> there is no delay when I click next to the popover to close it.

Initally it was like that. I asked yesterday explicity from Oren, he said that the delay should be applied only when dismissed by an action, from inside.

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

> when I close a dialog or sheet, this works fine. When, in the showcase, I
> close a popover by clicking the "close" button the delay is also there, but
> there is no delay when I click next to the popover to close it.

Initally it was like that. I asked yesterday explicity from Oren, he said that the delay should be applied only when dismissed by an action, from inside.

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

> If it is a small change, we could combine this MR with solving this:
> https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1122153

Done so. And two bugs also synced, timeout (fade-out) is applied no matter of ho the popover is closed.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Tim Peeters (tpeeters) wrote :

good :)

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (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 2013-02-12 10:31:32 +0000
3+++ modules/Ubuntu/Components/Popups/PopupBase.qml 2013-02-14 12:55:24 +0000
4@@ -65,7 +65,7 @@
5
6 // Without setting the parent, mapFromItem() breaks in internalPopupUtils.
7 parent = dismissArea;
8- popupBase.visible = true;
9+ internal.state = 'opening';
10 }
11
12 /*!
13@@ -75,7 +75,7 @@
14 PopupUtils.close() to do it automatically.
15 */
16 function hide() {
17- popupBase.visible = false;
18+ internal.state = 'closing';
19 }
20
21 /*!
22@@ -84,7 +84,7 @@
23 onVisibleChanged is connected to __closeIfHidden().
24 */
25 function __closeIfHidden() {
26- if (!visible) PopupUtils.close(popupBase);
27+ if (!visible) popupBase.destroy();
28 }
29
30 /*!
31@@ -136,10 +136,55 @@
32 anchors.fill: __foreground
33 sensingArea: dismissArea
34 propagateComposedEvents: !grabDismissAreaEvents
35+ // if dismiss is active, delete the popup immediately
36 onPressed: if (__closeOnDismissAreaPress) popupBase.hide()
37 }
38
39 MouseArea {
40 anchors.fill: __foreground
41 }
42+
43+ Item {
44+ id: internal
45+ states: [
46+ State {
47+ name: 'closing'
48+ },
49+ State {
50+ name: 'opening'
51+ }
52+ ]
53+ transitions: [
54+ Transition {
55+ from: ""
56+ to: "opening"
57+ SequentialAnimation {
58+ NumberAnimation {
59+ target: popupBase
60+ property: "opacity"
61+ from: 0.0
62+ to: 1.0
63+ duration: Theming.ComponentUtils.style(popupBase, "dismissDelay", 0)
64+ easing.type: Theming.ComponentUtils.style(popupBase, "dismissEasing", 0)
65+ }
66+ ScriptAction { script: popupBase.visible = true; }
67+ }
68+ },
69+ Transition {
70+ from: "opening"
71+ to: "closing"
72+ SequentialAnimation {
73+ NumberAnimation {
74+ target: popupBase
75+ property: "opacity"
76+ from: 1.0
77+ to: 0.0
78+ duration: Theming.ComponentUtils.style(popupBase, "dismissDelay", 0)
79+ easing.type: Theming.ComponentUtils.style(popupBase, "dismissEasing", 0)
80+ }
81+ ScriptAction { script: popupBase.visible = false; }
82+ }
83+ }
84+ ]
85+ }
86 }
87
88=== modified file 'modules/Ubuntu/Components/Popups/popupUtils.js'
89--- modules/Ubuntu/Components/Popups/popupUtils.js 2013-02-12 09:36:26 +0000
90+++ modules/Ubuntu/Components/Popups/popupUtils.js 2013-02-14 12:55:24 +0000
91@@ -64,5 +64,4 @@
92 */
93 function close(popupObject) {
94 popupObject.hide();
95- popupObject.destroy();
96 }
97
98=== modified file 'themes/Ambiance/qmltheme/default.qmltheme'
99--- themes/Ambiance/qmltheme/default.qmltheme 2013-02-14 11:52:22 +0000
100+++ themes/Ambiance/qmltheme/default.qmltheme 2013-02-14 12:55:24 +0000
101@@ -181,6 +181,8 @@
102 dim: false;
103 edgeMargins: units.gu(2);
104 callerMargin: units.gu(1);
105+ dismissDelay: 50;
106+ dismissEasing: Easing.OutQuad;
107 }
108
109 .popover .foreground {
110@@ -195,6 +197,8 @@
111
112 .sheet {
113 dim: false;
114+ dismissDelay: 50;
115+ dismissEasing: Easing.OutQuad;
116 }
117 .sheet .foreground {
118 headerColor: "darkgray";
119@@ -209,6 +213,8 @@
120 dimOpacity: 0.6;
121 edgeMargins: units.gu(2);
122 callerMargin: units.gu(1);
123+ dismissDelay: 50;
124+ dismissEasing: Easing.OutQuad;
125 }
126 .dialog .foreground {
127 minimumWidth: units.gu(40);

Subscribers

People subscribed via source and target branches

to status/vote changes: