void Float::mouseReleaseEvent(QMouseEvent *e) { if (base::take(_down) && _item) { if (const auto controller = _controller->roundVideo(_item)) { controller->pauseResume(); } } if (_drag) { finishDrag(outRatio() < 0.5); } }
void Float::mouseReleaseEvent(QMouseEvent *e) { if (_down) { _down = false; if (auto media = _item ? _item->getMedia() : nullptr) { media->playInline(); } } if (_drag) { finishDrag(outRatio() < 0.5); } }
void Float::mouseMoveEvent(QMouseEvent *e) { if (_down && (e->pos() - _downPoint).manhattanLength() > QApplication::startDragDistance()) { _down = false; _drag = true; _dragLocalPoint = e->pos(); } else if (_drag) { auto delta = (e->pos() - _dragLocalPoint); move(pos() + delta); setOpacity(outRatio()); } }