Skip to content

Commit

Permalink
Fixed position calculation for tab dragging
Browse files Browse the repository at this point in the history
  • Loading branch information
githubuser0xFFFF committed Jan 15, 2020
1 parent 98ebdbe commit ce1e8c8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/DockWidgetTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,10 @@ void DockWidgetTabPrivate::createLayout()
void DockWidgetTabPrivate::moveTab(QMouseEvent* ev)
{
ev->accept();
int left, top, right, bottom;
_this->getContentsMargins(&left, &top, &right, &bottom);
QPoint moveToPos = ev->globalPos() - DragStartMousePosition;
moveToPos.setY(0);
_this->move(moveToPos);
QPoint Distance = ev->globalPos() - DragStartMousePosition;
Distance.setY(0);
auto TargetPos = Distance + TabDragStartPosition;
_this->move(TargetPos);
_this->raise();
}

Expand Down

0 comments on commit ce1e8c8

Please sign in to comment.