MenuEditor: Fixed wrong item height when in ObjectInspector caption is set from text to "-" and vice versa. Issue #33415

git-svn-id: trunk@57569 -
This commit is contained in:
michl 2018-03-27 19:28:44 +00:00
parent cc7720503b
commit c103818545

View File

@ -96,6 +96,7 @@ type
constructor CreateWithBoxAndItem(aSMenu: TShadowMenu; aParentBox: TShadowBox;
aRealItem: TMenuItem);
function GetWidth: integer; override;
procedure Invalidate; override;
public
property BottomFake: TFake read GetBottomFake write FBottomFake;
property IsInMenuBar: boolean read GetIsInMenuBar;
@ -2108,6 +2109,20 @@ begin
Result:=w + Double_DropDown_Text_Offset + GetShortcutWidth + Add_Icon_Width;
end;
procedure TShadowItem.Invalidate;
var
OldHeight, NewHeight: Integer;
begin
OldHeight := Height;
NewHeight := GetHeight;
if OldHeight <> NewHeight then
begin
Height := NewHeight;
FParentBox.LocateShadows;
end;
inherited Invalidate;
end;
function TShadowItem.HasChildBox(out aChildBox: TShadowBoxBase): boolean;
begin
aChildBox:=nil;