mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: SingleClickStart same as in Total Commander
This commit is contained in:
parent
bd37abb1a0
commit
814dd35e98
1 changed files with 21 additions and 2 deletions
|
|
@ -892,6 +892,9 @@ begin
|
|||
end;
|
||||
|
||||
procedure TFileViewWithMainCtrl.MainControlMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
var
|
||||
FileIndex: PtrInt;
|
||||
AtFileList: Boolean;
|
||||
begin
|
||||
if IsLoadingFileList then Exit;
|
||||
|
||||
|
|
@ -905,11 +908,27 @@ begin
|
|||
if IsMouseSelecting and (GetCaptureControl = MainControl) then
|
||||
SetCaptureControl(nil);
|
||||
|
||||
// A single click starts programs and opens files
|
||||
// A single click is used to open items
|
||||
if (gMouseSingleClickStart > 0) and (Button = mbLeft) and
|
||||
(Shift * [ssShift, ssAlt, ssCtrl] = []) and FMouseFocus then
|
||||
begin
|
||||
MainControlDblClick(Sender);
|
||||
// A single click only opens folders. For files, a double click is needed.
|
||||
if (gMouseSingleClickStart and 2 <> 0) then
|
||||
begin
|
||||
FileIndex := GetFileIndexFromCursor(X, Y, AtFileList);
|
||||
if IsFileIndexInRange(FileIndex) then
|
||||
begin
|
||||
with FFiles[FileIndex].FSFile do
|
||||
begin
|
||||
if (IsDirectory or IsLinkToDirectory) then
|
||||
MainControlDblClick(Sender);
|
||||
end;
|
||||
end
|
||||
end
|
||||
// A single click starts programs and opens files
|
||||
else begin
|
||||
MainControlDblClick(Sender);
|
||||
end;
|
||||
end;
|
||||
|
||||
FMainControlMouseDown := False;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue