| 127 | bool isToggled = d->_isToggled; |
| 128 | if (d->_isDragging) |
| 129 | { |
| 130 | isToggled = d->_circleCenterX > width() / 2; |
| 131 | } |
| 132 | else if (rect().contains(event->pos())) |
| 133 | { |
| 134 | isToggled = !isToggled; |
| 135 | } |
| 136 | d->_isDragging = false; |
| 137 | const int trackHeight = d->_getTrackHeight(); |
| 138 | d->_startPosAnimation(d->_circleCenterX, isToggled ? width() - trackHeight / 2 - d->_margin * 2 : trackHeight / 2, isToggled); |
| 139 | d->_startRadiusAnimation(trackHeight * 0.25, trackHeight * 0.35); |
| 140 | event->accept(); |
| 141 | } |
| 142 | |
| 143 | void ElaToggleSwitch::mouseMoveEvent(QMouseEvent* event) |
| 144 | { |
nothing calls this directly
no test coverage detected