mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
FIX: Bugs [0001715] and [0001704]
This commit is contained in:
parent
0483f493ea
commit
8d6ab59d3b
2 changed files with 16 additions and 6 deletions
|
|
@ -222,6 +222,7 @@ procedure TFileViewWithMainCtrl.cm_ContextMenu(const Params: array of string);
|
|||
var
|
||||
Rect: TRect;
|
||||
Point: TPoint;
|
||||
AFileIndex: PtrInt;
|
||||
UserWishForContextMenu: TUserWishForContextMenu = uwcmComplete;
|
||||
bUserWishJustActionMenu: boolean;
|
||||
begin
|
||||
|
|
@ -236,11 +237,19 @@ begin
|
|||
UserWishForContextMenu:=uwcmComplete;
|
||||
end;
|
||||
|
||||
Rect := GetFileRect(GetActiveFileIndex);
|
||||
Point.X := Rect.Left + ((Rect.Right - Rect.Left) div 2);
|
||||
Point.Y := Rect.Top + ((Rect.Bottom - Rect.Top) div 2);
|
||||
AFileIndex:= GetActiveFileIndex;
|
||||
if AFileIndex < 0 then
|
||||
begin
|
||||
Point.X:= 0;
|
||||
Point.Y:= 0;
|
||||
end
|
||||
else begin
|
||||
Rect := GetFileRect(AFileIndex);
|
||||
Point.X := Rect.Left + ((Rect.Right - Rect.Left) div 2);
|
||||
Point.Y := Rect.Top + ((Rect.Bottom - Rect.Top) div 2);
|
||||
end;
|
||||
Point := MainControl.ClientToScreen(Point);
|
||||
SetCursorPos(Point.X+100, Point.Y+25);
|
||||
// SetCursorPos(Point.X+100, Point.Y+25);
|
||||
frmMain.Commands.DoContextMenu(Self, Point.X, Point.Y, False, UserWishForContextMenu);
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -743,8 +743,9 @@ begin
|
|||
if not Panel.HasSelectedFiles then
|
||||
begin
|
||||
aFile:= Panel.CloneActiveFile;
|
||||
if Assigned(aFile) then
|
||||
begin
|
||||
if not Assigned(aFile) then
|
||||
Background:= True
|
||||
else begin
|
||||
sName:= aFile.Name;
|
||||
FreeAndNil(aFile);
|
||||
end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue