]> git.sesse.net Git - vlc/commit
Fix QToolButtonExt edge cases
authorCheng Sun <chengsun9@gmail.com>
Sat, 17 Dec 2011 21:22:11 +0000 (21:22 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 18 Dec 2011 13:54:55 +0000 (14:54 +0100)
commit5337619228f8d48560601e15caf8affbb4eca3f6
tree6e648620f99c16ffe43956e8d2f524f96d29f3a8
parenta9292296defadfb8dcfd1594b695c5ebaa1a24b8
Fix QToolButtonExt edge cases

Previously QToolButtonExt had some undesirable edge case behaviour.

Firstly, once the user presses down on a QToolButtonExt there is no
way to cancel the action; either a short or a long click will be
generated. Compare this to a normal button, which can be cancelled by
releasing the mouse outside of the button area.

Secondly, with the mouse button held down, moving the mouse in and out
of the button area will generate multiple short click events, when no
event at all is desired.

This patch corrects this: by releasing the mouse outside the button area
no event is generated; additionally no short click events are generated
simply by moving the depressed mouse in and out of the button.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/qt4/util/customwidgets.cpp
modules/gui/qt4/util/customwidgets.hpp