Merge lp:~tpeeters/ubuntu-ui-toolkit/panelHeight into lp:ubuntu-ui-toolkit/staging

Proposed by Tim Peeters
Status: Merged
Merged at revision: 1155
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/panelHeight
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 107 lines (+28/-5)
3 files modified
CHANGES (+1/-0)
modules/Ubuntu/Components/Panel.qml (+6/-4)
tests/unit_x11/tst_components/tst_panel.qml (+21/-1)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/panelHeight
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Cris Dywan Approve
Andrew Hayzen (community) Approve
Review via email: mp+225493@code.launchpad.net

Description of the change

Don't automatically close a Panel when the user presses next to it, and update Panel position when its height changes.

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

This resolves bug 1336563 for me, using the example branch provided in the bug, thanks Tim :)

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

FAILED: Continuous integration, rev:1139
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/579/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1819/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1531
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/411
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/411
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/411/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/411
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2081/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2904
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/2904/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/9643
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1281
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1718
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1718/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/579/rebuild

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

Please add a test case to verify the position ie. y-coordinate after changing height.

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

FAILED: Continuous integration, rev:1141
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/617/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2136
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1787/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/449
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/449
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/449/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/449
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2355
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3292
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3292/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10006
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1496/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2000
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2000/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/617/rebuild

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

> Please add a test case to verify the position ie. y-coordinate after changing
> height.

Done; ready for review.

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

FAILED: Continuous integration, rev:1142
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/624/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2209
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1842
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/456
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/456
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/456/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/456
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2419
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3384
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3384/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10099
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1546
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2061
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2061/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/624/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Tim Peeters (tpeeters) wrote :
Revision history for this message
Cris Dywan (kalikiana) wrote :

Nice. Thanks!

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

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-autolanding/272/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2239
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/1860
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-autolanding/216
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-autolanding/216
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-autolanding/216/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-autolanding/216
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2442
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3423
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3423/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10136
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1564
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2079
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2079/artifact/work/output/*zip*/output.zip

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 'CHANGES'
2--- CHANGES 2014-06-04 20:45:16 +0000
3+++ CHANGES 2014-07-19 00:10:50 +0000
4@@ -108,6 +108,7 @@
5 * CHANGED IN Page: Automatic detection of flickable inside a Page to control the header is now limited to Flickables that are anchored to the top of the Page or fill the Page. Header automatically shows when flickable.contentHeight becomes <= flickable.height.
6 * CHANGED IN Action, ActionItem, OptionSelectorDelegate: Setting iconName now always selects the requested icon from ubuntu-mobile theme, not the system icon theme.
7 * CHANGED IN TabBar: The model now needs to have a selectedIndex property.
8+* CHANGED IN Panel: The panel no longer closes automatically when the user presses outside of the opened panel. That was deprecated behavior that was useful in the first version of the Toolbar. Set __closeOnContentsClicks to restore the old behavior, but a better solution is to deal with the press in the app and call Panel.close() when needed.
9
10 SDK 0.1.46
11 ##########
12
13=== modified file 'modules/Ubuntu/Components/Panel.qml'
14--- modules/Ubuntu/Components/Panel.qml 2014-04-25 12:53:58 +0000
15+++ modules/Ubuntu/Components/Panel.qml 2014-07-19 00:10:50 +0000
16@@ -443,13 +443,13 @@
17 \internal
18 \deprecated
19 Enable the InverseMouseArea that closes the panel when the user clicks outside of the panel.
20- This functionality moved to the Toolbar/Page implementation because the mouse area needs to
21- access with the toolbar and header, but this InverseMouseArea is still in the Panel for backwards
22- compatibility in apps that use it directly. Default value is true, but it is set to false in Toolbar.
23+ This functionality moved to the MainView to deal with Toolbar hiding, but this InverseMouseArea
24+ is still in the Panel for backwards compatibility in apps that use it directly.
25+ Default value is false.
26
27 FIXME: Remove __closeOnContentsClicks and the IMA below when all apps use Toolbar instead of Panel.
28 */
29- property bool __closeOnContentsClicks: true
30+ property bool __closeOnContentsClicks: false
31 Toolkit.InverseMouseArea {
32 anchors.fill: draggingArea
33 onPressed: {
34@@ -625,6 +625,7 @@
35
36 Item {
37 id: bar
38+ objectName: "bar_item"
39 height: parent.height
40 width: parent.width
41 anchors {
42@@ -637,6 +638,7 @@
43 property real size: internal.orientation === Qt.Horizontal ? height : width
44 //position will always be in the range 0..size, where position==0 means spread, position==size means hidden.
45 property real position: panel.opened ? 0 : size
46+ onSizeChanged: position = panel.opened ? 0 : size
47
48 y: internal.align === Qt.AlignTop ? -position : internal.align === Qt.AlignBottom ? position : 0
49 x: internal.align === Qt.AlignLeft ? -position : internal.align === Qt.AlignRight ? position : 0
50
51=== modified file 'tests/unit_x11/tst_components/tst_panel.qml'
52--- tests/unit_x11/tst_components/tst_panel.qml 2014-04-23 08:50:20 +0000
53+++ tests/unit_x11/tst_components/tst_panel.qml 2014-07-19 00:10:50 +0000
54@@ -17,6 +17,7 @@
55 import QtQuick 2.0
56 import QtTest 1.0
57 import Ubuntu.Components 1.1
58+import Ubuntu.Test 1.0
59
60 Item {
61 width: 200
62@@ -37,7 +38,7 @@
63 }
64 }
65
66- TestCase {
67+ UbuntuTestCase {
68 id: testCase
69 name: "PanelAPI"
70 when: windowShown
71@@ -61,6 +62,21 @@
72 compare(panel.align, Qt.AlignBottom, "Can set align to bottom");
73 }
74
75+ function test_height() {
76+ var bar = findChild(panel, "bar_item");
77+ // panel is not opened
78+ panel.height = 123;
79+ compare(bar.y, 123, "Panel is properly closed after changing height");
80+ panel.open(); wait(500);
81+ compare(bar.y, 0, "Panel opens properly after changing height");
82+ panel.height = 78;
83+ compare(bar.y, 0, "Panel stays propery opened after changing height");
84+ panel.close(); wait(500);
85+ compare(bar.y, 78, "Panel closes properly after changing height");
86+ panel.height = root.height / 2;
87+ compare(bar.y, root.height/2, "Panel stays closed properly after changing height");
88+ }
89+
90 function test_opened() {
91 panel.open();
92 compare(panel.opened, true, "Can set opened");
93@@ -167,10 +183,14 @@
94 }
95
96 function test_clickToDeactivate() {
97+ // deprecated test. This functionality is only there for backwards compatibility
98+ panel.__closeOnContentsClicks = true;
99 panel.open();
100 compare(panel.opened && panel.align === Qt.AlignBottom, true, "Panel is opened and bottom-aligned");
101 mouseClick(root, root.width / 2, 5, Qt.LeftButton);
102 compare(panel.opened, false, "Panel is deactivated by clicking in the view outside of the panel");
103+ // reset property to default value
104+ panel.__closeOnContentsClicks = false;
105 }
106
107 function test_hideTimeout_bug1249031() {

Subscribers

People subscribed via source and target branches