Skip to content

Commit a36231d

Browse files
committed
v1.3.9.2 minor fix for Linux ver and StayOnTop bug fix for win ver.
1 parent 8ad5b70 commit a36231d

File tree

4 files changed

+25
-28
lines changed

4 files changed

+25
-28
lines changed

src/ImageViewer.lpi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<MajorVersionNr Value="1"/>
2929
<MinorVersionNr Value="3"/>
3030
<RevisionNr Value="9"/>
31+
<BuildNr Value="2"/>
3132
<StringTable FileDescription="Image Viewer" InternalName="ImageViewer" LegalCopyright="torum" OriginalFilename="ImageViewer.exe" ProductName="Simple Image Viewer"/>
3233
</VersionInfo>
3334
<BuildModes Count="1">

src/ImageViewer.lpr

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ procedure TranslateLCL;
2020
Lang,FallbackLang: String;
2121
LangID: TLanguageID;
2222
begin
23-
// On windows, you have to call GetUserDefaultUILanguage() API to get UI languages.
24-
// But GetLanguageIDs calls GetUserDefaultLCID...
2523

2624
Lang:='en';
2725
FallbackLang:='';
@@ -109,7 +107,7 @@ procedure CheckAppParam;
109107
begin
110108

111109
TranslateLCL;
112-
Application.Scaled:=True;
110+
Application.Scaled:=True;
113111
RequireDerivedFormResource:=True;
114112
Application.Initialize;
115113
Application.ShowMainForm := False;

src/ImageViewer.res

0 Bytes
Binary file not shown.

src/umain.pas

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
unit UMain;
2-
3-
// {$mode objfpc}{$H+}
4-
// EnableBlur procedure requires delphi mode.
5-
{$mode delphi}
6-
72
{
83
### Source:
94
https://github.com/torum/Image-viewer
@@ -43,6 +38,10 @@
4338
* more Command line options.
4439
}
4540

41+
// EnableBlur procedure requires delphi mode.
42+
//{$mode objfpc}{$H+}
43+
{$mode delphi}
44+
4645
interface
4746

4847
uses
@@ -305,7 +304,7 @@ procedure TfrmMain.FormCreate(Sender: TObject);
305304
i,f:integer;
306305
configFile:string;
307306
begin
308-
FstrAppVer:='1.3.9.0';
307+
FstrAppVer:='1.3.9.2';
309308

310309
// Init Main form properties.
311310
self.Caption:=ReplaceStr(ExtractFileName(ParamStr(0)),ExtractFileExt(ParamStr(0)),'');
@@ -1214,9 +1213,7 @@ procedure TfrmMain.TimerEffectStartTimer(Sender: TObject);
12141213
// We start with fullscreen, so close after fullscreen.
12151214
close;
12161215
end;
1217-
12181216
end;
1219-
12201217
end;
12211218

12221219
procedure TfrmMain.TimerDelayStartTimer(Sender: TObject);
@@ -1712,9 +1709,9 @@ procedure TfrmMain.MenuItemSlideshowInFrameClick(Sender: TObject);
17121709
{$else}
17131710
// https://forum.lazarus.freepascal.org/index.php?topic=38675.0
17141711
FOrigBounds:= BoundsRect;
1715-
Hide;
1712+
// Hide; // This started to cause an error since Ubuntu 24.04.
17161713
self.BorderStyle:=bsNone;
1717-
Show;
1714+
// Show; // This started to cause an error since Ubuntu 24.04.
17181715

17191716
Form := TForm.Create(nil);
17201717
try
@@ -1862,8 +1859,8 @@ procedure TfrmMain.SetCaption(strCaption:string);
18621859

18631860
procedure TfrmMain.SetStayOnTop(bln:Boolean);
18641861
{$ifdef windows}
1865-
//var
1866-
//BeforeBounds : TRect;
1862+
var
1863+
BeforeBounds : TRect;
18671864
{$endif}
18681865
begin
18691866
if bln then
@@ -1878,37 +1875,38 @@ procedure TfrmMain.SetStayOnTop(bln:Boolean);
18781875
{$ifdef windows}
18791876
if FisInFrame then
18801877
begin
1881-
// TODO: This is not working...
1882-
18831878
// "FormStyle:=fsNormal" causes window pos to move to 0,0 so..
1884-
//BeforeBounds:= BoundsRect;
1879+
BeforeBounds:= BoundsRect;
18851880

1886-
// This isn't working for windows... calling this(SetStayOnTop) procedure twice from MenuItemStayOnTopClick works...
1887-
//self.FormStyle:=fsNormal;
1881+
// This isn't working for windows... calling this(FormStyle:=fsNormal) twice seems to work but...
1882+
self.FormStyle:=fsNormal;
18881883

1889-
//MenuItemStayOnTop.Checked:=false;
1890-
//self.FoptStayOnTop:=false;
1884+
MenuItemStayOnTop.Checked:=false;
1885+
self.FoptStayOnTop:=false;
18911886

18921887
if FisStartNormal then
18931888
begin
1894-
//self.BorderStyle:=bsNone;
1889+
self.BorderStyle:=bsNone; // Forgot what this was for. Why did I put this here?
18951890
end;
1891+
1892+
// Needed to this HERE again.... I don't know why.
1893+
self.FormStyle:=fsNormal;
1894+
18961895
// Blur again
1897-
//DoubleBuffered := True;
1898-
//EnableBlur;
1896+
DoubleBuffered := True;
1897+
EnableBlur;
1898+
18991899
// re-set position.
1900-
//BoundsRect := BeforeBounds;
1900+
BoundsRect := BeforeBounds;
19011901
end else
19021902
begin
1903-
// This isn't working for windows... calling this(SetStayOnTop) procedure twice from MenuItemStayOnTopClick works...
19041903
self.FormStyle:=fsNormal;
19051904

19061905
MenuItemStayOnTop.Checked:=false;
19071906
self.FoptStayOnTop:=false;
19081907
end;
19091908

19101909
{$else}
1911-
// This isn't working for windows... calling this(SetStayOnTop) procedure twice from MenuItemStayOnTopClick works...
19121910
self.FormStyle:=fsNormal;
19131911

19141912
MenuItemStayOnTop.Checked:=false;

0 commit comments

Comments
 (0)