Merge lp:~tpeeters/ubuntu-ui-toolkit/09-desktop-toolbar into lp:ubuntu-ui-toolkit

Proposed by Tim Peeters
Status: Merged
Approved by: Zsombor Egri
Approved revision: 957
Merged at revision: 1002
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/09-desktop-toolbar
Merge into: lp:ubuntu-ui-toolkit
Prerequisite: lp:~tpeeters/ubuntu-ui-toolkit/optIn-newHeader
Diff against target: 99 lines (+33/-1)
3 files modified
components.api (+1/-0)
modules/Ubuntu/Components/Panel.qml (+29/-1)
modules/Ubuntu/Components/Toolbar.qml (+3/-0)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/09-desktop-toolbar
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Zsombor Egri Approve
Review via email: mp+213645@code.launchpad.net

This proposal supersedes a proposal from 2014-04-01.

Commit message

Improve toolbar handling on desktop by opening it on mouse hover.

Description of the change

Improve toolbar handling on desktop by opening it on mouse hover.

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

mark properties that will be removed as deprecated

953. By Tim Peeters

comment

954. By Tim Peeters

update components.api

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

Tested on mako with image 272:
- Manually tested gallery-app, system-settings, camera-app.
- AP tests for address-book-app, messaging-app OK.

gallery-app tests fail with
File "/home/phablet/autopilot/gallery_app/emulators/main_screen.py", line 9, in <module>
from toolbar import Toolbar
ImportError: No module named 'toolbar' http://paste.ubuntu.com/7190772/
see http://paste.ubuntu.com/7190772/
This seems like a problem in gallery-app. See elopio's fix: https://code.launchpad.net/~elopio/gallery-app/override_toolbar/+merge/213703

There was one failure with unity8: http://paste.ubuntu.com/7191141/

Still need to run UITK tests.

955. By Tim Peeters

merge trunk

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

unity AP test results:

Ran 38 tests in 1417.559s
OK
Restoring shell
unity8 start/running, process 11981

UITK AP test results:

Ran 148 tests in 939.315s
OK

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

kick jenkins

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)
957. By Tim Peeters

re-kick

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

Good stuff ;)

review: Approve
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 2014-03-14 16:11:00 +0000
3+++ components.api 2014-04-03 12:48:05 +0000
4@@ -257,6 +257,7 @@
5 property bool animate
6 readonly property bool animating
7 property bool __closeOnContentsClicks
8+ property bool __openOnHover
9 property bool pressed
10 modules/Ubuntu/Components/Pickers/DatePicker.qml
11 StyledItem
12
13=== modified file 'modules/Ubuntu/Components/Panel.qml'
14--- modules/Ubuntu/Components/Panel.qml 2014-03-31 18:26:22 +0000
15+++ modules/Ubuntu/Components/Panel.qml 2014-04-03 12:48:05 +0000
16@@ -441,12 +441,13 @@
17
18 /*!
19 \internal
20+ \deprecated
21 Enable the InverseMouseArea that closes the panel when the user clicks outside of the panel.
22 This functionality moved to the Toolbar/Page implementation because the mouse area needs to
23 access with the toolbar and header, but this InverseMouseArea is still in the Panel for backwards
24 compatibility in apps that use it directly. Default value is true, but it is set to false in Toolbar.
25
26- FIXME: Remove __detectContentsClicks and the IMA below when all apps use Toolbar instead of Panel.
27+ FIXME: Remove __closeOnContentsClicks and the IMA below when all apps use Toolbar instead of Panel.
28 */
29 property bool __closeOnContentsClicks: true
30 Toolkit.InverseMouseArea {
31@@ -462,6 +463,16 @@
32 }
33
34 /*!
35+ \internal
36+ \deprecated
37+ Enable automatic reveal of panel on mouse hover over hint area, and hide when leaving
38+ the panel area. This is disabled by default, because Panel may be used to implement
39+ bottom edge behaviors that are completely different from the toolbar, but the property
40+ is enabled in Toolbar to make more usable on desktop.
41+ */
42+ property bool __openOnHover: false
43+
44+ /*!
45 The user presses on the opened toolbar, or when the toolbar is closed but
46 not locked, the user presses in the toolbar trigger area.
47 \qmlproperty bool pressed
48@@ -484,6 +495,7 @@
49 height: internal.orientation === Qt.Horizontal ? panel.opened ? bar.size + units.gu(1) : panel.triggerSize : undefined
50 width: internal.orientation === Qt.Vertical ? panel.opened ? bar.size + units.gu(1) : panel.triggerSize : undefined
51 visible: !panel.locked || panel.opened
52+ hoverEnabled: panel.__openOnHover
53
54 property int mousePosition: getMousePosition()
55 function getMousePosition() {
56@@ -541,6 +553,7 @@
57 property real dragThreshold: units.gu(1)
58
59 onPositionChanged: {
60+ if (!pressed) return;
61 if (panel.locked) return;
62 if (panel.state == "hint" && mousePosition < initialPosition - dragThreshold) {
63 internal.previousState = "hint";
64@@ -569,6 +582,21 @@
65 }
66 }
67
68+ onEntered: {
69+ // panel.__openOnHover
70+ panel.open();
71+ hideTimer.stop();
72+ }
73+
74+ onExited: {
75+ // panel.__openOnHover
76+ // Ensure the panel is not still opening. The draggingArea will
77+ // change after the panel finishes the opening animation.
78+ if (!animating) {
79+ hideTimer.conditionalRestart();
80+ }
81+ }
82+
83 // FIXME: Make all parameters below themable and resolution-independent.
84 // The value of 44 was copied from the Launcher.
85 function finishMoving() {
86
87=== modified file 'modules/Ubuntu/Components/Toolbar.qml'
88--- modules/Ubuntu/Components/Toolbar.qml 2014-03-06 13:49:52 +0000
89+++ modules/Ubuntu/Components/Toolbar.qml 2014-04-03 12:48:05 +0000
90@@ -39,6 +39,9 @@
91 // Closing of the toolbar on app contents interaction is handled by the Page.
92 __closeOnContentsClicks: false
93
94+ // Open toolbar on hover (for desktop only)
95+ __openOnHover: true
96+
97 /*!
98 \preliminary
99 The list of \l Actions to be shown on the toolbar

Subscribers

People subscribed via source and target branches

to status/vote changes: