Merge lp://qastaging/~mardy/unity-2d/treat-double-clicks-as-single into lp://qastaging/unity-2d/3.0
Status: | Merged |
---|---|
Approved by: | Florian Boucault |
Approved revision: | 580 |
Merged at revision: | 577 |
Proposed branch: | lp://qastaging/~mardy/unity-2d/treat-double-clicks-as-single |
Merge into: | lp://qastaging/unity-2d/3.0 |
Diff against target: |
233 lines (+134/-27) 6 files modified
launcher/ListViewDragAndDrop.qml (+26/-9) panel/applets/CMakeLists.txt (+1/-0) panel/applets/homebutton/homebutton.cpp (+61/-0) panel/applets/homebutton/homebutton.h (+43/-0) panel/applets/homebutton/homebuttonapplet.cpp (+1/-14) panel/applets/homebutton/homebuttonapplet.h (+2/-4) |
To merge this branch: | bzr merge lp://qastaging/~mardy/unity-2d/treat-double-clicks-as-single |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Florian Boucault (community) | Approve | ||
Review via email:
|
Commit message
[panel & launcher] Consider double clicks as single clicks for launcher items and the home button of the panel (bfb).
For the panel created HomeButton class: specialized subclass of QToolButton, handling double clicks as single clicks.
For the launcher, ignored DoubleClicked signal and added a workaround that separates click resulting from the end of a drag and drop from regular clicks.
Description of the change
Proposed fix for bug 766776.
For the BFB, use a QTime instance to track the elapsed time since the last click. I initially tried hacking around a reimplementation of the virtual mouseDoubleClic
For the launcher, I wasted some time in figuring out that the onClicked() slot in the MouseArea in LauncherItem.qml is never emitted (should we add a comment next to it, to avoid someone else to spend time in figuring out that as well?): this is because the LauncherItem is part of a bigger MouseArea (the one in ListViewDragAnd
I initially tried to set the mouse.accepted property to false in the outer MouseArea, and I could fix the double-click problem in LauncherItem very nicely. But this broke the DnD, because after setting the mouse.accepted property to false, the ListViewDragAndDrop would not be notified for the next mouse move and release events.
So, though quite ugly, the ignoreNextClick flag is the only workaround I could think of. QtQuick 2.0 will probably help in solving this better [http://
Functionally, the intended behaviour of ignoring double clicks works fine both in the launcher and for the home button.
However the home button exhibits an issue. Its visual state is not always synchronised with the state of the dash: sometimes the dash is shown but the button is visually not pressed. Steps to reproduce:
1. launch the panel
2. click on the home button
3. wait just enough time for the dash to appear but less than the doubleClickInterval (looks like around 500 ms here)
4. click again on the home button
Result: the home button is visually unpressed but the dash stays. ::nextCheckStat e.
Debugging a little shows that the second clicked is caught and properly ignored. However the checked state of the button is toggled. This behaviour is internal to QAbstractButton and should be overridable by reimplementing QAbstractButton