mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-24 23:31:32 +08:00
Fixed position calculation for tab dragging
This commit is contained in:
parent
98ebdbea50
commit
ce1e8c8beb
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user