mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: unified Zoom Functions in Viewer
This commit is contained in:
parent
8f4d30daf4
commit
560720d95f
1 changed files with 42 additions and 0 deletions
|
|
@ -462,6 +462,9 @@ type
|
|||
procedure ShowTextViewer(AMode: TViewerControlMode);
|
||||
procedure CopyMoveFile(AViewerAction:TViewerCopyMoveAction);
|
||||
procedure ZoomImage(ADelta: Double);
|
||||
function DoZoom( const delta: Double; const inc: Integer ): Boolean;
|
||||
function DoZoomIn: Boolean;
|
||||
function DoZoomOut: Boolean;
|
||||
procedure RotateImage(AGradus:integer);
|
||||
procedure MirrorImage(AVertically:boolean=False);
|
||||
|
||||
|
|
@ -1865,6 +1868,45 @@ begin
|
|||
AdjustImageSize;
|
||||
end;
|
||||
|
||||
function TfrmViewer.DoZoom( const delta: Double; const inc: Integer ): Boolean;
|
||||
var
|
||||
ALine: Integer;
|
||||
begin
|
||||
Result:= False;
|
||||
if miGraphics.Checked then begin
|
||||
ZoomImage( delta );
|
||||
Result:= True;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
if (inc>0) and (gFonts[dcfViewer].Size>=gFonts[dcfViewer].MaxValue) then
|
||||
Exit;
|
||||
if (inc<0) and (gFonts[dcfViewer].Size<=gFonts[dcfViewer].MinValue) then
|
||||
Exit;
|
||||
gFonts[dcfViewer].Size:= gFonts[dcfViewer].Size + inc;
|
||||
Result:= True;
|
||||
|
||||
if miCode.Checked then begin
|
||||
ALine:= SynEdit.TopLine;
|
||||
FontOptionsToFont(gFonts[dcfViewer], SynEdit.Font);
|
||||
SynEdit.TopLine:= ALine;
|
||||
SynEdit.Refresh;
|
||||
end else begin
|
||||
ViewerControl.Font.Size:= gFonts[dcfViewer].Size;
|
||||
ViewerControl.Repaint;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TfrmViewer.DoZoomIn: Boolean;
|
||||
begin
|
||||
DoZoom( 1.1, 1 );
|
||||
end;
|
||||
|
||||
function TfrmViewer.DoZoomOut: Boolean;
|
||||
begin
|
||||
DoZoom( 0.909, -1 );
|
||||
end;
|
||||
|
||||
procedure TfrmViewer.RotateImage(AGradus: integer);
|
||||
// AGradus now supported only 90,180,270 values
|
||||
var
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue