| 90 | } |
| 91 | |
| 92 | void DockToolbar::mousePressEvent(QMouseEvent* ev) { |
| 93 | if (auto* area = parent_dock_->dockAreaWidget()) { |
| 94 | // Forward with synthetic pos (0, 0). CFloatingDragPreview positions its |
| 95 | // top-left at QCursor::pos() - DragStartMousePosition, so a (0, 0) start |
| 96 | // makes the preview track the cursor directly instead of being offset by |
| 97 | // wherever the user happened to click along the wide toolbar. |
| 98 | QMouseEvent fwd( |
| 99 | QEvent::MouseButtonPress, QPointF(0, 0), ev->globalPosition(), ev->button(), ev->buttons(), ev->modifiers()); |
| 100 | QCoreApplication::sendEvent(area->titleBar(), &fwd); |
| 101 | ev->setAccepted(fwd.isAccepted()); |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | void DockToolbar::mouseReleaseEvent(QMouseEvent* ev) { |
| 106 | if (auto* area = parent_dock_->dockAreaWidget()) { |