This commit is contained in:
iglezz 2026-05-07 14:22:30 -07:00 committed by GitHub
commit d370452e1e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -64,6 +64,8 @@ type
procedure KeyDown(var Key : Word; Shift : TShiftState); override;
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
function DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean; override;
function DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean; override;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure DragOver(Source: TObject; X,Y: Integer; State: TDragState; var Accept: Boolean); override;
protected
@ -112,7 +114,7 @@ implementation
uses
LCLIntf, LCLType, LMessages, Graphics, Math, StdCtrls, uFileSourceProperty,
uGlobs, uPixMapManager;
uGlobs, uPixMapManager, fMain;
{ TFileThumbnailsRetriever }
@ -275,6 +277,62 @@ begin
if FThumbView.IsMouseSelecting then DoMouseMoveScroll(nil, X, Y);
end;
function TThumbDrawGrid.DoMouseWheelUp(Shift: TShiftState; MousePos: TPoint): Boolean;
var
I: Integer;
begin
if not FThumbView.IsLoadingFileList then
begin
if (Shift=[ssCtrl])and(gFonts[dcfMain].Size < gFonts[dcfMain].MaxValue) then
begin
gFonts[dcfMain].Size:=gFonts[dcfMain].Size+1;
frmMain.FrameLeft.UpdateView;
frmMain.FrameRight.UpdateView;
Result:=True;
Exit;
end;
case gScrollMode of
smLineByLine:
for I:= 1 to gWheelScrollLines do
Perform(LM_VSCROLL, SB_LINEUP, 0);
smPageByPage:
Perform(LM_VSCROLL, SB_PAGEUP, 0);
end;
end
else
Result := True; // Handled
end;
function TThumbDrawGrid.DoMouseWheelDown(Shift: TShiftState; MousePos: TPoint): Boolean;
var
I: Integer;
begin
if not FThumbView.IsLoadingFileList then
begin
if (Shift=[ssCtrl])and(gFonts[dcfMain].Size > gFonts[dcfMain].MinValue) then
begin
gFonts[dcfMain].Size:=gFonts[dcfMain].Size-1;
frmMain.FrameLeft.UpdateView;
frmMain.FrameRight.UpdateView;
Result:=True;
Exit;
end;
case gScrollMode of
smLineByLine:
for I:= 1 to gWheelScrollLines do
Perform(LM_VSCROLL, SB_LINEDOWN, 0);
smPageByPage:
Perform(LM_VSCROLL, SB_PAGEDOWN, 0);
end;
end
else
Result := True; // Handled
end;
procedure TThumbDrawGrid.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
FMouseDownY := Y;