mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-22 14:32:07 +08:00
toggles: released -> clicked (#21786)
This commit is contained in:
@@ -37,13 +37,13 @@ void Toggle::paintEvent(QPaintEvent *e) {
|
||||
}
|
||||
|
||||
void Toggle::mouseReleaseEvent(QMouseEvent *e) {
|
||||
if(!enabled) {
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
const int left = _radius;
|
||||
const int right = width() - _radius;
|
||||
if(_x_circle != left && _x_circle != right) {
|
||||
//Don't parse touch events, while the animation is running
|
||||
if ((_x_circle != left && _x_circle != right) || !this->rect().contains(e->localPos().toPoint())) {
|
||||
// If mouse release isn't in rect or animation is running, don't parse touch events
|
||||
return;
|
||||
}
|
||||
if (e->button() & Qt::LeftButton) {
|
||||
@@ -80,4 +80,4 @@ void Toggle::setEnabled(bool value) {
|
||||
circleColor.setRgb(0x888888);
|
||||
green.setRgb(0x227722);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user