Skip to content

Commit f53d768

Browse files
author
delphidabbler
committed
Fix how database version number is displayed.
<span> containing version number text was being displayed as a block of *within* a paragraph. Fixed <span> to be displayed inline.
1 parent d85f27f commit f53d768

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

Src/FmAboutDlg.pas

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ implementation
196196
UMessageBox,
197197
UResourceUtils,
198198
UStrUtils,
199-
UThemesEx;
199+
UThemesEx,
200+
UVersionInfo;
200201

201202
{$R *.dfm}
202203

@@ -425,6 +426,18 @@ procedure TAboutDlg.InitHTMLFrames;
425426
IsDBAvalable: Boolean;
426427
IsMetaDataAvailable: Boolean;
427428
IsLicenseInfoAvailable: Boolean;
429+
430+
function DBVersion: string;
431+
var
432+
Ver: TVersionNumber;
433+
begin
434+
Ver := fMetaData.GetVersion;
435+
if Ver.V1 = 1 then
436+
Result := '1'
437+
else
438+
Result := Ver;
439+
end;
440+
428441
begin
429442
// Resolve conditionally displayed block placeholders
430443
IsDBAvalable := Database.Snippets.Count(False) > 0;
@@ -449,6 +462,10 @@ procedure TAboutDlg.InitHTMLFrames;
449462
Tplt.ResolvePlaceholderHTML(
450463
'LicenseInfoAvailable', TCSS.BlockDisplayProp(IsLicenseInfoAvailable)
451464
);
465+
Tplt.ResolvePlaceholderHTML(
466+
'LicenseInfoAvailableInline',
467+
TCSS.InlineDisplayProp(IsLicenseInfoAvailable)
468+
);
452469
Tplt.ResolvePlaceholderHTML(
453470
'LicenseInfoNotAvailable',
454471
TCSS.BlockDisplayProp(not IsLicenseInfoAvailable)
@@ -482,7 +499,7 @@ procedure TAboutDlg.InitHTMLFrames;
482499
Tplt.ResolvePlaceholderHTML(
483500
'TesterList', ContribListHTML(fMetaData.GetTesters)
484501
);
485-
Tplt.ResolvePlaceholderText('Version', fMetaData.GetVersion);
502+
Tplt.ResolvePlaceholderText('Version', DBVersion);
486503
end
487504
);
488505
end;

Src/Res/HTML/dlg-about-database-tplt.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<a
4747
class="external-link"
4848
href="https://github.com/delphidabbler/code-snippets"
49-
>Code Snippets Database</a> is a resource containing numerous fragments of useful Object Pascal code.<span style="<%LicenseInfoAvailable%>"> You are using version <%Version%></span>
49+
>Code Snippets Database</a> is a resource containing numerous fragments of useful Object Pascal code.<span style="<%LicenseInfoAvailableInline%>"> You are using version <%Version%>.</span>
5050
</p>
5151

5252
<div style="<%DBAvailable%>">

0 commit comments

Comments
 (0)