mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 23:37:58 +02:00
LCL/ImageList: Fix update of images after reloading. Issue #41386, based on patch by Massimo Magnano.
This commit is contained in:
parent
1014cd330f
commit
654245a39e
@ -147,6 +147,7 @@ type
|
||||
function WSCreateReference(AParams: TCreateParams): PWSReference; override;
|
||||
class procedure WSRegisterClass; override;
|
||||
procedure ReferenceDestroying; override;
|
||||
procedure UpdateReference;
|
||||
public
|
||||
destructor Destroy; override;
|
||||
public
|
||||
|
@ -719,6 +719,7 @@ var
|
||||
Add(bmp, nil);
|
||||
bmp.Free;
|
||||
end;
|
||||
UpdateReference;
|
||||
end;
|
||||
|
||||
procedure DoReadLaz2;
|
||||
@ -757,6 +758,7 @@ var
|
||||
Add(bmp, nil);
|
||||
bmp.Free;
|
||||
end;
|
||||
UpdateReference;
|
||||
end;
|
||||
|
||||
procedure DoReadLaz3Header(BStream: TStream);
|
||||
@ -776,7 +778,10 @@ var
|
||||
begin
|
||||
DoReadLaz3Header(AStream);
|
||||
if FCount > 0 then
|
||||
begin
|
||||
DoReadLaz3Data(AStream);
|
||||
UpdateReference;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure DoReadLaz4;
|
||||
@ -796,6 +801,7 @@ var
|
||||
I.Position := 0;
|
||||
D := TDecompressionStream.Create(I);
|
||||
DoReadLaz3Data(D);
|
||||
UpdateReference;
|
||||
finally
|
||||
I.Free;
|
||||
D.Free;
|
||||
@ -862,6 +868,7 @@ var
|
||||
end;
|
||||
|
||||
CreateImagesFromRawImage(IntfImage,NewCount);
|
||||
UpdateReference;
|
||||
finally
|
||||
// clean up
|
||||
ImgReader.Free;
|
||||
@ -975,6 +982,15 @@ begin
|
||||
FImageList.DoDestroyResolutionReference(FWidth, Reference._Handle);
|
||||
end;
|
||||
|
||||
procedure TCustomImageListResolution.UpdateReference;
|
||||
begin
|
||||
if HandleAllocated then
|
||||
begin
|
||||
DestroyReference;
|
||||
ReferenceNeeded;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomImageListResolution.StretchDraw(Canvas: TCanvas;
|
||||
Index: Integer; ARect: TRect; Enabled: Boolean);
|
||||
var
|
||||
|
Loading…
Reference in New Issue
Block a user