mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
FIX: Incorrect scroll when selecting using right mouse button
This commit is contained in:
parent
020b242820
commit
0faa8150d4
4 changed files with 18 additions and 9 deletions
|
|
@ -30,6 +30,7 @@ type
|
|||
|
||||
TDrawGridEx = class(TDrawGrid)
|
||||
private
|
||||
FMouseDownY: Integer;
|
||||
ColumnsView: TColumnsFileView;
|
||||
|
||||
function GetGridHorzLine: Boolean;
|
||||
|
|
@ -161,7 +162,7 @@ type
|
|||
procedure RedrawFile(FileIndex: PtrInt); override;
|
||||
procedure RedrawFile(DisplayFile: TDisplayFile); override;
|
||||
procedure RedrawFiles; override;
|
||||
procedure SetActiveFile(FileIndex: PtrInt); override;
|
||||
procedure SetActiveFile(FileIndex: PtrInt; ScrollTo: Boolean); override;
|
||||
procedure SetSorting(const NewSortings: TFileSortings); override;
|
||||
procedure ShowRenameFileEdit(aFile: TFile); override;
|
||||
procedure UpdateRenameFileEditPosition; override;
|
||||
|
|
@ -643,10 +644,14 @@ begin
|
|||
MakeVisible(dgPanel.Row);
|
||||
end;
|
||||
|
||||
procedure TColumnsFileView.SetActiveFile(FileIndex: PtrInt);
|
||||
procedure TColumnsFileView.SetActiveFile(FileIndex: PtrInt; ScrollTo: Boolean);
|
||||
begin
|
||||
dgPanel.Row := FileIndex + dgPanel.FixedRows;
|
||||
MakeVisible(dgPanel.Row);
|
||||
if not ScrollTo then
|
||||
dgPanel.SetColRow(dgPanel.Col, FileIndex + dgPanel.FixedRows)
|
||||
else begin
|
||||
dgPanel.Row := FileIndex + dgPanel.FixedRows;
|
||||
MakeVisible(dgPanel.Row);
|
||||
end;
|
||||
end;
|
||||
|
||||
{$IF lcl_fullversion >= 093100}
|
||||
|
|
@ -1852,6 +1857,7 @@ begin
|
|||
if ColumnsView.TooManyDoubleClicks then Exit;
|
||||
{$ENDIF}
|
||||
|
||||
FMouseDownY := Y;
|
||||
ColumnsView.FMainControlMouseDown := True;
|
||||
|
||||
inherited MouseDown(Button, Shift, X, Y);
|
||||
|
|
@ -1874,8 +1880,11 @@ begin
|
|||
begin
|
||||
if Y < DefaultRowHeight then
|
||||
Scroll(SB_LINEUP)
|
||||
else if Y > ClientHeight - DefaultRowHeight then
|
||||
else if (Y > ClientHeight - DefaultRowHeight) and (Y - 1 > FMouseDownY) then
|
||||
begin
|
||||
FMouseDownY := -1;
|
||||
Scroll(SB_LINEDOWN);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ type
|
|||
procedure RedrawFile(FileIndex: PtrInt); override;
|
||||
procedure RedrawFile(DisplayFile: TDisplayFile); override;
|
||||
procedure RedrawFiles; override;
|
||||
procedure SetActiveFile(FileIndex: PtrInt); override;
|
||||
procedure SetActiveFile(FileIndex: PtrInt; ScrollTo: Boolean); override;
|
||||
procedure DoFileUpdated(AFile: TDisplayFile; UpdatedProperties: TFilePropertiesTypes = []); override;
|
||||
procedure DoHandleKeyDown(var Key: Word; Shift: TShiftState); override;
|
||||
procedure UpdateFlatFileName; override;
|
||||
|
|
@ -700,7 +700,7 @@ begin
|
|||
TabHeader.UpdateSorting(Sorting);
|
||||
end;
|
||||
|
||||
procedure TFileViewWithGrid.SetActiveFile(FileIndex: PtrInt);
|
||||
procedure TFileViewWithGrid.SetActiveFile(FileIndex: PtrInt; ScrollTo: Boolean);
|
||||
var
|
||||
ACol, ARow: Integer;
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -680,7 +680,7 @@ begin
|
|||
case Button of
|
||||
mbRight:
|
||||
begin
|
||||
SetActiveFile(FileIndex);
|
||||
SetActiveFile(FileIndex, False);
|
||||
|
||||
if gMouseSelectionEnabled and (gMouseSelectionButton = 1) then
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ type
|
|||
procedure SearchFile(SearchTerm,SeparatorCharset: String; SearchOptions: TQuickSearchOptions);
|
||||
procedure Selection(Key: Word; CurIndex: PtrInt);
|
||||
procedure SelectRange(FileIndex: PtrInt);
|
||||
procedure SetActiveFile(FileIndex: PtrInt); overload; virtual; abstract;
|
||||
procedure SetActiveFile(FileIndex: PtrInt; ScrollTo: Boolean = True); overload; virtual; abstract;
|
||||
procedure SetLastActiveFile(FileIndex: PtrInt);
|
||||
{en
|
||||
Sets a file as active if the file currently exists.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue