1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-16 19:14:06 +02:00

Allow clicking on any part of the button

This commit is contained in:
Leo Franchi
2012-08-20 16:53:26 -04:00
parent e5059aa997
commit f7b357bb29

View File

@@ -118,7 +118,7 @@ SlideSwitchButton::mousePressEvent( QMouseEvent* e )
void void
SlideSwitchButton::mouseReleaseEvent( QMouseEvent* e ) SlideSwitchButton::mouseReleaseEvent( QMouseEvent* e )
{ {
const int delta = e->pos().x() - m_mouseDownPos.x(); const int delta = m_mouseDownPos.isNull() ? 0 : e->pos().x() - m_mouseDownPos.x();
m_mouseDownPos = QPoint(); m_mouseDownPos = QPoint();
// Only act as a real button if the user didn't drag // Only act as a real button if the user didn't drag