toggles: released -> clicked (#21786)

old-commit-hash: 519e7cbe89
commatwo_master
sshane 4 years ago committed by GitHub
parent a6b3f6526c
commit 707b67ba48
  1. 6
      selfdrive/ui/qt/widgets/toggle.cc

@ -37,13 +37,13 @@ void Toggle::paintEvent(QPaintEvent *e) {
} }
void Toggle::mouseReleaseEvent(QMouseEvent *e) { void Toggle::mouseReleaseEvent(QMouseEvent *e) {
if(!enabled) { if (!enabled) {
return; return;
} }
const int left = _radius; const int left = _radius;
const int right = width() - _radius; const int right = width() - _radius;
if(_x_circle != left && _x_circle != right) { if ((_x_circle != left && _x_circle != right) || !this->rect().contains(e->localPos().toPoint())) {
//Don't parse touch events, while the animation is running // If mouse release isn't in rect or animation is running, don't parse touch events
return; return;
} }
if (e->button() & Qt::LeftButton) { if (e->button() & Qt::LeftButton) {

Loading…
Cancel
Save