mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 03:49:30 +02:00
docking: before start auto docking check if DragMode = dmAutomatic
git-svn-id: trunk@14049 -
This commit is contained in:
parent
6a8326732d
commit
6ecc6cd943
@ -2050,22 +2050,25 @@ var
|
||||
APoint: TQtPoint;
|
||||
begin
|
||||
//Drag&Dock support TCustomForm => Start BeginDrag()
|
||||
if (LCLObject is TCustomForm) and (QMouseEvent_button(QMouseEventH(Event)) = QtLeftButton) then
|
||||
if (LCLObject is TCustomForm) and
|
||||
(TWinControlAccess(LCLObject).DragKind = dkDock) and
|
||||
(TWinControlAccess(LCLObject).DragMode = dmAutomatic) and
|
||||
(QMouseEvent_button(QMouseEventH(Event)) = QtLeftButton) then
|
||||
begin
|
||||
APoint := QMouseEvent_globalPos(QMouseEventH(Event))^;
|
||||
AHeader := getGeometry;
|
||||
with getFrameGeometry do
|
||||
AHeader.Top := Top;
|
||||
|
||||
// remove various buttons from header (how to request their pos cross platform?):
|
||||
Inc(AHeader.Left, 20); // system menu
|
||||
Dec(AHeader.Right, 80); // close, min, max buttons
|
||||
if AHeader.Right < AHeader.Left then
|
||||
AHeader.Right := AHeader.Left + 1;
|
||||
// remove various buttons from header (how to request their pos cross platform?):
|
||||
Inc(AHeader.Left, 20); // system menu
|
||||
Dec(AHeader.Right, 80); // close, min, max buttons
|
||||
if AHeader.Right < AHeader.Left then
|
||||
AHeader.Right := AHeader.Left + 1;
|
||||
|
||||
// we can skip translation of coords to global since we already working with window
|
||||
// check for title
|
||||
if PtInRect(AHeader, Point(APoint.x, APoint.y)) and (TWinControlAccess(LCLObject).DragKind = dkDock) then
|
||||
if PtInRect(AHeader, Point(APoint.x, APoint.y)) then
|
||||
LCLObject.BeginDrag(true);
|
||||
end;
|
||||
end;
|
||||
|
@ -1825,7 +1825,8 @@ begin
|
||||
begin
|
||||
if lWinControl is TCustomForm then
|
||||
begin
|
||||
if TWinControlAccess(lWinControl).DragKind = dkDock then
|
||||
if (TWinControlAccess(lWinControl).DragKind = dkDock) and
|
||||
(TWinControlAccess(lWinControl).DragMode = dmAutomatic) then
|
||||
lWinControl.BeginDrag(true);
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user