Merge lp:~tpeeters/ubuntu-ui-toolkit/toolbar-closes-tabbar2 into lp:ubuntu-ui-toolkit

Proposed by Tim Peeters
Status: Merged
Approved by: Cris Dywan
Approved revision: 880
Merged at revision: 869
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/toolbar-closes-tabbar2
Merge into: lp:ubuntu-ui-toolkit
Prerequisite: lp:~tpeeters/ubuntu-ui-toolkit/tabbar-closes-toolbar2
Diff against target: 110 lines (+47/-0)
4 files modified
components.api (+1/-0)
modules/Ubuntu/Components/MainView.qml (+6/-0)
modules/Ubuntu/Components/Panel.qml (+10/-0)
tests/unit_x11/tst_components/tst_hide_chrome.qml (+30/-0)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/toolbar-closes-tabbar2
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Cris Dywan Approve
Review via email: mp+196916@code.launchpad.net

Description of the change

Close tabbar on toolbar interaction

To post a comment you must log in.
873. By Tim Peeters

improve comment

874. By Tim Peeters

remove a blank line

875. By Tim Peeters

remove unused helper function

876. By Tim Peeters

put blank line back. no reason to change it

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
877. By Tim Peeters

unchanged.

Revision history for this message
Cris Dywan (kalikiana) wrote :

Please update components.api. For the record, it's odd that you have to pass defaults to mouseClick/Press/Release functions but let's not worry about that it just makes the tests more verbose but they're good otherwise.

review: Approve
878. By Tim Peeters

update components.api

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
879. By Tim Peeters

merge trunk

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

fix for occasional local failures of make check

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

Tested on maguro. Apps work, and UITK AP tests pass. Ready for happroval.

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: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components.api'
2--- components.api 2013-11-25 21:52:03 +0000
3+++ components.api 2013-11-27 19:20:48 +0000
4@@ -173,6 +173,7 @@
5 property real triggerSize
6 readonly property bool animating
7 property bool __closeOnContentsClicks
8+ property bool pressed
9 modules/Ubuntu/Components/ProgressBar.qml
10 AnimatedItem
11 property bool indeterminate
12
13=== modified file 'modules/Ubuntu/Components/MainView.qml'
14--- modules/Ubuntu/Components/MainView.qml 2013-11-27 11:06:15 +0000
15+++ modules/Ubuntu/Components/MainView.qml 2013-11-27 19:20:48 +0000
16@@ -294,6 +294,12 @@
17
18 Toolbar {
19 id: toolbarItem
20+ onPressedChanged: {
21+ if (!pressed) return;
22+ if (headerItem.tabBar !== null) {
23+ headerItem.tabBar.selectionMode = false;
24+ }
25+ }
26 }
27
28 /*!
29
30=== modified file 'modules/Ubuntu/Components/Panel.qml'
31--- modules/Ubuntu/Components/Panel.qml 2013-10-28 14:46:05 +0000
32+++ modules/Ubuntu/Components/Panel.qml 2013-11-27 19:20:48 +0000
33@@ -420,6 +420,16 @@
34 visible: panel.__closeOnContentsClicks && panel.locked == false && panel.state == "spread"
35 }
36
37+ /*!
38+ The user presses on the opened toolbar, or when the toolbar is closed but
39+ not locked, the user presses in the toolbar trigger area.
40+ \qmlproperty bool pressed
41+ */
42+ // This is a simple alias to draggingArea.pressed, but the documentation is accurate
43+ // because of the visible definition of draggingArea. Pressed is false when draggingArea
44+ // is not visible.
45+ property alias pressed: draggingArea.pressed
46+
47 DraggingArea {
48 id: draggingArea
49 orientation: internal.orientation === Qt.Horizontal ? Qt.Vertical : Qt.Horizontal
50
51=== modified file 'tests/unit_x11/tst_components/tst_hide_chrome.qml'
52--- tests/unit_x11/tst_components/tst_hide_chrome.qml 2013-11-27 10:59:03 +0000
53+++ tests/unit_x11/tst_components/tst_hide_chrome.qml 2013-11-27 19:20:48 +0000
54@@ -40,6 +40,7 @@
55
56 tools: ToolbarItems {
57 ToolbarButton {
58+ id: toolbarButton
59 text: "something"
60 }
61 }
62@@ -64,6 +65,7 @@
63 var toolbar = mainView.__propagated.toolbar;
64 toolbar.open();
65 compare(toolbar.opened, true, "Cannot open toolbar using open()");
66+ wait(UbuntuAnimation.FastDuration); // wait for the open animation to finish
67 return toolbar;
68 }
69
70@@ -73,6 +75,7 @@
71 compare(tabBar, header.contents, "TabBar is not the active header contents");
72 header.show();
73 tabBar.selectionMode = newSelectionMode;
74+ compare(tabBar.selectionMode, newSelectionMode, "Failed to set the tab bar selection mode");
75 return tabBar;
76 }
77
78@@ -82,5 +85,32 @@
79 testCase.setTabBarSelectionMode(true);
80 compare(toolbar.opened, false, "Activating TabBar did not close toolbar");
81 }
82+
83+ function test_toolbar_press_closes_tabBar_bug1223606 () {
84+ var tabBar = testCase.setTabBarSelectionMode(true);
85+ var toolbar = testCase.openToolbar();
86+ testCase.mouseClick(toolbarButton,
87+ toolbarButton.width/2, toolbarButton.height/2,
88+ Qt.LeftButton);
89+ compare(tabBar.selectionMode, false,
90+ "Clicking a toolbar button does not disable tab bar selection mode");
91+
92+ toolbar.open();
93+ testCase.setTabBarSelectionMode(true);
94+ testCase.mousePress(toolbar, toolbar.width/2, toolbar.height/2, Qt.LeftButton);
95+ compare(tabBar.selectionMode, false, "Pressing the toolbar does not disable tab bar selection mode");
96+ testCase.mouseRelease(toolbar, toolbar.width/2, toolbar.height/2, Qt.LeftButton);
97+
98+ toolbar.close();
99+ testCase.setTabBarSelectionMode(true);
100+ testCase.mousePress(mainView,
101+ mainView.width/2, mainView.height - toolbar.triggerSize/2,
102+ Qt.LeftButton);
103+ compare(tabBar.selectionMode, false,
104+ "Triggering the toolbar hint does not disable tab selection mode");
105+ testCase.mouseRelease(mainView,
106+ mainView.width/2, mainView.height - toolbar.triggerSize/2,
107+ Qt.LeftButton);
108+ }
109 }
110 }

Subscribers

People subscribed via source and target branches

to status/vote changes: