EditorOptions: Added color for [+] fold node

git-svn-id: trunk@25902 -
This commit is contained in:
martin 2010-06-04 21:04:34 +00:00
parent 0d49ef41c9
commit 2cec83d068
3 changed files with 32 additions and 12 deletions

View File

@ -168,7 +168,7 @@ const
{ ahaLineNumber } [hafBackColor, hafForeColor, hafFrameColor, hafStyle, hafStyleMask], { ahaLineNumber } [hafBackColor, hafForeColor, hafFrameColor, hafStyle, hafStyleMask],
{ ahaLineHighlight } [hafBackColor, hafForeColor, hafFrameColor, hafStyle, hafStyleMask], { ahaLineHighlight } [hafBackColor, hafForeColor, hafFrameColor, hafStyle, hafStyleMask],
{ ahaModifiedLine } [hafBackColor, hafForeColor, hafFrameColor], { ahaModifiedLine } [hafBackColor, hafForeColor, hafFrameColor],
{ ahaCodeFoldingTree } [hafBackColor, hafForeColor], { ahaCodeFoldingTree } [hafBackColor, hafForeColor, hafFrameColor],
{ ahaHighlightWord } [hafBackColor, hafForeColor, hafFrameColor, hafStyle, hafStyleMask], { ahaHighlightWord } [hafBackColor, hafForeColor, hafFrameColor, hafStyle, hafStyleMask],
{ ahaFoldedCode } [hafBackColor, hafForeColor, hafFrameColor, hafStyle, hafStyleMask], { ahaFoldedCode } [hafBackColor, hafForeColor, hafFrameColor, hafStyle, hafStyleMask],
{ ahaWordGroup } [hafBackColor, hafForeColor, hafFrameColor, hafStyle, hafStyleMask], { ahaWordGroup } [hafBackColor, hafForeColor, hafFrameColor, hafStyle, hafStyleMask],

View File

@ -210,18 +210,18 @@ begin
ColorElementTree.Canvas.FillRect(NodeRect); ColorElementTree.Canvas.FillRect(NodeRect);
ColorElementTree.Canvas.TextOut(NodeRect.Left+FullAbcWidth, TextY, Attri.Name); ColorElementTree.Canvas.TextOut(NodeRect.Left+FullAbcWidth, TextY, Attri.Name);
// Draw preview box // Draw preview box - Background
c := clNone; c := clNone;
if (hafBackColor in Attri.Features) then if (hafBackColor in Attri.Features) then
c := Attri.Background; c := Attri.Background;
// Fallback color for gutter // Fallback Background-color for gutter
if ((c = clNone) or (c = clDefault)) and if ((c = clNone) or (c = clDefault)) and
(AttriIdx in [ord(ahaModifiedLine), ord(ahaCodeFoldingTree), (AttriIdx in [ord(ahaModifiedLine), ord(ahaCodeFoldingTree),
ord(ahaLineNumber), ord(ahaGutterSeparator)]) and ord(ahaLineNumber), ord(ahaGutterSeparator)]) and
(FCurrentColorScheme.AttributeByEnum[ahaGutter] <> nil) (FCurrentColorScheme.AttributeByEnum[ahaGutter] <> nil)
then then
c := FCurrentColorScheme.AttributeByEnum[ahaGutter].Background; c := FCurrentColorScheme.AttributeByEnum[ahaGutter].Background;
// Fallback color for text // Fallback Background-color for text
if (c = clNone) or (c = clDefault) then if (c = clNone) or (c = clDefault) then
c := FCurrentColorScheme.DefaultAttribute.Background; c := FCurrentColorScheme.DefaultAttribute.Background;
if (c = clNone) or (c = clDefault) then if (c = clNone) or (c = clDefault) then
@ -241,7 +241,7 @@ begin
// Draw preview Frame // Draw preview Frame
ColorElementTree.Canvas.Pen.Color := Attri.FrameColor; ColorElementTree.Canvas.Pen.Color := Attri.FrameColor;
if (hafFrameColor in Attri.Features) and if (hafFrameColor in Attri.Features) and (AttriIdx <> ord(ahaCodeFoldingTree)) and
(Attri.FrameColor <> clDefault) and (Attri.FrameColor <> clNone) (Attri.FrameColor <> clDefault) and (Attri.FrameColor <> clNone)
then then
ColorElementTree.Canvas.Rectangle(NodeRect.Left+2, NodeRect.Top+2, ColorElementTree.Canvas.Rectangle(NodeRect.Left+2, NodeRect.Top+2,
@ -260,9 +260,8 @@ begin
if AttriIdx = ord(ahaCodeFoldingTree) then begin if AttriIdx = ord(ahaCodeFoldingTree) then begin
// Special draw fold gutter // Special draw fold gutter
TextY := NodeRect.Bottom - NodeRect.Top - 8; TextY := NodeRect.Bottom - NodeRect.Top - 8;
ColorElementTree.Canvas.Brush.Color := clWhite;
ColorElementTree.Canvas.FillRect(NodeRect.Left+4, NodeRect.Top+4, // [-]
NodeRect.Left+4+TextY, NodeRect.Bottom-4);
ColorElementTree.Canvas.Pen.Color := c; ColorElementTree.Canvas.Pen.Color := c;
ColorElementTree.Canvas.Rectangle(NodeRect.Left+4, NodeRect.Top+4, ColorElementTree.Canvas.Rectangle(NodeRect.Left+4, NodeRect.Top+4,
NodeRect.Left+4+TextY, NodeRect.Bottom-4); NodeRect.Left+4+TextY, NodeRect.Bottom-4);
@ -270,6 +269,20 @@ begin
ColorElementTree.Canvas.LineTo(NodeRect.Left+4+TextY-2, NodeRect.Top+4+(TextY div 2)); ColorElementTree.Canvas.LineTo(NodeRect.Left+4+TextY-2, NodeRect.Top+4+(TextY div 2));
ColorElementTree.Canvas.MoveTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-4); ColorElementTree.Canvas.MoveTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-4);
ColorElementTree.Canvas.LineTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-2); ColorElementTree.Canvas.LineTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-2);
// [+]
inc(NodeRect.Left, TextY+2);
ColorElementTree.Canvas.MoveTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-4);
ColorElementTree.Canvas.LineTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-2);
if (Attri.FrameColor <> clNone) and (Attri.FrameColor <> clDefault) then
ColorElementTree.Canvas.Pen.Color := Attri.FrameColor;
ColorElementTree.Canvas.Rectangle(NodeRect.Left+4, NodeRect.Top+4,
NodeRect.Left+4+TextY, NodeRect.Bottom-4);
ColorElementTree.Canvas.MoveTo(NodeRect.Left+6, NodeRect.Top+4+(TextY div 2));
ColorElementTree.Canvas.LineTo(NodeRect.Left+4+TextY-2, NodeRect.Top+4+(TextY div 2));
ColorElementTree.Canvas.MoveTo(NodeRect.Left+4+(TextY div 2), NodeRect.Top+6);
ColorElementTree.Canvas.LineTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-6);
ColorElementTree.Canvas.Brush.Style := bsSolid;
end end
else if AttriIdx = ord(ahaGutterSeparator) then begin else if AttriIdx = ord(ahaGutterSeparator) then begin
ColorElementTree.Canvas.Pen.Color := c; ColorElementTree.Canvas.Pen.Color := c;
@ -761,12 +774,18 @@ begin
AttrToShow := FCurHighlightElement.GetSchemeGlobal; AttrToShow := FCurHighlightElement.GetSchemeGlobal;
// Adjust color captions // Adjust color captions
if AttrToShow = FCurrentColorScheme.AttributeByEnum[ahaModifiedLine] then begin ForeGroundUseDefaultCheckBox.Caption := dlgForecolor;
FrameColorUseDefaultCheckBox.Caption := dlgFrameColor;
if (FCurrentColorScheme.AttributeByEnum[ahaModifiedLine] <> nil) and
(AttrToShow.StoredName = FCurrentColorScheme.AttributeByEnum[ahaModifiedLine].StoredName)
then begin
ForeGroundUseDefaultCheckBox.Caption := dlgSavedLineColor; ForeGroundUseDefaultCheckBox.Caption := dlgSavedLineColor;
FrameColorUseDefaultCheckBox.Caption := dlgUnsavedLineColor; FrameColorUseDefaultCheckBox.Caption := dlgUnsavedLineColor;
end else begin end else
ForeGroundUseDefaultCheckBox.Caption := dlgForecolor; if (FCurrentColorScheme.AttributeByEnum[ahaCodeFoldingTree] <> nil) and
FrameColorUseDefaultCheckBox.Caption := dlgFrameColor; (AttrToShow.StoredName = FCurrentColorScheme.AttributeByEnum[ahaCodeFoldingTree].StoredName)
then begin
FrameColorUseDefaultCheckBox.Caption := dlgGutterCollapsedColor;
end; end;
case FCurHighlightElement.Group of case FCurHighlightElement.Group of

View File

@ -1412,6 +1412,7 @@ resourcestring
dlgFrameColor = 'Frame color'; dlgFrameColor = 'Frame color';
dlgUnsavedLineColor = 'Unsaved line'; dlgUnsavedLineColor = 'Unsaved line';
dlgSavedLineColor = 'Saved line'; dlgSavedLineColor = 'Saved line';
dlgGutterCollapsedColor = 'Collapsed';
dlgElementAttributes = 'Element Attributes'; dlgElementAttributes = 'Element Attributes';
dlgEdBold = 'Bold'; dlgEdBold = 'Bold';
dlgEdItal = 'Italic'; dlgEdItal = 'Italic';