diff --git a/components/ideintf/propedits.pp b/components/ideintf/propedits.pp index d783055e00..7180c41124 100644 --- a/components/ideintf/propedits.pp +++ b/components/ideintf/propedits.pp @@ -6957,6 +6957,8 @@ begin if ARoot = nil then Continue; if (ARoot <> APersistent) and (List.IndexOf(ARoot) >= 0) then Continue; List.Add(ARoot); + if ARoot is TControl then + TControl(ARoot).Invalidate; // ... get the designer ... AForm := GetDesignerForm(ARoot); if Assigned(AForm) and Assigned(AForm.Designer) then diff --git a/designer/anchoreditor.pas b/designer/anchoreditor.pas index 450f07ff6d..6b3529674d 100644 --- a/designer/anchoreditor.pas +++ b/designer/anchoreditor.pas @@ -43,7 +43,7 @@ uses // IdeIntf IdeIntfStrConsts, IDECommands, PropEdits, IDEDialogs, IDEImagesIntf, // IDE - LazarusIDEStrConsts, IDEOptionDefs, EnvironmentOpts; + LazarusIDEStrConsts, IDEOptionDefs, EnvironmentOpts, EnvGuiOptions; type @@ -638,6 +638,12 @@ begin end; GlobalDesignHook.Modified(Self, 'Anchors'); GlobalDesignHook.RefreshPropertyValues; + // redraw border spacing frame + if EnvironmentGuiOpts.ShowBorderSpacing then + if (GlobalDesignHook.LookupRoot is TCustomForm) or + (GlobalDesignHook.LookupRoot is TCustomFrame) + then + TControl(GlobalDesignHook.LookupRoot).Invalidate; end; end; diff --git a/lcl/controls.pp b/lcl/controls.pp index 0892f10185..d1a3596dd7 100644 --- a/lcl/controls.pp +++ b/lcl/controls.pp @@ -854,6 +854,7 @@ type procedure SetTop(const AValue: TSpacingSize); protected procedure Change(InnerSpaceChanged: Boolean); virtual; + function GetOwner: TPersistent; override; public constructor Create(OwnerControl: TControl; ADefault: PControlBorderSpacingDefault = nil); procedure Assign(Source: TPersistent); override; @@ -3852,8 +3853,7 @@ begin end; end; -function TControlBorderSpacing.IsEqual(Spacing: TControlBorderSpacing - ): Boolean; +function TControlBorderSpacing.IsEqual(Spacing: TControlBorderSpacing): Boolean; begin Result:=(FAround=Spacing.Around) and (FBottom=Spacing.Bottom) @@ -3893,6 +3893,11 @@ begin if Assigned(OnChange) then OnChange(Self); end; +function TControlBorderSpacing.GetOwner: TPersistent; +begin + Result := FControl; +end; + function TControlBorderSpacing.GetAroundBottom: Integer; begin Result := Around+Bottom;