mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 10:18:05 +02:00
IDE, EditorOptions: add colors for Overview-Gutter
git-svn-id: trunk@61095 -
This commit is contained in:
parent
f62d14900f
commit
c12c24dc34
@ -43,6 +43,7 @@
|
||||
<ahaGutterSeparator Background="clWhite" Foreground="clGray"/>
|
||||
<ahaGutter Background="clBtnFace"/>
|
||||
<ahaRightMargin Foreground="clSilver"/>
|
||||
<ahaOverviewGutter Foreground="13948116" Background="15263976" FrameColor="12632256"/>
|
||||
<ahaIdentComplWindowHighlight Foreground="187"/>
|
||||
<ahaOutlineLevel1Color Foreground="clRed"/>
|
||||
<ahaOutlineLevel2Color Foreground="39159"/>
|
||||
|
@ -43,6 +43,7 @@
|
||||
<ahaGutterSeparator Background="clWhite" Foreground="clGray"/>
|
||||
<ahaGutter Background="clBtnFace"/>
|
||||
<ahaRightMargin Foreground="clSilver"/>
|
||||
<ahaOverviewGutter Foreground="13948116" Background="15263976" FrameColor="12632256"/>
|
||||
<ahaIdentComplWindowHighlight Foreground="191"/>
|
||||
<ahaOutlineLevel1Color Foreground="clRed"/>
|
||||
<ahaOutlineLevel2Color Foreground="39159"/>
|
||||
|
@ -43,6 +43,7 @@
|
||||
<ahaGutterSeparator Background="clWhite" Foreground="clGray"/>
|
||||
<ahaGutter Background="clNavy"/>
|
||||
<ahaRightMargin Foreground="clSilver"/>
|
||||
<ahaOverviewGutter Foreground="4210752" Background="6579300" FrameColor="clBlue"/>
|
||||
<ahaIdentComplWindowHighlight Foreground="clAqua"/>
|
||||
<ahaIdentComplWindow Background="8388649"/>
|
||||
<ahaOutlineLevel1Color Foreground="clRed"/>
|
||||
|
@ -39,6 +39,7 @@
|
||||
<ahaIfDefNodeTmpActive ForePriority="9050" BackPriority="9050" FramePriority="9050"/>
|
||||
<ahaModifiedLine Foreground="clGreen" FrameColor="59900"/>
|
||||
<ahaRightMargin Foreground="clSilver"/>
|
||||
<ahaOverviewGutter Foreground="4210752" Background="6579300" FrameColor="clBlue"/>
|
||||
<ahaCodeFoldingTree Foreground="clSilver"/>
|
||||
<ahaGutterSeparator Background="clWhite" Foreground="clGray"/>
|
||||
<ahaGutter Background="clNavy"/>
|
||||
|
@ -43,6 +43,7 @@
|
||||
<ahaGutterSeparator Background="clWhite" Foreground="clGray"/>
|
||||
<ahaGutter Background="clBlack"/>
|
||||
<ahaRightMargin Foreground="clSilver"/>
|
||||
<ahaOverviewGutter Foreground="4210752" Background="6579300" FrameColor="8947848"/>
|
||||
<ahaIdentComplWindow Background="3552822"/>
|
||||
<ahaIdentComplWindowBorder Foreground="7039851"/>
|
||||
<ahaIdentComplWindowHighlight Foreground="clLime"/>
|
||||
|
@ -62,7 +62,7 @@ uses
|
||||
SynHighlighterPython, SynHighlighterUNIXShellScript, SynHighlighterXML,
|
||||
SynHighlighterJScript, SynHighlighterDiff, SynHighlighterBat,
|
||||
SynHighlighterIni, SynHighlighterPo, SynHighlighterPike, SynPluginMultiCaret,
|
||||
SynEditMarkupFoldColoring, SynEditMarkup,
|
||||
SynEditMarkupFoldColoring, SynEditMarkup, SynGutterLineOverview,
|
||||
// codetools
|
||||
LinkScanner, CodeToolManager,
|
||||
// IDEIntf
|
||||
@ -123,7 +123,7 @@ const
|
||||
'', // ahaRightMargin
|
||||
'', // ahaSpecialVisibleChars
|
||||
'', // ahaTopInfoHint
|
||||
'', // ahaCaretColor
|
||||
'', '', // ahaCaretColor, ahaOverviewGutter
|
||||
'', '', '', // ahaIfDefBlockInactive, ahaIfDefBlockActive, ahaIfDefBlockTmpActive
|
||||
'', '', '', // ahaIfDefNodeInactive, ahaIfDefNodeActive, ahaIfDefNodeTmpActive
|
||||
'', '', '', '', // ahaIdentComplWindow, ahaIdentComplWindowBorder, ahaIdentComplWindowSelection, ahaIdentComplWindowHighlight
|
||||
@ -165,6 +165,7 @@ const
|
||||
{ ahaSpecialVisibleChars } agnText,
|
||||
{ ahaTopInfoHint } agnLine,
|
||||
{ ahaCaretColor } agnText,
|
||||
{ ahaOverviewGutter } agnGutter,
|
||||
{ ahaIfDefBlockInactive } agnIfDef,
|
||||
{ ahaIfDefBlockActive } agnIfDef,
|
||||
{ ahaIfDefBlockTmpActive } agnIfDef,
|
||||
@ -223,6 +224,7 @@ const
|
||||
{ ahaSpecialVisibleChars }[hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
|
||||
{ ahaTopInfoHint } [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
|
||||
{ ahaCaretColor } [hafBackColor, hafForeColor],
|
||||
{ ahaOverviewGutter } [hafBackColor, hafForeColor, hafFrameColor],
|
||||
{ ahaIfDefBlockInactive } [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
|
||||
{ ahaIfDefBlockActive } [hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
|
||||
{ ahaIfDefBlockTmpActive }[hafBackColor, hafForeColor, hafFrameColor, hafAlpha, hafPrior, hafFrameStyle, hafFrameEdges, hafStyle, hafStyleMask],
|
||||
@ -2568,6 +2570,7 @@ begin
|
||||
AdditionalHighlightAttributes[ahaSpecialVisibleChars] := dlgAddHiSpecialVisibleChars;
|
||||
AdditionalHighlightAttributes[ahaTopInfoHint] := dlgTopInfoHint;
|
||||
AdditionalHighlightAttributes[ahaCaretColor] := dlgCaretColor;
|
||||
AdditionalHighlightAttributes[ahaOverviewGutter] := dlgOverviewGutterColor;
|
||||
AdditionalHighlightAttributes[ahaIfDefBlockInactive] := dlgIfDefBlockInactive;
|
||||
AdditionalHighlightAttributes[ahaIfDefBlockActive] := dlgIfDefBlockActive;
|
||||
AdditionalHighlightAttributes[ahaIfDefBlockTmpActive] := dlgIfDefBlockTmpActive;
|
||||
@ -6704,6 +6707,8 @@ var
|
||||
IDESynEdit: TIDESynEditor;
|
||||
aha: TAdditionalHilightAttribute;
|
||||
col: TColor;
|
||||
OGutter: TSynGutterLineOverview;
|
||||
OGutterProv: TSynGutterLineOverviewProvider;
|
||||
begin
|
||||
ASynEdit.BeginUpdate;
|
||||
try
|
||||
@ -6781,6 +6786,35 @@ begin
|
||||
SetGutterColorByClass(ahaCodeFoldingTree, TSynGutterCodeFolding);
|
||||
SetGutterColorByClass(ahaGutterSeparator, TSynGutterSeparator);
|
||||
|
||||
OGutter := TSynGutterLineOverview(ASynEdit.RightGutter.Parts.ByClass[TSynGutterLineOverview, 0]);
|
||||
if OGutter <> nil then begin
|
||||
for i := 0 to OGutter.Providers.Count - 1 do begin
|
||||
OGutterProv := OGutter.Providers[i];
|
||||
if OGutterProv is TSynGutterLOvProviderModifiedLines then begin
|
||||
Attri := GetUsedAttr(ahaModifiedLine);
|
||||
if Attri <> nil then begin
|
||||
OGutterProv.Color := Attri.Foreground;
|
||||
TSynGutterLOvProviderModifiedLines(OGutterProv).ColorSaved := Attri.FrameColor;
|
||||
end;
|
||||
end
|
||||
else
|
||||
if OGutterProv is TSynGutterLOvProviderCurrentPage then begin
|
||||
Attri := GetUsedAttr(ahaOverviewGutter);
|
||||
if Attri <> nil then begin
|
||||
OGutterProv.Color := Attri.FrameColor;
|
||||
end;
|
||||
end
|
||||
else
|
||||
if OGutterProv is TIDESynGutterLOvProviderPascal then begin
|
||||
Attri := GetUsedAttr(ahaOverviewGutter);
|
||||
if Attri <> nil then begin
|
||||
OGutterProv.Color := Attri.Foreground;
|
||||
TIDESynGutterLOvProviderPascal(OGutterProv).Color2 := Attri.Background;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
if ASynEdit is TIDESynEditor then
|
||||
begin
|
||||
IDESynEdit := TIDESynEditor(ASynEdit);
|
||||
|
Binary file not shown.
@ -287,8 +287,21 @@ begin
|
||||
TheTree.Canvas.Brush.Color := c;
|
||||
TheTree.Canvas.FillRect(NodeRect.Left+2, NodeRect.Top+2, NodeRect.Left+FullAbcWidth-2, NodeRect.Bottom-2);
|
||||
|
||||
// Special draw overview line gutter
|
||||
if (AttriIdx = ord(ahaOverviewGutter)) then begin
|
||||
TextY := (NodeRect.Bottom - NodeRect.Top - 4) Div 2;
|
||||
TheTree.Canvas.Brush.Color := Attri.Foreground;
|
||||
TheTree.Canvas.FillRect(NodeRect.Left+2, NodeRect.Top+2, NodeRect.Left+FullAbcWidth-2, NodeRect.Top+2+TextY);
|
||||
TheTree.Canvas.Brush.Color := Attri.Background;
|
||||
TheTree.Canvas.FillRect(NodeRect.Left+2, NodeRect.Top+2+TextY, NodeRect.Left+5, NodeRect.Bottom-2);
|
||||
TextY := FullAbcWidth div 4;
|
||||
TheTree.Canvas.Brush.Color := Attri.FrameColor;
|
||||
TheTree.Canvas.FillRect(NodeRect.Left+2+TextY, NodeRect.Top+3, NodeRect.Left+FullAbcWidth-2-TextY, NodeRect.Bottom-3);
|
||||
exit;
|
||||
end;
|
||||
|
||||
// Special draw Modified line gutter
|
||||
if (AttriIdx = ord(ahaModifiedLine)) then begin
|
||||
if (AttriIdx = ord(ahaModifiedLine))then begin
|
||||
TextY := NodeRect.Bottom - NodeRect.Top - 4;
|
||||
TheTree.Canvas.Brush.Color := Attri.Foreground;
|
||||
TheTree.Canvas.FillRect(NodeRect.Left+2, NodeRect.Top+2, NodeRect.Left+5, NodeRect.Bottom-2);
|
||||
|
@ -1982,6 +1982,9 @@ resourcestring
|
||||
dlgGutterCollapsedColor = 'Collapsed';
|
||||
dlgCaretForeColor = 'Color (NotXor)';
|
||||
dlgCaretBackColor = 'Multi/2nd (NotXor)';
|
||||
dlgOverviewGutterBack1Color = 'Background 1';
|
||||
dlgOverviewGutterBack2Color = 'Background 2';
|
||||
dlgOverviewGutterPageColor = 'Page';
|
||||
dlgElementAttributes = 'Element Attributes';
|
||||
dlgEdBold = 'Bold';
|
||||
dlgEdItal = 'Italic';
|
||||
@ -2176,6 +2179,7 @@ resourcestring
|
||||
dlgAddHiSpecialVisibleChars = 'Visualized Special Chars';
|
||||
dlgTopInfoHint = 'Current Class/Proc Hint';
|
||||
dlgCaretColor = 'Caret';
|
||||
dlgOverviewGutterColor = 'Overview Gutter';
|
||||
dlgIfDefBlockInactive = 'Inactive $IFDEF code';
|
||||
dlgIfDefBlockActive = 'Active $IFDEF code';
|
||||
dlgIfDefBlockTmpActive = 'Included mixed state $IFDEF code';
|
||||
|
@ -63,7 +63,7 @@ type
|
||||
ahaTemplateEditOther, ahaSyncroEditCur, ahaSyncroEditSync,
|
||||
ahaSyncroEditOther, ahaSyncroEditArea, ahaGutterSeparator,
|
||||
ahaGutter, ahaRightMargin, ahaSpecialVisibleChars,
|
||||
ahaTopInfoHint, ahaCaretColor,
|
||||
ahaTopInfoHint, ahaCaretColor, ahaOverviewGutter,
|
||||
ahaIfDefBlockInactive, ahaIfDefBlockActive, ahaIfDefBlockTmpActive,
|
||||
ahaIfDefNodeInactive, ahaIfDefNodeActive, ahaIfDefNodeTmpActive,
|
||||
ahaIdentComplWindow, ahaIdentComplWindowBorder, ahaIdentComplWindowSelection, ahaIdentComplWindowHighlight,
|
||||
|
@ -525,6 +525,12 @@ begin
|
||||
end;
|
||||
|
||||
procedure TSynColorAttrEditor.UpdateAll;
|
||||
function IsAhaElement(Element: TColorSchemeAttribute; aha: TAdditionalHilightAttribute): Boolean;
|
||||
begin
|
||||
Result := (FCurrentColorScheme <> nil) and
|
||||
(FCurrentColorScheme.AttributeByEnum[aha] <> nil) and
|
||||
(Element.StoredName = FCurrentColorScheme.AttributeByEnum[aha].StoredName);
|
||||
end;
|
||||
begin
|
||||
if (FCurHighlightElement = nil) or UpdatingColor then
|
||||
Exit;
|
||||
@ -536,22 +542,21 @@ begin
|
||||
BackGroundUseDefaultCheckBox.Caption := dlgBackColor;
|
||||
FrameColorUseDefaultCheckBox.Caption := dlgFrameColor;
|
||||
if FCurrentColorScheme <> nil then begin
|
||||
if (FCurrentColorScheme.AttributeByEnum[ahaModifiedLine] <> nil) and
|
||||
(FCurHighlightElement.StoredName = FCurrentColorScheme.AttributeByEnum[ahaModifiedLine].StoredName)
|
||||
then begin
|
||||
if IsAhaElement(FCurHighlightElement, ahaModifiedLine) then begin
|
||||
ForeGroundUseDefaultCheckBox.Caption := dlgSavedLineColor;
|
||||
FrameColorUseDefaultCheckBox.Caption := dlgUnsavedLineColor;
|
||||
end else
|
||||
if (FCurrentColorScheme.AttributeByEnum[ahaCodeFoldingTree] <> nil) and
|
||||
(FCurHighlightElement.StoredName = FCurrentColorScheme.AttributeByEnum[ahaCodeFoldingTree].StoredName)
|
||||
then begin
|
||||
if IsAhaElement(FCurHighlightElement, ahaCodeFoldingTree) then begin
|
||||
FrameColorUseDefaultCheckBox.Caption := dlgGutterCollapsedColor;
|
||||
end else
|
||||
if (FCurrentColorScheme.AttributeByEnum[ahaCaretColor] <> nil) and
|
||||
(FCurHighlightElement.StoredName = FCurrentColorScheme.AttributeByEnum[ahaCaretColor].StoredName)
|
||||
then begin
|
||||
if IsAhaElement(FCurHighlightElement, ahaCaretColor) then begin
|
||||
ForeGroundUseDefaultCheckBox.Caption := dlgCaretForeColor;
|
||||
BackGroundUseDefaultCheckBox.Caption := dlgCaretBackColor;
|
||||
end else
|
||||
if IsAhaElement(FCurHighlightElement, ahaOverviewGutter) then begin
|
||||
ForeGroundUseDefaultCheckBox.Caption := dlgOverviewGutterBack1Color;
|
||||
BackGroundUseDefaultCheckBox.Caption := dlgOverviewGutterBack2Color;
|
||||
FrameColorUseDefaultCheckBox.Caption := dlgOverviewGutterPageColor;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user