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

Proposed by Zsombor Egri
Status: Merged
Approved by: Cris Dywan
Approved revision: 1016
Merged at revision: 1022
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/popover-dismiss-buttons
Merge into: lp:ubuntu-ui-toolkit/staging
Prerequisite: lp:~zsombi/ubuntu-ui-toolkit/textinput-text-selection
Diff against target: 111 lines (+85/-0)
3 files modified
modules/Ubuntu/Components/Popups/Popover.qml (+1/-0)
modules/Ubuntu/Components/Popups/PopupBase.qml (+1/-0)
tests/unit_x11/tst_components/tst_popover.qml (+83/-0)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/popover-dismiss-buttons
Reviewer Review Type Date Requested Status
Cris Dywan Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+216006@code.launchpad.net

Commit message

Dismiss Popovers when any of the mouse buttons is pressed.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1013. By Zsombor Egri

prereq merge

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

test fix

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

This looks to do the job well.

review: Approve
1015. By Zsombor Egri

prereq merge

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:1015
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/91/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-trusty-touch/417
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/5041
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-trusty-amd64-ci/91
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-trusty-armhf-ci/91
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-trusty-armhf-ci/91/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-trusty-i386-ci/91
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/379
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4663
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4663/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/6383
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/4339
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/5230
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/5230/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/91/rebuild

review: Approve (continuous-integration)
1016. By Zsombor Egri

prereq sync

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:1016
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/100/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-trusty-touch/433
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/5057
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-trusty-amd64-ci/100
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-trusty-armhf-ci/100
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-trusty-armhf-ci/100/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-trusty-i386-ci/100
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/390
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4680
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/4680/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/6401
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/4351
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/5246
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/5246/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/100/rebuild

review: Approve (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) wrote :

I can't fully run the tests due to "QIODevice::write: device not open" failing tst_expandablescolumn.qml, but it seems to work, and J likes ot.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/Popups/Popover.qml'
2--- modules/Ubuntu/Components/Popups/Popover.qml 2014-04-20 19:25:12 +0000
3+++ modules/Ubuntu/Components/Popups/Popover.qml 2014-04-25 05:30:32 +0000
4@@ -204,6 +204,7 @@
5
6 StyledItem {
7 id: foreground
8+ objectName: "popover_foreground"
9
10 //styling properties
11 property real minimumWidth: units.gu(40)
12
13=== modified file 'modules/Ubuntu/Components/Popups/PopupBase.qml'
14--- modules/Ubuntu/Components/Popups/PopupBase.qml 2014-04-20 19:25:12 +0000
15+++ modules/Ubuntu/Components/Popups/PopupBase.qml 2014-04-25 05:30:32 +0000
16@@ -142,6 +142,7 @@
17 InverseMouseArea {
18 id: eventGrabber
19 enabled: true
20+ acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
21 anchors.fill: __foreground
22 sensingArea: dismissArea
23 propagateComposedEvents: !grabDismissAreaEvents
24
25=== added file 'tests/unit_x11/tst_components/tst_popover.qml'
26--- tests/unit_x11/tst_components/tst_popover.qml 1970-01-01 00:00:00 +0000
27+++ tests/unit_x11/tst_components/tst_popover.qml 2014-04-25 05:30:32 +0000
28@@ -0,0 +1,83 @@
29+/*
30+ * Copyright 2014 Canonical Ltd.
31+ *
32+ * This program is free software; you can redistribute it and/or modify
33+ * it under the terms of the GNU Lesser General Public License as published by
34+ * the Free Software Foundation; version 3.
35+ *
36+ * This program is distributed in the hope that it will be useful,
37+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
38+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39+ * GNU Lesser General Public License for more details.
40+ *
41+ * You should have received a copy of the GNU Lesser General Public License
42+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
43+ */
44+import QtQuick 2.0
45+import QtTest 1.0
46+import Ubuntu.Test 0.1
47+import Ubuntu.Components 0.1
48+import Ubuntu.Components.Popups 0.1
49+
50+MainView {
51+ id: main
52+ width: units.gu(40)
53+ height: units.gu(71)
54+
55+ Button {
56+ id: caller
57+ anchors.centerIn: parent
58+ text: "Press me"
59+ onClicked: {
60+ var popover = PopupUtils.open(popoverComponent, caller);
61+ popoverSpy.target = testCase.findChild(popover, "popover_foreground");
62+ popoverSpy.clear();
63+ }
64+ }
65+
66+ // spy to listen on the popover foreground's hideCompleted() signal
67+ SignalSpy {
68+ id: popoverSpy
69+ signalName: "hideCompleted"
70+ }
71+
72+ Component {
73+ id: popoverComponent
74+ Popover {
75+ objectName: "popover"
76+ Rectangle {
77+ width: units.gu(20)
78+ height: units.gu(20)
79+ color: "blue"
80+ }
81+ }
82+ }
83+
84+ UbuntuTestCase {
85+ id: testCase
86+ name: "PopoverTests"
87+ when: windowShown
88+
89+ function cleanup() {
90+ popoverSpy.target = null;
91+ popoverSpy.clear();
92+ }
93+
94+ function test_dismiss_on_click_data() {
95+ return [
96+ {button: Qt.LeftButton},
97+ {button: Qt.MiddleButton},
98+ {button: Qt.RightButton},
99+ ];
100+ }
101+
102+ function test_dismiss_on_click(data) {
103+ mouseClick(caller, caller.width / 2, caller.height / 2);
104+ waitForRendering(caller);
105+ verify(popoverSpy.target !== null, "The popover did not open");
106+ // dismiss
107+ mouseClick(main, 10, 10, data.button);
108+ popoverSpy.wait();
109+ }
110+ }
111+}

Subscribers

People subscribed via source and target branches