mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 16:37:54 +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;
|
function WSCreateReference(AParams: TCreateParams): PWSReference; override;
|
||||||
class procedure WSRegisterClass; override;
|
class procedure WSRegisterClass; override;
|
||||||
procedure ReferenceDestroying; override;
|
procedure ReferenceDestroying; override;
|
||||||
|
procedure UpdateReference;
|
||||||
public
|
public
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
public
|
public
|
||||||
|
@ -719,6 +719,7 @@ var
|
|||||||
Add(bmp, nil);
|
Add(bmp, nil);
|
||||||
bmp.Free;
|
bmp.Free;
|
||||||
end;
|
end;
|
||||||
|
UpdateReference;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DoReadLaz2;
|
procedure DoReadLaz2;
|
||||||
@ -757,6 +758,7 @@ var
|
|||||||
Add(bmp, nil);
|
Add(bmp, nil);
|
||||||
bmp.Free;
|
bmp.Free;
|
||||||
end;
|
end;
|
||||||
|
UpdateReference;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DoReadLaz3Header(BStream: TStream);
|
procedure DoReadLaz3Header(BStream: TStream);
|
||||||
@ -776,7 +778,10 @@ var
|
|||||||
begin
|
begin
|
||||||
DoReadLaz3Header(AStream);
|
DoReadLaz3Header(AStream);
|
||||||
if FCount > 0 then
|
if FCount > 0 then
|
||||||
|
begin
|
||||||
DoReadLaz3Data(AStream);
|
DoReadLaz3Data(AStream);
|
||||||
|
UpdateReference;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DoReadLaz4;
|
procedure DoReadLaz4;
|
||||||
@ -796,6 +801,7 @@ var
|
|||||||
I.Position := 0;
|
I.Position := 0;
|
||||||
D := TDecompressionStream.Create(I);
|
D := TDecompressionStream.Create(I);
|
||||||
DoReadLaz3Data(D);
|
DoReadLaz3Data(D);
|
||||||
|
UpdateReference;
|
||||||
finally
|
finally
|
||||||
I.Free;
|
I.Free;
|
||||||
D.Free;
|
D.Free;
|
||||||
@ -862,6 +868,7 @@ var
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
CreateImagesFromRawImage(IntfImage,NewCount);
|
CreateImagesFromRawImage(IntfImage,NewCount);
|
||||||
|
UpdateReference;
|
||||||
finally
|
finally
|
||||||
// clean up
|
// clean up
|
||||||
ImgReader.Free;
|
ImgReader.Free;
|
||||||
@ -975,6 +982,15 @@ begin
|
|||||||
FImageList.DoDestroyResolutionReference(FWidth, Reference._Handle);
|
FImageList.DoDestroyResolutionReference(FWidth, Reference._Handle);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomImageListResolution.UpdateReference;
|
||||||
|
begin
|
||||||
|
if HandleAllocated then
|
||||||
|
begin
|
||||||
|
DestroyReference;
|
||||||
|
ReferenceNeeded;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomImageListResolution.StretchDraw(Canvas: TCanvas;
|
procedure TCustomImageListResolution.StretchDraw(Canvas: TCanvas;
|
||||||
Index: Integer; ARect: TRect; Enabled: Boolean);
|
Index: Integer; ARect: TRect; Enabled: Boolean);
|
||||||
var
|
var
|
||||||
|
Loading…
Reference in New Issue
Block a user