From 06701d05a76b6e3f989d79aa62276231d5991e54 Mon Sep 17 00:00:00 2001 From: wp_xyz Date: Fri, 29 Oct 2021 11:33:40 +0200 Subject: [PATCH] LCL/ShellCtrls: Fix issues in resizing the width of TShellListView, issue #39447. --- lcl/shellctrls.pas | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/lcl/shellctrls.pas b/lcl/shellctrls.pas index 7e2eb4b8e6..5f9caebad4 100644 --- a/lcl/shellctrls.pas +++ b/lcl/shellctrls.pas @@ -227,8 +227,9 @@ type protected { Methods specific to Lazarus } class procedure WSRegisterClass; override; + procedure AdjustColWidths; procedure PopulateWithRoot(); - procedure Resize; override; + procedure DoOnResize; override; procedure SetAutoSizeColumns(const Value: Boolean); virtual; procedure DoAddItem(const ABasePath: String; const AFileInfo: TSearchRec; var CanAdd: Boolean); function GetBuiltinImageIndex(const AFileName: String; ALargeImage: Boolean): Integer; @@ -1497,7 +1498,7 @@ begin Self.Column[1].Caption := sShellCtrlsSize; Self.Column[2].Caption := sShellCtrlsType; // Initial sizes, necessary under Windows CE - Resize; + AdjustColWidths; end; destructor TCustomShellListView.Destroy; @@ -1576,15 +1577,10 @@ begin end; end; -procedure TCustomShellListView.Resize; +procedure TCustomShellListView.AdjustColWidths; var iWidth: Integer; begin - inherited Resize; - {$ifdef DEBUG_SHELLCTRLS} - debugln(':>TCustomShellListView.HandleResize'); - {$endif} - // The correct check is with count, // if Column[0] <> nil then will raise an exception if Self.Columns.Count < 3 then Exit; @@ -1610,12 +1606,12 @@ begin finally EndUpdate; end; +end; - {$ifdef DEBUG_SHELLCTRLS} - debugln([':