Alexey-T / ATFlatControls

Controls for Delphi/Lazarus, used in CudaText: ATTabs, ATButton, ATListbox, ATScrollbar, ATStatusbar, ATGroups, ATGauge
Other
101 stars 29 forks source link

ATTABS new version cursor issue #64

Closed srd-software closed 3 years ago

srd-software commented 3 years ago

Hi Alexey,

I had a problem with the new version of ATTABS. When I would left click a tab to select it, it would immediately show the drag cursor. It was doing this when I was not dragging which is not the desired behavior.

I found the problem at line 2979 in attabs.pas:

This:

  // LCL dragging with DragMode=automatic is started too early.
  // so use DragMode=manual and DragStart.
  if OptMouseDragEnabled and FMouseDown and (FMouseDownButton=mbLeft) and not _IsDrag then
  begin
    BeginDrag(false, Mouse.DragThreshold);
    Screen.Cursor:= crDrag; //needed for Lazarus, when dragging tab below the control to another ATTabs
    Exit
  end;

Needs to be this:

  // LCL dragging with DragMode=automatic is started too early.
  // so use DragMode=manual and DragStart.
  if OptMouseDragEnabled and FMouseDown and (FMouseDownButton=mbLeft) and not _IsDrag then
  begin
    BeginDrag(false, Mouse.DragThreshold);
    {$ifdef FPC}
    Screen.Cursor:= crDrag; //needed for Lazarus, when dragging tab below the control to another ATTabs
    {$endif}
    Exit
  end;

Rather than doing the whole repository copy/fix/upload thing I was hoping just this detail would be enough for you this time!

Thanks Alexey

Stan