mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 13:38:07 +02:00
Aktualisieren lcl/include/bitbtn.inc
This commit is contained in:
parent
2f07ee8783
commit
5aee9d5c07
@ -203,23 +203,16 @@ procedure TCustomBitBtn.ActionChange(Sender: TObject; CheckDefaults: Boolean);
|
||||
var
|
||||
NewAct: TCustomAction;
|
||||
Imgs: TCustomImageList;
|
||||
ImgRes: TScaledImageListResolution;
|
||||
begin
|
||||
inherited ActionChange(Sender,CheckDefaults);
|
||||
if Sender is TCustomAction then
|
||||
begin
|
||||
NewAct := TCustomAction(Sender);
|
||||
//DebugLn(['TCustomBitBtn.ActionChange: Glyph.Empty=', Glyph.Empty,
|
||||
// ', Action=', NewAct.Caption,
|
||||
// ', ActionList=', NewAct.ActionList,
|
||||
// ', Images=', NewAct.ActionList.Images,
|
||||
// ', ImageIndex=', NewAct.ImageIndex ]);
|
||||
if (NewAct.ActionList = nil) or (NewAct.ImageIndex < 0) then Exit;
|
||||
Imgs := NewAct.ActionList.Images;
|
||||
if (Imgs = nil) or (NewAct.ImageIndex >= Imgs.Count) then Exit;
|
||||
//DebugLn([' TCustomBitBtn.ActionChange: Setting image, ImageWidth=', ImageWidth]);
|
||||
ImgRes := Imgs.ResolutionForPPI[ImageWidth,Font.PixelsPerInch,GetCanvasScaleFactor];
|
||||
ImgRes.GetBitmap(NewAct.ImageIndex, Glyph);
|
||||
Images := Imgs;
|
||||
ImageIndex := NewAct.ImageIndex;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user