From f9306c95d1e7ce225fd59f5c1df9bd2a9e792c58 Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 7 May 2018 18:16:54 +0000 Subject: [PATCH] MenuEditor: Fixed wrong item height when in ObjectInspector caption is set from text to "-" and vice versa. Issue #33415 git-svn-id: branches/fixes_1_8@57813 - --- designer/menueditor.pp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/designer/menueditor.pp b/designer/menueditor.pp index 9eba6a96d8..d936566642 100644 --- a/designer/menueditor.pp +++ b/designer/menueditor.pp @@ -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; @@ -2120,6 +2121,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;