mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 20:50:40 +02:00
SynEdit: Better class for GutterPart.MarkupInfo. Reduce unused colors.
This commit is contained in:
parent
746b454a8f
commit
ab906bebd2
@ -11059,9 +11059,12 @@ begin
|
||||
RegisterPropertyToSkip(TSynSelectedColor, 'OnChange', '', '');
|
||||
RegisterPropertyToSkip(TSynSelectedColor, 'StartX', '', '');
|
||||
RegisterPropertyToSkip(TSynSelectedColor, 'EndX', '', '');
|
||||
RegisterPropertyToSkip(TLazEditTextAttributeModifier, 'OnChange', '', '');
|
||||
RegisterPropertyToSkip(TLazEditTextAttributeModifier, 'StartX', '', '');
|
||||
RegisterPropertyToSkip(TLazEditTextAttributeModifier, 'EndX', '', '');
|
||||
RegisterPropertyToSkip(TSynGutterColorAttributes, 'BackAlpha', '', '');
|
||||
RegisterPropertyToSkip(TSynGutterColorAttributes, 'ForeAlpha', '', '');
|
||||
RegisterPropertyToSkip(TSynGutterColorAttributes, 'FrameAlpha', '', '');
|
||||
RegisterPropertyToSkip(TSynGutterColorAttributes, 'StyleMask', '', '');
|
||||
|
||||
RegisterPropertyToSkip(TSynGutter, 'ShowCodeFolding', '', '');
|
||||
RegisterPropertyToSkip(TSynGutter, 'CodeFoldingWidth', '', '');
|
||||
|
@ -16,6 +16,28 @@ uses
|
||||
|
||||
type
|
||||
|
||||
TSynGutterColorAttributes = class(TLazEditTextAttribute)
|
||||
published
|
||||
property Foreground;
|
||||
property Background;
|
||||
property FrameColor;
|
||||
|
||||
property ForePriority;
|
||||
property BackPriority;
|
||||
property FramePriority;
|
||||
|
||||
property FrameStyle;
|
||||
property FrameEdges;
|
||||
|
||||
property Style;
|
||||
property BoldPriority;
|
||||
property ItalicPriority;
|
||||
property UnderlinePriority;
|
||||
property StrikeOutPriority;
|
||||
|
||||
property OnChange;
|
||||
end;
|
||||
|
||||
{ TSynGutterColorAttributesModifier }
|
||||
|
||||
TSynGutterColorAttributesModifier = class(TLazEditTextAttributeModifier)
|
||||
@ -37,8 +59,6 @@ type
|
||||
property UnderlinePriority;
|
||||
property StrikeOutPriority;
|
||||
|
||||
//property Features; // not for gutter
|
||||
|
||||
property OnChange;
|
||||
published
|
||||
property BackAlpha;
|
||||
@ -209,7 +229,7 @@ type
|
||||
FVisible: Boolean;
|
||||
FSynEdit: TSynEditBase;
|
||||
FGutter: TSynGutterBase;
|
||||
FMarkupInfo: TSynGutterColorAttributesModifier;
|
||||
FMarkupInfo: TSynGutterColorAttributes;
|
||||
FMarkupInfoInternal: TLazEditTextAttributeModifier;
|
||||
FMarkupInfoCurrentLine: TSynGutterColorAttributesModifier;
|
||||
FMarkupInfoCurLineMerged: TSynSelectedColorMergeResult;
|
||||
@ -224,7 +244,7 @@ type
|
||||
function GetGutterParts: TSynGutterPartListBase;
|
||||
function GetMouseActions: TSynEditMouseActions;
|
||||
procedure SetLeftOffset(AValue: integer);
|
||||
procedure SetMarkupInfo(const AValue: TSynGutterColorAttributesModifier);
|
||||
procedure SetMarkupInfo(const AValue: TSynGutterColorAttributes);
|
||||
procedure SetMarkupInfoCurrentLine(AValue: TSynGutterColorAttributesModifier);
|
||||
procedure SetMouseActions(const AValue: TSynEditMouseActions);
|
||||
procedure SetRightOffset(AValue: integer);
|
||||
@ -278,7 +298,7 @@ type
|
||||
read FOnGutterClick write FOnGutterClick;
|
||||
property OnChange: TNotifyEvent read FOnChange write FOnChange;
|
||||
property Cursor: TCursor read FCursor write FCursor default crDefault;
|
||||
property MarkupInfo: TSynGutterColorAttributesModifier read FMarkupInfo write SetMarkupInfo;
|
||||
property MarkupInfo: TSynGutterColorAttributes read FMarkupInfo write SetMarkupInfo;
|
||||
property MarkupInfoCurrentLine: TSynGutterColorAttributesModifier read FMarkupInfoCurrentLine write SetMarkupInfoCurrentLine;
|
||||
published
|
||||
property AutoSize: boolean read FAutoSize write SetAutoSize default True;
|
||||
@ -730,7 +750,7 @@ begin
|
||||
Result := Gutter.CaretRow;
|
||||
end;
|
||||
|
||||
procedure TSynGutterPartBase.SetMarkupInfo(const AValue: TSynGutterColorAttributesModifier);
|
||||
procedure TSynGutterPartBase.SetMarkupInfo(const AValue: TSynGutterColorAttributes);
|
||||
begin
|
||||
FMarkupInfo.Assign(AValue);
|
||||
end;
|
||||
@ -876,7 +896,7 @@ begin
|
||||
if (AnOwner = nil) or not(AnOwner is TSynGutterPartListBase) then
|
||||
raise Exception.Create('Invalid Owner');
|
||||
|
||||
FMarkupInfo := TSynGutterColorAttributesModifier.Create;
|
||||
FMarkupInfo := TSynGutterColorAttributes.Create;
|
||||
FMarkupInfo.Background := clBtnFace;
|
||||
FMarkupInfo.Foreground := clNone;
|
||||
FMarkupInfo.FrameColor := clNone;
|
||||
|
@ -78,8 +78,8 @@ type
|
||||
aCount: Integer);
|
||||
procedure DoIncPaintLock(Sender: TObject);
|
||||
private
|
||||
FMarkupInfoCurrentFold: TSynGutterColorAttributesModifier;
|
||||
FMarkupInfoCurrentFoldInternal: TLazEditTextAttributeModifier;
|
||||
FMarkupInfoCurrentFold: TSynGutterColorAttributes;
|
||||
FMarkupInfoCurrentFoldInternal: TLazEditTextAttribute;
|
||||
FMouseActionsCollapsed: TSynEditMouseInternalActions;
|
||||
FMouseActionsExpanded: TSynEditMouseInternalActions;
|
||||
FPopUp: TPopupMenu;
|
||||
@ -92,7 +92,7 @@ type
|
||||
function GetFoldView: TSynEditFoldedView;
|
||||
function GetMouseActionsCollapsed: TSynEditMouseActions;
|
||||
function GetMouseActionsExpanded: TSynEditMouseActions;
|
||||
procedure SetMarkupInfoCurrentFold(AValue: TSynGutterColorAttributesModifier);
|
||||
procedure SetMarkupInfoCurrentFold(AValue: TSynGutterColorAttributes);
|
||||
procedure SetMouseActionsCollapsed(const AValue: TSynEditMouseActions);
|
||||
procedure SetMouseActionsExpanded(const AValue: TSynEditMouseActions);
|
||||
function FoldTypeForLine(AScreenLine: Integer): TSynEditFoldLineCapability;
|
||||
@ -133,7 +133,7 @@ type
|
||||
published
|
||||
property MarkupInfo;
|
||||
property MarkupInfoCurrentLine;
|
||||
property MarkupInfoCurrentFold: TSynGutterColorAttributesModifier read FMarkupInfoCurrentFold write SetMarkupInfoCurrentFold;
|
||||
property MarkupInfoCurrentFold: TSynGutterColorAttributes read FMarkupInfoCurrentFold write SetMarkupInfoCurrentFold;
|
||||
property MouseActionsExpanded: TSynEditMouseActions
|
||||
read GetMouseActionsExpanded write SetMouseActionsExpanded;
|
||||
property MouseActionsCollapsed: TSynEditMouseActions
|
||||
@ -166,7 +166,7 @@ begin
|
||||
end;
|
||||
|
||||
procedure TSynGutterCodeFolding.SetMarkupInfoCurrentFold(
|
||||
AValue: TSynGutterColorAttributesModifier);
|
||||
AValue: TSynGutterColorAttributes);
|
||||
begin
|
||||
FMarkupInfoCurrentFold.Assign(AValue);
|
||||
end;
|
||||
@ -456,8 +456,8 @@ begin
|
||||
FReversePopMenuOrder := true;
|
||||
FMouseActionsExpanded := TSynEditMouseActionsGutterFoldExpanded.Create(self);
|
||||
FMouseActionsCollapsed := TSynEditMouseActionsGutterFoldCollapsed.Create(self);
|
||||
FMarkupInfoCurrentFold := TSynGutterColorAttributesModifier.Create;
|
||||
FMarkupInfoCurrentFoldInternal := TLazEditTextAttributeModifier.Create;
|
||||
FMarkupInfoCurrentFold := TSynGutterColorAttributes.Create;
|
||||
FMarkupInfoCurrentFoldInternal := TLazEditTextAttribute.Create;
|
||||
FInnerFoldCaretY := -1;
|
||||
FInnerFoldStart := -1;
|
||||
|
||||
@ -887,7 +887,7 @@ var
|
||||
rcCodeFold: TRect;
|
||||
tmp: TSynEditFoldLineCapability;
|
||||
LineHeight, TextHeight, LineOffset, HalfBoxSize, aRow: Integer;
|
||||
CurMarkUp: TLazEditTextAttributeModifier;
|
||||
CurMarkUp: TLazEditTextAttribute;
|
||||
|
||||
procedure DrawNodeBox(rcCodeFold: TRect; NodeType: TSynEditFoldLineCapability);
|
||||
var
|
||||
|
@ -7792,7 +7792,7 @@ begin
|
||||
end;
|
||||
|
||||
procedure TColorSchemeLanguage.ApplyTo(ASynEdit: TSynEdit);
|
||||
procedure SetMarkupColor(aha: TAdditionalHilightAttribute; aMarkup : TLazEditTextAttributeModifier);
|
||||
procedure SetMarkupColor(aha: TAdditionalHilightAttribute; aMarkup : TLazEditTextAttribute);
|
||||
var Attrib: TColorSchemeAttribute;
|
||||
begin
|
||||
Attrib := AttributeByEnum[aha];
|
||||
|
Loading…
Reference in New Issue
Block a user