Skip to content

Commit 89ccbac

Browse files
committed
fix: do not start edit mode in ListTables on right mouse button click
1 parent 8643172 commit 89ccbac

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

source/main.lfm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,6 +2146,7 @@ object MainForm: TMainForm
21462146
OnHeaderDraggedOut = AnyGridHeaderDraggedOut
21472147
OnInitNode = ListTablesInitNode
21482148
OnKeyPress = ListTablesKeyPress
2149+
OnMouseUp = AnyGridMouseUp
21492150
OnNewText = ListTablesNewText
21502151
end
21512152
end

source/main.pas

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7467,7 +7467,7 @@ procedure TMainForm.ListTablesEditing(Sender: TBaseVirtualTree;
74677467
// Tables and views can be renamed, routines cannot
74687468
if Assigned(Node) then begin
74697469
Obj := Sender.GetNodeData(Node);
7470-
Allowed := Obj.NodeType in [lntTable, lntView];
7470+
Allowed := (Obj.NodeType in [lntTable, lntView]) and (FLastMouseButtonUpOnGrid = mbLeft);
74717471
end;
74727472
end;
74737473

@@ -11334,6 +11334,9 @@ procedure TMainForm.AnyGridMouseUp(Sender: TObject; Button: TMouseButton;
1133411334
Grid := Sender as TVirtualStringTree;
1133511335
if not Assigned(Grid.FocusedNode) then
1133611336
Exit;
11337+
// Exit early for non-result-grids like ListTables
11338+
if Grid <> ActiveGrid then
11339+
Exit;
1133711340
Grid.GetHitTestInfoAt(X, Y, False, {%H-}Hit);
1133811341
if (Hit.HitNode = nil) or (Hit.HitColumn = NoColumn) or (Hit.HitColumn = InvalidColumn) then begin
1133911342
Results := GridResult(Grid);

0 commit comments

Comments
 (0)