mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Bug [0001477] Fullscreen image view mode isn't really fullscreen
This commit is contained in:
parent
a792351860
commit
4712db87cb
2 changed files with 48 additions and 94 deletions
|
|
@ -267,7 +267,7 @@ object frmViewer: TfrmViewer
|
|||
OnShow = FormShow
|
||||
SessionProperties = 'Height;Width;Left;Top;WindowState'
|
||||
ShowInTaskBar = stAlways
|
||||
LCLVersion = '1.6.4.0'
|
||||
LCLVersion = '1.8.0.4'
|
||||
object pnlFolder: TPanel
|
||||
Left = 179
|
||||
Height = 435
|
||||
|
|
@ -366,6 +366,7 @@ object frmViewer: TfrmViewer
|
|||
TabOrder = 0
|
||||
OnMouseEnter = sboxImageMouseEnter
|
||||
OnMouseLeave = sboxImageMouseLeave
|
||||
OnMouseMove = sboxImageMouseMove
|
||||
object Image: TImage
|
||||
Left = 56
|
||||
Height = 288
|
||||
|
|
@ -409,7 +410,6 @@ object frmViewer: TfrmViewer
|
|||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
TabOrder = 1
|
||||
OnMouseEnter = PanelEditImageMouseEnter
|
||||
object gboxHightlight: TGroupBox
|
||||
Left = 435
|
||||
Height = 47
|
||||
|
|
@ -1407,16 +1407,17 @@ object frmViewer: TfrmViewer
|
|||
end
|
||||
object gboxSlideShow: TGroupBox
|
||||
AnchorSideRight.Control = btnFullScreen
|
||||
Left = 334
|
||||
Left = 326
|
||||
Height = 48
|
||||
Top = 1
|
||||
Width = 132
|
||||
Width = 140
|
||||
Align = alRight
|
||||
AutoSize = True
|
||||
BorderSpacing.Right = 6
|
||||
Caption = 'Slide Show'
|
||||
ChildSizing.LeftRightSpacing = 6
|
||||
ClientHeight = 28
|
||||
ClientWidth = 128
|
||||
ClientWidth = 136
|
||||
TabOrder = 3
|
||||
Visible = False
|
||||
object seTimeShow: TSpinEdit
|
||||
|
|
@ -1425,7 +1426,7 @@ object frmViewer: TfrmViewer
|
|||
AnchorSideRight.Control = gboxSlideShow
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 81
|
||||
Left = 87
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 43
|
||||
|
|
@ -1441,7 +1442,7 @@ object frmViewer: TfrmViewer
|
|||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = seTimeShow
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 0
|
||||
Left = 6
|
||||
Height = 19
|
||||
Top = 2
|
||||
Width = 77
|
||||
|
|
|
|||
127
src/fviewer.pas
127
src/fviewer.pas
|
|
@ -237,7 +237,6 @@ type
|
|||
procedure ImageMouseWheelUp(Sender: TObject; Shift: TShiftState;
|
||||
MousePos: TPoint; var Handled: Boolean);
|
||||
procedure miLookBookClick(Sender: TObject);
|
||||
procedure PanelEditImageMouseEnter(Sender: TObject);
|
||||
procedure pnlImageResize(Sender: TObject);
|
||||
|
||||
procedure pnlTextMouseWheelUp(Sender: TObject; Shift: TShiftState;
|
||||
|
|
@ -287,6 +286,8 @@ type
|
|||
FCommands: TFormCommands;
|
||||
FZoomFactor: Double;
|
||||
FExif: TExifReader;
|
||||
FWindowBounds: TRect;
|
||||
FWindowState: TWindowState;
|
||||
|
||||
//---------------------
|
||||
WlxPlugins:TWLXModuleList;
|
||||
|
|
@ -314,7 +315,6 @@ type
|
|||
|
||||
protected
|
||||
procedure WMSetFocus(var Message: TLMSetFocus); message LM_SETFOCUS;
|
||||
procedure UpdateGlobals;
|
||||
|
||||
public
|
||||
constructor Create(TheOwner: TComponent; aFileSource: IFileSource; aQuickView: Boolean = False); overload;
|
||||
|
|
@ -449,27 +449,8 @@ begin
|
|||
FBitmapList:= TBitmapList.Create(True);
|
||||
FCommands := TFormCommands.Create(Self, actionList);
|
||||
|
||||
FontOptionsToFont(gFonts[dcfMain],memFolder.Font);
|
||||
memFolder.Color:=gBackColor;
|
||||
|
||||
// This temporary code is for debug
|
||||
StartX:=0;
|
||||
StartY:=0;
|
||||
EndX:=Image.Width-1;
|
||||
EndY:=Image.Height-1;
|
||||
// CutToImage;
|
||||
|
||||
|
||||
{
|
||||
tmp_all:= TBitmap.Create;
|
||||
tmp_all.Assign(Image.Picture.Graphic);
|
||||
|
||||
Image.Picture.Bitmap.Canvas.Clear;
|
||||
Image.Picture.Bitmap.Canvas.Draw(0,0,tmp_all);
|
||||
UndoTmp;
|
||||
}
|
||||
//-----------------------------------
|
||||
|
||||
FontOptionsToFont(gFonts[dcfMain], memFolder.Font);
|
||||
memFolder.Color:= gBackColor;
|
||||
end;
|
||||
|
||||
constructor TfrmViewer.Create(TheOwner: TComponent);
|
||||
|
|
@ -895,16 +876,6 @@ begin
|
|||
if bPlugin then WlxPlugins.GetWlxModule(ActivePlugin).SetFocus;
|
||||
end;
|
||||
|
||||
procedure TfrmViewer.UpdateGlobals;
|
||||
begin
|
||||
gViewerTop:=Top;
|
||||
gViewerLeft:=Left;
|
||||
gViewerWidth:=Width;
|
||||
gViewerHeight:=Height;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure TfrmViewer.RedEyes;
|
||||
var
|
||||
tmp:TBitMap;
|
||||
|
|
@ -1319,17 +1290,11 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmViewer.PanelEditImageMouseEnter(Sender: TObject);
|
||||
begin
|
||||
if miFullScreen.Checked then PanelEditImage.Height:= 50;
|
||||
end;
|
||||
|
||||
procedure TfrmViewer.pnlImageResize(Sender: TObject);
|
||||
begin
|
||||
if bImage then AdjustImageSize;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmViewer.pnlTextMouseWheelUp(Sender: TObject; Shift: TShiftState;
|
||||
MousePos: TPoint; var Handled: Boolean);
|
||||
begin
|
||||
|
|
@ -1449,22 +1414,28 @@ end;
|
|||
|
||||
procedure TfrmViewer.TimerViewerTimer(Sender: TObject);
|
||||
begin
|
||||
if (miFullScreen.Checked) and (PanelEditImage.Height>3) then
|
||||
PanelEditImage.Height := PanelEditImage.Height-1;
|
||||
i_timer:=i_timer+1;
|
||||
if (cbSlideShow.Checked) and (i_timer=60*seTimeShow.Value) then
|
||||
begin
|
||||
cm_LoadNextFile([]);
|
||||
i_timer:=0;
|
||||
end;
|
||||
if i_timer=180 then
|
||||
begin
|
||||
sboxImage.Cursor:=crNone;
|
||||
Image.Cursor:=crNone;
|
||||
end;
|
||||
if (miFullScreen.Checked) then
|
||||
begin
|
||||
if (PanelEditImage.Visible) and (i_timer > 60) and (not PanelEditImage.MouseEntered) then
|
||||
PanelEditImage.Visible:= False
|
||||
else if (not PanelEditImage.Visible) and (sboxImage.ScreenToClient(Mouse.CursorPos).Y < PanelEditImage.Height div 2) then
|
||||
PanelEditImage.Visible:= True;
|
||||
end;
|
||||
Inc(i_timer);
|
||||
if (cbSlideShow.Checked) and (i_timer = 60 * seTimeShow.Value) then
|
||||
begin
|
||||
if (PanelEditImage.Visible) and (not PanelEditImage.MouseEntered) then
|
||||
PanelEditImage.Visible:= False;
|
||||
cm_LoadNextFile([]);
|
||||
i_timer:= 0;
|
||||
end;
|
||||
if i_timer = 180 then
|
||||
begin
|
||||
sboxImage.Cursor:= crNone;
|
||||
Image.Cursor:= crNone;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmViewer.ViewerControlMouseUp(Sender: TObject;
|
||||
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
begin
|
||||
|
|
@ -1475,7 +1446,6 @@ end;
|
|||
procedure TfrmViewer.frmViewerClose(Sender: TObject;
|
||||
var CloseAction: TCloseAction);
|
||||
begin
|
||||
if not miFullScreen.Checked then UpdateGlobals;
|
||||
CloseAction:=caFree;
|
||||
gImageStretch:= miStretch.Checked;
|
||||
gImageStretchOnlyLarge:= miStretchOnlyLarge.Checked;
|
||||
|
|
@ -1827,8 +1797,8 @@ var
|
|||
dScaleFactor : Double;
|
||||
iLeft, iTop, iWidth, iHeight : Integer;
|
||||
begin
|
||||
if (Image.Picture=nil) then exit;
|
||||
if (Image.Picture.Width=0)or(Image.Picture.Height=0)then exit;
|
||||
if (Image.Picture = nil) then Exit;
|
||||
if (Image.Picture.Width = 0) or (Image.Picture.Height = 0) then Exit;
|
||||
|
||||
dScaleFactor:= FZoomFactor;
|
||||
|
||||
|
|
@ -1901,9 +1871,9 @@ begin
|
|||
fsFileStream:= TFileStreamEx.Create(sFileName, fmOpenRead or fmShareDenyNone);
|
||||
try
|
||||
Image.Picture.LoadFromStreamWithFileExt(fsFileStream, sExt);
|
||||
btnHightlight.Visible:= True;
|
||||
btnPaint.Visible:= True;
|
||||
btnResize.Visible:= True;
|
||||
btnHightlight.Visible:= not (miFullScreen.Checked);
|
||||
btnPaint.Visible:= not (miFullScreen.Checked);
|
||||
btnResize.Visible:= not (miFullScreen.Checked);
|
||||
miImage.Visible:= True;
|
||||
btnZoomIn.Visible:= True;
|
||||
btnZoomOut.Visible:= True;
|
||||
|
|
@ -2170,11 +2140,10 @@ begin
|
|||
else if Panel = pnlImage then
|
||||
begin
|
||||
pnlImage.TabStop:= True;
|
||||
PanelEditImage.Visible:= not bQuickView;
|
||||
if CanFocus and pnlImage.CanFocus then pnlImage.SetFocus;
|
||||
PanelEditImage.Visible:= not (bQuickView or (miFullScreen.Checked and not PanelEditImage.MouseEntered));
|
||||
end;
|
||||
|
||||
|
||||
bAnimation := (Panel = pnlImage) and (GifAnim.Visible);
|
||||
bImage := (Panel = pnlImage) and (bAnimation = False);
|
||||
bPlugin := (Panel = nil);
|
||||
|
|
@ -2193,16 +2162,6 @@ begin
|
|||
|
||||
pmiSelectAll.Visible := (Panel = pnlText);
|
||||
pmiCopyFormatted.Visible := (Panel = pnlText);
|
||||
|
||||
|
||||
|
||||
|
||||
WindowState:=wsNormal;
|
||||
Top :=gViewerTop;
|
||||
Left :=gViewerLeft;
|
||||
Width :=gViewerWidth;
|
||||
Height:=gViewerHeight;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmViewer.cm_About(const Params: array of string);
|
||||
|
|
@ -2420,13 +2379,18 @@ begin
|
|||
miFullScreen.Checked:= not (miFullScreen.Checked);
|
||||
if miFullScreen.Checked then
|
||||
begin
|
||||
UpdateGlobals;
|
||||
FWindowBounds.Top:= Top;
|
||||
FWindowBounds.Left:= Left;
|
||||
FWindowBounds.Right:= Width;
|
||||
FWindowBounds.Bottom:= Height;
|
||||
FWindowState:= WindowState;
|
||||
WindowState:= wsMaximized;
|
||||
BorderStyle:= bsNone;
|
||||
MainMenu.Items.Visible:=false; // it sometime not work by unknown reason
|
||||
MainMenu.Parent:=nil; // so now we have no choice and workaround it by this trick
|
||||
gboxPaint.Visible:= false;
|
||||
gboxHightlight.Visible:=false;
|
||||
PanelEditImage.Visible:= False;
|
||||
miStretch.Checked:= miFullScreen.Checked;
|
||||
if miPreview.Checked then
|
||||
cm_Preview(['']);
|
||||
|
|
@ -2435,24 +2399,13 @@ begin
|
|||
begin
|
||||
MainMenu.Parent:=Self; // workaround code to attach detached menu
|
||||
|
||||
WindowState:= wsNormal;
|
||||
WindowState:= FWindowState;
|
||||
BorderStyle:= bsSizeable;
|
||||
//Viewer.MainMenu.Items.Visible:=true; // why it work ???
|
||||
// Viewer.MainMenu.Items.Visible:=true; // why it work ???
|
||||
|
||||
Left :=gViewerLeft;
|
||||
Top :=gViewerTop;
|
||||
Width :=gViewerWidth;
|
||||
Height:=gViewerHeight;
|
||||
|
||||
PanelEditImage.Height:= 50;
|
||||
if (Left+Width>Screen.Width)or(Top+Height>Screen.Height) then // if looks bad - correct size
|
||||
begin
|
||||
Width :=Screen.Width -Left-10;
|
||||
Height:=Screen.Height-Top -10;
|
||||
gViewerWidth:=Width;
|
||||
gViewerHeight:=Height;
|
||||
end;
|
||||
SetBounds(FWindowBounds.Left, FWindowBounds.Top, FWindowBounds.Right, FWindowBounds.Bottom);
|
||||
|
||||
PanelEditImage.Visible:= True;
|
||||
end;
|
||||
if ExtractOnlyFileExt(FileList.Strings[iActiveFile]) <> 'gif' then
|
||||
begin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue