mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-20 07:29:29 +02:00
lcl: fixed TSpeedButton with Action and changing Action.ImageIndex
This commit is contained in:
parent
c8bfe6c6cd
commit
adafca05c0
@ -432,8 +432,10 @@ begin
|
||||
if (NewAct.ActionList = nil) or (NewAct.ImageIndex < 0) then Exit;
|
||||
Imgs := NewAct.ActionList.Images;
|
||||
if (Imgs = nil) or (NewAct.ImageIndex >= Imgs.Count) then Exit;
|
||||
ImgRes := Imgs.ResolutionForPPI[ImageWidth,Font.PixelsPerInch,GetCanvasScaleFactor];
|
||||
ImgRes.GetBitmap(NewAct.ImageIndex, Glyph);
|
||||
Images := Imgs;
|
||||
ImageIndex := NewAct.ImageIndex;
|
||||
//ImgRes := Imgs.ResolutionForPPI[ImageWidth,Font.PixelsPerInch,GetCanvasScaleFactor];
|
||||
//ImgRes.GetBitmap(NewAct.ImageIndex, Glyph);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -488,13 +490,13 @@ function TCustomSpeedButton.IsGlyphStored: Boolean;
|
||||
var
|
||||
act: TCustomAction;
|
||||
begin
|
||||
result := true;
|
||||
Result := true;
|
||||
if Action <> nil then
|
||||
begin
|
||||
act := TCustomAction(Action);
|
||||
if (act.ActionList <> nil) and (act.ActionList.Images <> nil) and
|
||||
(act.ImageIndex >= 0) and (act.ImageIndex < act.ActionList.Images.Count) then
|
||||
result := false;
|
||||
Result := false;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -502,7 +504,7 @@ procedure TCustomSpeedButton.SetShowCaption(const AValue: boolean);
|
||||
begin
|
||||
if FShowCaption=AValue then exit;
|
||||
FShowCaption:=AValue;
|
||||
invalidate;
|
||||
Invalidate;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user