From 2cec83d0689d2fe0a2c636bba3664b18ca6720f8 Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 4 Jun 2010 21:04:34 +0000 Subject: [PATCH] EditorOptions: Added color for [+] fold node git-svn-id: trunk@25902 - --- ide/editoroptions.pp | 2 +- ide/frames/editor_color_options.pas | 41 +++++++++++++++++++++-------- ide/lazarusidestrconsts.pas | 1 + 3 files changed, 32 insertions(+), 12 deletions(-) diff --git a/ide/editoroptions.pp b/ide/editoroptions.pp index e34c2de056..444df95d33 100644 --- a/ide/editoroptions.pp +++ b/ide/editoroptions.pp @@ -168,7 +168,7 @@ const { ahaLineNumber } [hafBackColor, hafForeColor, hafFrameColor, hafStyle, hafStyleMask], { ahaLineHighlight } [hafBackColor, hafForeColor, hafFrameColor, hafStyle, hafStyleMask], { ahaModifiedLine } [hafBackColor, hafForeColor, hafFrameColor], - { ahaCodeFoldingTree } [hafBackColor, hafForeColor], + { ahaCodeFoldingTree } [hafBackColor, hafForeColor, hafFrameColor], { ahaHighlightWord } [hafBackColor, hafForeColor, hafFrameColor, hafStyle, hafStyleMask], { ahaFoldedCode } [hafBackColor, hafForeColor, hafFrameColor, hafStyle, hafStyleMask], { ahaWordGroup } [hafBackColor, hafForeColor, hafFrameColor, hafStyle, hafStyleMask], diff --git a/ide/frames/editor_color_options.pas b/ide/frames/editor_color_options.pas index 812f23053f..f9c5a87e89 100644 --- a/ide/frames/editor_color_options.pas +++ b/ide/frames/editor_color_options.pas @@ -210,18 +210,18 @@ begin ColorElementTree.Canvas.FillRect(NodeRect); ColorElementTree.Canvas.TextOut(NodeRect.Left+FullAbcWidth, TextY, Attri.Name); - // Draw preview box + // Draw preview box - Background c := clNone; if (hafBackColor in Attri.Features) then c := Attri.Background; - // Fallback color for gutter + // Fallback Background-color for gutter if ((c = clNone) or (c = clDefault)) and (AttriIdx in [ord(ahaModifiedLine), ord(ahaCodeFoldingTree), ord(ahaLineNumber), ord(ahaGutterSeparator)]) and (FCurrentColorScheme.AttributeByEnum[ahaGutter] <> nil) then c := FCurrentColorScheme.AttributeByEnum[ahaGutter].Background; - // Fallback color for text + // Fallback Background-color for text if (c = clNone) or (c = clDefault) then c := FCurrentColorScheme.DefaultAttribute.Background; if (c = clNone) or (c = clDefault) then @@ -241,7 +241,7 @@ begin // Draw preview Frame 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) then ColorElementTree.Canvas.Rectangle(NodeRect.Left+2, NodeRect.Top+2, @@ -260,9 +260,8 @@ begin if AttriIdx = ord(ahaCodeFoldingTree) then begin // Special draw fold gutter 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.Rectangle(NodeRect.Left+4, NodeRect.Top+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.MoveTo(NodeRect.Left+4+(TextY div 2), NodeRect.Bottom-4); 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 else if AttriIdx = ord(ahaGutterSeparator) then begin ColorElementTree.Canvas.Pen.Color := c; @@ -761,12 +774,18 @@ begin AttrToShow := FCurHighlightElement.GetSchemeGlobal; // 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; FrameColorUseDefaultCheckBox.Caption := dlgUnsavedLineColor; - end else begin - ForeGroundUseDefaultCheckBox.Caption := dlgForecolor; - FrameColorUseDefaultCheckBox.Caption := dlgFrameColor; + end else + if (FCurrentColorScheme.AttributeByEnum[ahaCodeFoldingTree] <> nil) and + (AttrToShow.StoredName = FCurrentColorScheme.AttributeByEnum[ahaCodeFoldingTree].StoredName) + then begin + FrameColorUseDefaultCheckBox.Caption := dlgGutterCollapsedColor; end; case FCurHighlightElement.Group of diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index 6f7996c488..ebf060fb1b 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -1412,6 +1412,7 @@ resourcestring dlgFrameColor = 'Frame color'; dlgUnsavedLineColor = 'Unsaved line'; dlgSavedLineColor = 'Saved line'; + dlgGutterCollapsedColor = 'Collapsed'; dlgElementAttributes = 'Element Attributes'; dlgEdBold = 'Bold'; dlgEdItal = 'Italic';