浏览代码

Bug fix: Installer images did not scale correctly

The controls scale not exactly to the DPI, and we were adjusting control size with the image size. Stretching the tall/small image to fit the controls size now. Stretching is not perfect, we may consider better solution eventually.

Source commit: 647988d472a8e2725bc513d6a11cc4d07ea43e34
Martin Prikryl 9 年之前
父节点
当前提交
748f8cc09e
共有 1 个文件被更改,包括 10 次插入4 次删除
  1. 10 4
      deployment/winscpsetup.iss

+ 10 - 4
deployment/winscpsetup.iss

@@ -692,7 +692,6 @@ begin
 
   Image.Bitmap := Bitmap;
   Bitmap.Free;
-  Image.AutoSize := True;
   Image.BackColor := BackgroundColor;
 end;
 
@@ -714,6 +713,12 @@ begin
   LoadEmbededBitmap(Image, Name, BackgroundColor);
 end;
 
+procedure LoadEmbededScaledIcon(Image: TBitmapImage; NameBase: string; SizeBase: Integer; BackgroundColor: TColor);
+begin
+  LoadEmbededScaledBitmap(Image, NameBase, SizeBase, BackgroundColor);
+  Image.AutoSize := True;
+end;
+
 // WORKAROUND
 // Checkboxes and Radio buttons created on runtime do
 // not scale their height automatically
@@ -981,7 +986,7 @@ begin
   Image.Top := GetBottom(CommanderRadioButton) + ScaleY(6);
   Image.Left := CommanderRadioButton.Left + ScaleX(45);
   Image.Parent := InterfacePage.Surface;
-  LoadEmbededScaledBitmap(Image, '{#CommanderFileBase}', 32, InterfacePage.Surface.Color);
+  LoadEmbededScaledIcon(Image, '{#CommanderFileBase}', 32, InterfacePage.Surface.Color);
   Image.OnClick := @ImageClick;
   Image.Tag := Integer(CommanderRadioButton);
 
@@ -1011,7 +1016,7 @@ begin
   Image.Top := GetBottom(ExplorerRadioButton) + ScaleY(6);
   Image.Left := ExplorerRadioButton.Left + ScaleX(45);
   Image.Parent := InterfacePage.Surface;
-  LoadEmbededScaledBitmap(Image, '{#ExplorerFileBase}', 32, InterfacePage.Surface.Color);
+  LoadEmbededScaledIcon(Image, '{#ExplorerFileBase}', 32, InterfacePage.Surface.Color);
   Image.OnClick := @ImageClick;
   Image.Tag := Integer(ExplorerRadioButton);
 
@@ -1079,6 +1084,7 @@ begin
 
   Image := TBitmapImage.Create(DonationPanel);
   LoadEmbededBitmap(Image, '{#PayPalCardImage}', DonationPanel.Color);
+  Image.AutoSize := True;
   Image.Cursor := crHand;
   Image.Parent := DonationPanel;
   Image.Left := ScaleX(100);
@@ -1109,7 +1115,7 @@ begin
     LoadEmbededScaledBitmap(WizardForm.WizardSmallBitmapImage, '{#WizardSmallImageFileBase}', 100, 0);
   end;
 
-  LoadEmbededScaledBitmap(WizardForm.SelectDirBitmapImage, '{#SelectDirFileBase}', 32, WizardForm.SelectDirPage.Color);
+  LoadEmbededScaledIcon(WizardForm.SelectDirBitmapImage, '{#SelectDirFileBase}', 32, WizardForm.SelectDirPage.Color);
 end;
 
 procedure RegisterPreviousData(PreviousDataKey: Integer);