Merge lp:~jjed/unity/tooltips-redux into lp:unity
Status: | Merged |
---|---|
Approved by: | Stephen M. Webb |
Approved revision: | no longer in the source branch. |
Merged at revision: | 3191 |
Proposed branch: | lp:~jjed/unity/tooltips-redux |
Merge into: | lp:unity |
Diff against target: |
564 lines (+356/-36) 11 files modified
launcher/AbstractLauncherIcon.h (+1/-0) launcher/CMakeLists.txt (+1/-0) launcher/Launcher.cpp (+21/-24) launcher/Launcher.h (+3/-0) launcher/LauncherIcon.cpp (+0/-11) launcher/MockLauncherIcon.h (+5/-1) launcher/TooltipManager.cpp (+126/-0) launcher/TooltipManager.h (+57/-0) tests/CMakeLists.txt (+1/-0) tests/autopilot/unity/tests/launcher/test_tooltips.py (+87/-0) tests/test_tooltip_manager.cpp (+54/-0) |
To merge this branch: | bzr merge lp:~jjed/unity/tooltips-redux |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Stephen M. Webb (community) | Approve | ||
Marco Trevisan (Treviño) | Approve | ||
Jjed (community) | Needs Resubmitting | ||
Thomi Richards | Pending | ||
Review via email: mp+150942@code.launchpad.net |
Commit message
Add a 1s delay between hovering on a launcher icon and showing its tooltip.
Further tooltips before clicking or unhovering launcher will appear instantly.
Description of the change
== Problem
There is currently no delay between hovering on a Launcher icon and displaying its tooltip.
This proposal supercedes the (long defunct) lp:~j-johan-edwards/unity/tooltip-delay/ merge proposal.
== Fix implementation
I've removed the ability of `LauncherIcon` to prompt its own tooltip display. Instead, a new object `TooltipManager`
(notified of events by a monitor's `Launcher`) controls launcher tooltip logic according to a `_hover_timer` which resets on mouse movement. A `LauncherIcon` may refuse to display based on its local condition (eg if it is the BFB and active, or being dragged).
Clicking an icon causes its tooltip to disappear, and the `_hover_clock` to be "locked" until the mouse moves to another icon. This behavior feels right to me (as otherwise tooltips appear while you hover over an app you just clicked, waiting for it to open) but I'm open to changing it.
Tooltip delay is 1s per lp:#687956. Let me know if the design has changed.
== Testing
There are three new autopilot tests in `test_tooltips`. Dash tooltip behavior is further tested in `test_icon_
`autopilot run unity.tests.
== Old feedback
I'm using `assertTrue` in my tooltips test because the behavior tested is time-specific, and `assertThat(.... Eventually(
(1) Please fix the copyright dates in the new source files.
(2) Please do not prepend an underscore wart to indicate a member variable: the Unity style is to use appended underscore warts.
(3) You need to add a commit message to this MP.
Other than that, this seems OK.