mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
fix: prevent crash in auto-refresh action
Exit out of refresh action early when the users mouse is dragging or resizing a tree column Closes #1060
This commit is contained in:
@@ -4771,9 +4771,24 @@ var
|
||||
List: TVirtualStringTree;
|
||||
OldDbObject: TDBObject;
|
||||
DoProceed: Boolean;
|
||||
i: Integer;
|
||||
const
|
||||
HeaderDragStates: THeaderStates = [
|
||||
hsAutoSizing, hsDragging, hsDragPending, hsColumnWidthTracking, hsColumnWidthTrackPending, hsHeightTracking, hsHeightTrackPending, hsResizing
|
||||
];
|
||||
begin
|
||||
// Refresh
|
||||
// Force data tab update when appropriate.
|
||||
|
||||
// Do not refresh when *any* tree is dragged or resized by user in this moment.
|
||||
// This is not limited to the focused control, as we also refresh ListDatabases if only its tab is active.
|
||||
for i:=0 to ComponentCount-1 do begin
|
||||
if not(Components[i] is TVirtualStringTree) then
|
||||
continue;
|
||||
if (HeaderDragStates * TVirtualStringTree(Components[i]).Header.States <> []) then begin
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
// Disable refresh action and re-enable in ApplicationOnIdle event
|
||||
tab1 := PageControlMain.ActivePage;
|
||||
actRefresh.Enabled := False;
|
||||
|
||||
Reference in New Issue
Block a user