mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 07:19:16 +02:00
LCL: TCustomSpeedButton: do not store Glyph in lfm when Action provides the Glyph, issue #27357, from BBaz
git-svn-id: branches/fixes_1_4@47544 -
This commit is contained in:
parent
f52d01980d
commit
39b325c753
@ -271,6 +271,7 @@ type
|
|||||||
FFlat: Boolean;
|
FFlat: Boolean;
|
||||||
FMouseInControl: Boolean;
|
FMouseInControl: Boolean;
|
||||||
function GetGlyph: TBitmap;
|
function GetGlyph: TBitmap;
|
||||||
|
function IsGlyphStored: Boolean;
|
||||||
procedure SetShowCaption(const AValue: boolean);
|
procedure SetShowCaption(const AValue: boolean);
|
||||||
procedure UpdateExclusive;
|
procedure UpdateExclusive;
|
||||||
function GetTransparent: Boolean;
|
function GetTransparent: Boolean;
|
||||||
@ -336,7 +337,7 @@ type
|
|||||||
property Color default clBtnFace;
|
property Color default clBtnFace;
|
||||||
property Down: Boolean read FDown write SetDown default false;
|
property Down: Boolean read FDown write SetDown default false;
|
||||||
property Flat: Boolean read FFlat write SetFlat default false;
|
property Flat: Boolean read FFlat write SetFlat default false;
|
||||||
property Glyph: TBitmap read GetGlyph write SetGlyph;
|
property Glyph: TBitmap read GetGlyph write SetGlyph stored IsGlyphStored;
|
||||||
property GroupIndex: Integer read FGroupIndex write SetGroupIndex default 0;
|
property GroupIndex: Integer read FGroupIndex write SetGroupIndex default 0;
|
||||||
property Layout: TButtonLayout read FLayout write SetLayout default blGlyphLeft;
|
property Layout: TButtonLayout read FLayout write SetLayout default blGlyphLeft;
|
||||||
property Margin: integer read FMargin write SetMargin default -1;
|
property Margin: integer read FMargin write SetMargin default -1;
|
||||||
|
@ -438,6 +438,20 @@ begin
|
|||||||
Result := FGlyph.Glyph;
|
Result := FGlyph.Glyph;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCustomSpeedButton.IsGlyphStored: Boolean;
|
||||||
|
var
|
||||||
|
act: TCustomAction;
|
||||||
|
begin
|
||||||
|
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;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomSpeedButton.SetShowCaption(const AValue: boolean);
|
procedure TCustomSpeedButton.SetShowCaption(const AValue: boolean);
|
||||||
begin
|
begin
|
||||||
if FShowCaption=AValue then exit;
|
if FShowCaption=AValue then exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user