Browse Source

scale image browser

Johann ELSASS 4 years ago
parent
commit
682eb8bb09

+ 3 - 3
lazpaint/dialog/ubrowseimages.lfm

@@ -105,7 +105,7 @@ object FBrowseImages: TFBrowseImages
         Left = 1
         Height = 41
         Top = 2
-        Width = 281
+        Width = 248
         Align = alNone
         ButtonHeight = 40
         ButtonWidth = 40
@@ -171,10 +171,10 @@ object FBrowseImages: TFBrowseImages
         TabOrder = 1
       end
       object DirectoryEdit1: TEdit
-        Left = 280
+        Left = 250
         Height = 34
         Top = 6
-        Width = 280
+        Width = 310
         Anchors = [akTop, akLeft, akRight]
         OnChange = DirectoryEdit1Change
         ParentFont = False

+ 8 - 2
lazpaint/dialog/ubrowseimages.pas

@@ -15,7 +15,7 @@ type
 
   { TFBrowseImages }
 
-  TFBrowseImages = class(TForm)
+   TFBrowseImages = class(TForm)
     ComboBox_FileExtension: TBCComboBox;
     CheckBox_UseDirectoryOnStartup: TCheckBox;
     DirectoryEdit1: TEdit;
@@ -174,7 +174,7 @@ uses BGRAThumbnail, BGRAPaintNet, BGRAOpenRaster, BGRAReadLzp,
     UConfig, bgrareadjpeg, FPReadJPEG,
     UFileExtensions, BGRAUTF8, LazFileUtils,
     UGraph, URaw, UDarkTheme, ShellCtrls,
-    UIconCache;
+    UIconCache, LCScaleDPI;
 
 { TFBrowseImages }
 
@@ -268,6 +268,12 @@ begin
   FPreview.OnValidate:= @PreviewValidate;
   FChosenImage := TImageEntry.Empty;
 
+  ScaleImageList(ImageListToolbar, DoScaleX(32, OriginalDPI),
+    DoScaleY(32, OriginalDPI), ImageListToolbar);
+
+  ScaleControl(Panel1, OriginalDPI);
+  ScaleControl(Panel2, OriginalDPI);
+
   DarkThemeInstance.Apply(ComboBox_FileExtension, False, 0.40);
   vsList.BitmapAutoScale:= false;
 

+ 3 - 0
lazpaintcontrols/lcscaledpi.pas

@@ -36,6 +36,9 @@ var
   i: Integer;
 
 begin
+  if (TargetList = SourceList) and (newWidth = SourceList.Width) and
+    (newHeight = SourceList.Height) then exit;
+
   setlength(TempBGRA, SourceList.Count);
   TempBmp := TBitmap.Create;
   for i := 0 to SourceList.Count-1 do