Skip to content

Commit 979eca4

Browse files
authored
Fix clipped text in installer (#658)
My adjustments in #655 worked in my tests, at zoom level 125%. But they do not work at any other zoom level, causing clipped text and awful layout. Here, I present the end result of iterating until I ended up with a much simpler solution than I had originally come up with (and which unfortunately made it into the Git for Windows v2.52.0 installer). This fixes git-for-windows/git#5961
2 parents 0600552 + 99dd98d commit 979eca4

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

installer/install.iss

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,7 +1459,7 @@ function CreateItemDescription(Page:TWizardPage;const Description:String;var Top
14591459
var
14601460
SubLabel:TLabel;
14611461
Untagged,RowPrefix,Link:String;
1462-
RowStart,RowCount,RowHeight,i,j:Integer;
1462+
RowStart,RowCount,i,j:Integer;
14631463
begin
14641464
Untagged:='';
14651465
Result:=TLabel.Create(Page);
@@ -1468,30 +1468,25 @@ begin
14681468
Result.Top:=ScaleY(Top);
14691469
Result.Left:=ScaleX(Left+24);
14701470
Result.Width:=ScaleX(405);
1471-
Result.Height:=ScaleY(13);
14721471
Result.Visible:=Visible;
14731472
SetArrayLength(Labels,GetArrayLength(Labels)+1);
14741473
Labels[GetArrayLength(Labels)-1]:=Result;
14751474
RowPrefix:='';
14761475
RowCount:=1;
1477-
RowHeight:=Result.Font.Height;
1478-
if (RowHeight<0) then
1479-
RowHeight:=-RowHeight;
14801476
while True do begin
14811477
case Pos3(Description,#13,'<RED>','<A HREF=',i) of
14821478
'': begin
14831479
Untagged:=Untagged+Description;
14841480
Result.Caption:=Untagged;
1485-
Result.Height:=ScaleY(RowHeight*RowCount);
1486-
Top:=Top+RowHeight+18;
1481+
Top:=Top+15+18;
14871482
Exit;
14881483
end;
14891484
''+#13: begin
14901485
Untagged:=Untagged+SubString(Description,1,i);
14911486
Description:=SubString(Description,i+1,-1);
14921487
RowCount:=RowCount+1;
14931488
RowPrefix:='';
1494-
Top:=Top+RowHeight;
1489+
Top:=Top+15;
14951490
end;
14961491
'<RED>': begin
14971492
Untagged:=Untagged+SubString(Description,1,i-1);
@@ -1510,14 +1505,13 @@ begin
15101505
SubLabel.Top:=ScaleY(Top);
15111506
SubLabel.Left:=GetTextWidth(RowPrefix,Result.Font)+ScaleX(Left+24);
15121507
SubLabel.Width:=ScaleX(405);
1513-
SubLabel.Height:=ScaleY(RowHeight);
15141508
SubLabel.Font.Color:=clRed;
15151509
SubLabel.Visible:=Visible;
15161510
Untagged:=Untagged+SubString(Description,1,j);
15171511
Description:=SubString(Description,j+1,-1);
15181512
i:=i-j;
15191513
RowPrefix:='';
1520-
Top:=Top+RowHeight;
1514+
Top:=Top+13;
15211515
RowCount:=RowCount+1;
15221516
SetArrayLength(Labels,GetArrayLength(Labels)+1);
15231517
Labels[GetArrayLength(Labels)-1]:=SubLabel;
@@ -1528,7 +1522,6 @@ begin
15281522
SubLabel.Top:=ScaleY(Top);
15291523
SubLabel.Left:=GetTextWidth(RowPrefix,Result.Font)+ScaleX(Left+24);
15301524
SubLabel.Width:=ScaleX(405);
1531-
SubLabel.Height:=ScaleY(RowHeight*CountLines(SubLabel.Caption));
15321525
SubLabel.Font.Color:=clRed;
15331526
SubLabel.Visible:=Visible;
15341527
Untagged:=Untagged+SubString(Description,1,i-1);
@@ -1566,7 +1559,6 @@ begin
15661559
SubLabel.Top:=ScaleY(Top);
15671560
SubLabel.Left:=GetTextWidth(RowPrefix,Result.Font)+ScaleX(Left+24);
15681561
SubLabel.Width:=ScaleX(405);
1569-
SubLabel.Height:=ScaleY(RowHeight);
15701562
SubLabel.Font.Color:=clBlue;
15711563
SubLabel.Font.Style:=[fsUnderline];
15721564
SubLabel.Cursor:=crHand;
@@ -1576,7 +1568,7 @@ begin
15761568
Description:=SubString(Description,j+1,-1);
15771569
i:=i-j;
15781570
RowPrefix:='';
1579-
Top:=Top+RowHeight;
1571+
Top:=Top+13;
15801572
RowCount:=RowCount+1;
15811573
SetArrayLength(Labels,GetArrayLength(Labels)+1);
15821574
Labels[GetArrayLength(Labels)-1]:=SubLabel;
@@ -1588,7 +1580,6 @@ begin
15881580
SubLabel.Top:=ScaleY(Top);
15891581
SubLabel.Left:=GetTextWidth(RowPrefix,Result.Font)+ScaleX(Left+24);
15901582
SubLabel.Width:=ScaleX(405);
1591-
SubLabel.Height:=ScaleY(RowHeight*CountLines(SubLabel.Caption));
15921583
SubLabel.Font.Color:=clBlue;
15931584
SubLabel.Font.Style:=[fsUnderline];
15941585
SubLabel.Cursor:=crHand;

0 commit comments

Comments
 (0)