diff --git a/designer/designer.pp b/designer/designer.pp index daf7ccf376..4067cb08c6 100644 --- a/designer/designer.pp +++ b/designer/designer.pp @@ -3251,7 +3251,7 @@ begin if ShowBorderSpacing then begin - aDDC.Canvas.Brush.Color := clRed; + aDDC.Canvas.Brush.Color := EnvironmentOptions.BorderSpacingColor; for i := 0 to Count - 1 do begin CurControl := AWinControl.Controls[i]; diff --git a/ide/frames/formed_options.pas b/ide/frames/formed_options.pas index ccae745068..2912691ce1 100644 --- a/ide/frames/formed_options.pas +++ b/ide/frames/formed_options.pas @@ -36,6 +36,7 @@ uses type TDesignerColor = ( dcGrid, + dcBorderSpacing, dcGridLinesLeftTop, dcGridLinesRightBottom, dcGrabber, @@ -163,6 +164,7 @@ begin begin // read colors ColorsListBox.Items.Objects[Ord(dcGrid)] := TObject(PtrInt(GridColor)); + ColorsListBox.Items.Objects[Ord(dcBorderSpacing)] := TObject(PtrInt(BorderSpacingColor)); ColorsListBox.Items.Objects[Ord(dcGridLinesLeftTop)] := TObject(PtrInt(GuideLineColorLeftTop)); ColorsListBox.Items.Objects[Ord(dcGridLinesRightBottom)] := TObject(PtrInt(GuideLineColorRightBottom)); ColorsListBox.Items.Objects[Ord(dcGrabber)] := TObject(PtrInt(GrabberColor)); @@ -199,6 +201,7 @@ begin begin // write colors GridColor := ColorsListBox.Colors[Ord(dcGrid)]; + BorderSpacingColor := ColorsListBox.Colors[Ord(dcBorderSpacing)]; GuideLineColorLeftTop := ColorsListBox.Colors[Ord(dcGridLinesLeftTop)]; GuideLineColorRightBottom := ColorsListBox.Colors[Ord(dcGridLinesRightBottom)]; GrabberColor := ColorsListBox.Colors[Ord(dcGrabber)]; @@ -245,6 +248,7 @@ procedure TFormEditorOptionsFrame.ColorsListBoxGetColors( Sender: TCustomColorListBox; Items: TStrings); begin Items.Add(dlgGridColor); + Items.Add(dlgBorderSpacingColor); Items.Add(dlgLeftTopClr); Items.Add(dlgRightBottomClr); Items.Add(dlgGrabberColor); diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index 7df69800e3..e5ed4f54e3 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -1432,7 +1432,7 @@ resourcestring dlgGridConsistsOfSmallDots = 'Grid consists of small dots which help aligning controls.'; dlgQShowBorderSpacing = 'Show border spacing'; dlgBorderSpaceCanBeSetInAnchorEditor = 'Border space can be set in Anchor editor. ' - +'A red line is shown if spacing > 0.'; + +'A colored line is shown if spacing > 0.'; dlgQSnapToGrid = 'Snap to grid'; dlgDistanceBetweenGridPointsIsSmallestStep = 'Distance between grid points is ' +'the smallest step when moving a control.'; @@ -1451,6 +1451,7 @@ resourcestring dlgRightBottomClr = 'Guide lines Right,Bottom'; dlgGrabberColor = 'Grabber color'; dlgMarkerColor = 'Marker color'; + dlgBorderSpacingColor = 'BorderSpacing frame color'; dlgNonFormBackgroundColor = 'Other Designer background color (e. g. TDataModule)'; dlgRuberbandSelectionColor = 'Rubberband Selection'; dlgRuberbandCreationColor = 'Rubberband Creation'; diff --git a/ide/packages/ideconfig/environmentopts.pp b/ide/packages/ideconfig/environmentopts.pp index c4b2b7b32a..8585c186aa 100644 --- a/ide/packages/ideconfig/environmentopts.pp +++ b/ide/packages/ideconfig/environmentopts.pp @@ -80,6 +80,7 @@ const DefaultAutoSaveIntervalInSecs = 300; DefaultRubberbandSelectsGrandChilds = false; + DefaultBorderSpacingColor = clRed; DefaultGridColor = clBlack; DefaultGridSize = 8; DefaultGuideLineColorLeftTop = clBlue; @@ -577,6 +578,7 @@ type FCreateComponentFocusNameProperty: boolean; FSwitchToFavoritesOITab: boolean; FShowBorderSpacing: boolean; + FBorderSpacingColor: TColor; FShowGrid: boolean; FSnapToGrid: boolean; FGridSizeX: integer; @@ -808,6 +810,7 @@ type // form editor property ShowBorderSpacing: boolean read FShowBorderSpacing write FShowBorderSpacing; + property BorderSpacingColor: TColor read FBorderSpacingColor write FBorderSpacingColor; property ShowGrid: boolean read FShowGrid write FShowGrid; property SnapToGrid: boolean read FSnapToGrid write FSnapToGrid; property GridColor: TColor read FGridColor write FGridColor; @@ -1825,6 +1828,7 @@ begin // EnvironmentOptionsDialog editor FShowGrid:=true; FShowBorderSpacing:=false; + FBorderSpacingColor:=DefaultBorderSpacingColor; FGridColor:=DefaultGridColor; FSnapToGrid:=true; FGridSizeX:=DefaultGridSize; @@ -2309,6 +2313,7 @@ begin // form editor FShowGrid:=FXMLCfg.GetValue(Path+'FormEditor/ShowGrid',true); FShowBorderSpacing:=FXMLCfg.GetValue(Path+'FormEditor/ShowBorderSpacing',false); + FBorderSpacingColor:=FXMLCfg.GetValue(Path+'FormEditor/BorderSpacingColor',DefaultBorderSpacingColor); FGridColor:=FXMLCfg.GetValue(Path+'FormEditor/GridColor',DefaultGridColor); FSnapToGrid:=FXMLCfg.GetValue(Path+'FormEditor/SnapToGrid',true); FGridSizeX:=FXMLCfg.GetValue(Path+'FormEditor/GridSizeX',DefaultGridSize); @@ -2686,6 +2691,7 @@ begin // form editor FXMLCfg.SetDeleteValue(Path+'FormEditor/ShowBorderSpacing',FShowBorderSpacing,false); + FXMLCfg.SetDeleteValue(Path+'FormEditor/BorderSpacingColor',FBorderSpacingColor,DefaultBorderSpacingColor); FXMLCfg.SetDeleteValue(Path+'FormEditor/ShowGrid',FShowGrid,true); FXMLCfg.SetDeleteValue(Path+'FormEditor/GridColor',FGridColor,DefaultGridColor); FXMLCfg.SetDeleteValue(Path+'FormEditor/SnapToGrid',FSnapToGrid,true); diff --git a/languages/lazaruside.pot b/languages/lazaruside.pot index dd05f115e4..7bfa2ad2f7 100644 --- a/languages/lazaruside.pot +++ b/languages/lazaruside.pot @@ -3450,6 +3450,10 @@ msgstr "" msgid "Show border spacing" msgstr "" +#: lazarusidestrconsts.dlgborderspacingcolor +msgid "BorderSpacing frame color" +msgstr "" + #: lazarusidestrconsts.dlgqshowgrid msgid "Show grid" msgstr ""