editor, add option to set the gutter transparent

This commit is contained in:
Basile Burg 2017-06-26 07:54:15 +02:00
parent 8d03f8e53e
commit 46041acb64
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
2 changed files with 30 additions and 0 deletions

View File

@ -68,6 +68,7 @@ type
fAutoCallCompletion: boolean;
fCloseCompletionCharsWithSpace: AnsiString;
fCloseCompletionChars: AnsiString;
fTransparentGutter: boolean;
//
procedure setPhobosDocRoot(value: TCEPathname);
procedure setFont(value: TFont);
@ -124,6 +125,7 @@ type
property shortcuts: TCollection read fShortCuts write setShortcuts;
property smartDdocNewline: boolean read fSmartDdocNewline write fSmartDdocNewline;
property tabulationWidth: Integer read fTabWidth write fTabWidth default 4;
property transparentGutter: boolean read fTransparentGutter write fTransparentGutter default false;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
@ -295,6 +297,7 @@ begin
begin
srcopt := TCEEditorOptionsBase(source);
//
fTransparentGutter:=srcopt.fTransparentGutter;
fAlwaysAdvancedFeatures:=srcopt.fAlwaysAdvancedFeatures;
fResetFontSize:=srcopt.fResetFontSize;
fAutoCloseCurlyBrace := srcopt.fAutoCloseCurlyBrace;
@ -697,6 +700,7 @@ begin
anEditor.insertPlusDdoc:= fInsertPlusDdoc;
anEditor.autoCallCompletion:= fAutoCallCompletion;
anEditor.completionMenuAutoClose:=fCompletionMenuAutoClose;
anEditor.transparentGutter:=fTransparentGutter;
cs := [];
for c in fCloseCompletionCharsWithSpace do

View File

@ -186,6 +186,8 @@ type
fCloseCompletionCharsWithSpace: TSysCharSet;
fCloseCompletionChars: TSysCharSet;
fCompletionMenuAutoClose: boolean;
fTransparentGutter: boolean;
procedure setGutterTransparent(value: boolean);
procedure decCallTipsLvl;
procedure setMatchOpts(value: TIdentifierMatchOptions);
function getMouseBytePosition: Integer;
@ -298,6 +300,7 @@ type
property isTemporary: boolean read getIfTemp;
property TextView;
//
property transparentGutter: boolean read fTransparentGutter write setGutterTransparent;
property isProjectDescription: boolean read fIsProjectDescription write fIsProjectDescription;
property alwaysAdvancedFeatures: boolean read fAlwaysAdvancedFeatures write fAlwaysAdvancedFeatures;
property phobosDocRoot: string read fPhobosDocRoot write fPhobosDocRoot;
@ -834,6 +837,29 @@ begin
inherited;
end;
procedure TCESynMemo.setGutterTransparent(value: boolean);
begin
fTransparentGutter:=value;
if fTransparentGutter then
begin
Gutter.LineNumberPart.MarkupInfo.Background:= Color;
Gutter.SeparatorPart.MarkupInfo.Background:= Color;
Gutter.MarksPart.MarkupInfo.Background:= Color;
Gutter.ChangesPart.MarkupInfo.Background:= Color;
Gutter.CodeFoldPart.MarkupInfo.Background:= Color;
Gutter.Color:=Color;
end
else
begin
Gutter.LineNumberPart.MarkupInfo.Background:= clBtnFace;
Gutter.SeparatorPart.MarkupInfo.Background:= clBtnFace;
Gutter.MarksPart.MarkupInfo.Background:= clBtnFace;
Gutter.ChangesPart.MarkupInfo.Background:= clBtnFace;
Gutter.CodeFoldPart.MarkupInfo.Background:= clBtnFace;
Gutter.Color:=clBtnFace;
end;
end;
procedure TCESynMemo.setDefaultFontSize(value: Integer);
var
old: Integer;